@aztec/archiver 5.0.0-nightly.20260708 → 5.0.0-nightly.20260710
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dest/config.d.ts +1 -1
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +5 -0
- package/dest/factory.d.ts +8 -1
- package/dest/factory.d.ts.map +1 -1
- package/dest/factory.js +31 -0
- package/package.json +14 -13
- package/src/config.ts +8 -0
- package/src/factory.ts +34 -0
package/dest/config.d.ts
CHANGED
|
@@ -31,4 +31,4 @@ export declare function mapArchiverConfig(config: Partial<ArchiverConfig>): {
|
|
|
31
31
|
orphanPruneNoProposalTolerance: number | undefined;
|
|
32
32
|
skipOrphanProposedBlockPruning: boolean | undefined;
|
|
33
33
|
};
|
|
34
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
34
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlnLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvY29uZmlnLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxLQUFLLGdCQUFnQixFQUEyQixNQUFNLGtDQUFrQyxDQUFDO0FBQ2xHLE9BQU8sRUFBRSxLQUFLLGlCQUFpQixFQUE2QixNQUFNLHdCQUF3QixDQUFDO0FBQzNGLE9BQU8sRUFBRSxLQUFLLGNBQWMsRUFBMEIsTUFBTSwyQkFBMkIsQ0FBQztBQUN4RixPQUFPLEVBQ0wsS0FBSyxrQkFBa0IsRUFLeEIsTUFBTSwwQkFBMEIsQ0FBQztBQUNsQyxPQUFPLEVBQUUsS0FBSyxXQUFXLEVBQUUsS0FBSyxlQUFlLEVBQXVCLE1BQU0sc0JBQXNCLENBQUM7QUFDbkcsT0FBTyxLQUFLLEVBQUUsc0JBQXNCLEVBQUUsTUFBTSxpQ0FBaUMsQ0FBQztBQUc5RTs7Ozs7O0dBTUc7QUFDSCxNQUFNLE1BQU0sY0FBYyxHQUFHLHNCQUFzQixHQUNqRCxjQUFjLEdBQ2QsaUJBQWlCLEdBQ2pCLGdCQUFnQixHQUNoQixXQUFXLEdBQ1gsSUFBSSxDQUFDLGVBQWUsRUFBRSxpQkFBaUIsR0FBRyxvQ0FBb0MsQ0FBQyxDQUFDO0FBRWxGLGVBQU8sTUFBTSxzQkFBc0IsRUFBRSxrQkFBa0IsQ0FBQyxjQUFjLENBZ0ZyRSxDQUFDO0FBRUY7Ozs7R0FJRztBQUNILHdCQUFnQix3QkFBd0IsSUFBSSxjQUFjLENBRXpEO0FBRUQsZ0ZBQWdGO0FBQ2hGLHdCQUFnQixpQkFBaUIsQ0FBQyxNQUFNLEVBQUUsT0FBTyxDQUFDLGNBQWMsQ0FBQzs7Ozs7Ozs7OztFQVloRSJ9
|
package/dest/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAA2B,MAAM,kCAAkC,CAAC;AAClG,OAAO,EAAE,KAAK,iBAAiB,EAA6B,MAAM,wBAAwB,CAAC;AAC3F,OAAO,EAAE,KAAK,cAAc,EAA0B,MAAM,2BAA2B,CAAC;AACxF,OAAO,EACL,KAAK,kBAAkB,EAKxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,eAAe,EAAuB,MAAM,sBAAsB,CAAC;AACnG,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAG9E;;;;;;GAMG;AACH,MAAM,MAAM,cAAc,GAAG,sBAAsB,GACjD,cAAc,GACd,iBAAiB,GACjB,gBAAgB,GAChB,WAAW,GACX,IAAI,CAAC,eAAe,EAAE,iBAAiB,GAAG,oCAAoC,CAAC,CAAC;AAElF,eAAO,MAAM,sBAAsB,EAAE,kBAAkB,CAAC,cAAc,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAA2B,MAAM,kCAAkC,CAAC;AAClG,OAAO,EAAE,KAAK,iBAAiB,EAA6B,MAAM,wBAAwB,CAAC;AAC3F,OAAO,EAAE,KAAK,cAAc,EAA0B,MAAM,2BAA2B,CAAC;AACxF,OAAO,EACL,KAAK,kBAAkB,EAKxB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,KAAK,WAAW,EAAE,KAAK,eAAe,EAAuB,MAAM,sBAAsB,CAAC;AACnG,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,iCAAiC,CAAC;AAG9E;;;;;;GAMG;AACH,MAAM,MAAM,cAAc,GAAG,sBAAsB,GACjD,cAAc,GACd,iBAAiB,GACjB,gBAAgB,GAChB,WAAW,GACX,IAAI,CAAC,eAAe,EAAE,iBAAiB,GAAG,oCAAoC,CAAC,CAAC;AAElF,eAAO,MAAM,sBAAsB,EAAE,kBAAkB,CAAC,cAAc,CAgFrE,CAAC;AAEF;;;;GAIG;AACH,wBAAgB,wBAAwB,IAAI,cAAc,CAEzD;AAED,gFAAgF;AAChF,wBAAgB,iBAAiB,CAAC,MAAM,EAAE,OAAO,CAAC,cAAc,CAAC;;;;;;;;;;EAYhE"}
|
package/dest/config.js
CHANGED
|
@@ -64,6 +64,11 @@ export const archiverConfigMappings = {
|
|
|
64
64
|
description: 'Skip pruning orphan proposed blocks that have no matching proposed checkpoint.',
|
|
65
65
|
...booleanConfigHelper(false)
|
|
66
66
|
},
|
|
67
|
+
testPreloadStandardContracts: {
|
|
68
|
+
env: 'TEST_PRELOAD_STANDARD_CONTRACTS',
|
|
69
|
+
description: 'Preload the standard contracts (AuthRegistry, PublicChecks, HandshakeRegistry) into the contract store at ' + 'block 0. For test environments only, and only safe when genesis seeds the matching registration/deployment ' + 'nullifiers; otherwise a later on-chain publish would collide with the block-0 preload.',
|
|
70
|
+
...booleanConfigHelper(false)
|
|
71
|
+
},
|
|
67
72
|
...chainConfigMappings,
|
|
68
73
|
...l1ReaderConfigMappings,
|
|
69
74
|
viemPollingIntervalMS: {
|
package/dest/factory.d.ts
CHANGED
|
@@ -22,4 +22,11 @@ export declare function createArchiver(config: ArchiverConfig & DataStoreConfig,
|
|
|
22
22
|
} | undefined, initialHeader: BlockHeader, initialBlockHash: BlockHash): Promise<Archiver>;
|
|
23
23
|
/** Registers protocol contracts in the archiver store. Idempotent — skips contracts that already exist (e.g. on node restart). */
|
|
24
24
|
export declare function registerProtocolContracts(stores: ArchiverDataStores): Promise<void>;
|
|
25
|
-
|
|
25
|
+
/**
|
|
26
|
+
* Preloads the standard contracts (AuthRegistry, PublicChecks, HandshakeRegistry) into the archiver store at block 0,
|
|
27
|
+
* mirroring {@link registerProtocolContracts}. Only invoked for test environments (via `testPreloadStandardContracts`),
|
|
28
|
+
* which also seed the matching registration/deployment nullifiers into the genesis nullifier tree so the store and tree
|
|
29
|
+
* stay consistent. Idempotent — skips contracts that already exist (e.g. on node restart).
|
|
30
|
+
*/
|
|
31
|
+
export declare function registerStandardContracts(stores: ArchiverDataStores): Promise<void>;
|
|
32
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmFjdG9yeS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL2ZhY3RvcnkudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBZ0JBLE9BQU8sS0FBSyxFQUFtQixTQUFTLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQUd0RSxPQUFPLEtBQUssRUFBRSxlQUFlLEVBQUUsTUFBTSx3QkFBd0IsQ0FBQztBQUs5RCxPQUFPLEtBQUssRUFBRSxXQUFXLEVBQUUsTUFBTSxrQkFBa0IsQ0FBQztBQU1wRCxPQUFPLEVBQUUsUUFBUSxFQUFFLEtBQUssWUFBWSxFQUFFLE1BQU0sZUFBZSxDQUFDO0FBQzVELE9BQU8sRUFBRSxLQUFLLGNBQWMsRUFBcUIsTUFBTSxhQUFhLENBQUM7QUFHckUsT0FBTyxFQUF1QixLQUFLLGtCQUFrQixFQUE0QixNQUFNLHdCQUF3QixDQUFDO0FBR2hILGVBQU8sTUFBTSxtQkFBbUIsYUFBYSxDQUFDO0FBRTlDLGlDQUFpQztBQUNqQyx3QkFBc0IsbUJBQW1CLENBQ3ZDLFVBQVUsRUFBRSxJQUFJLENBQUMsY0FBYyxFQUFFLHdCQUF3QixDQUFDLEdBQUcsZUFBZSxFQUM1RSxnQkFBZ0IsRUFBRSxTQUFTLEdBQzFCLE9BQU8sQ0FBQyxrQkFBa0IsQ0FBQyxDQU83QjtBQUVEOzs7Ozs7Ozs7R0FTRztBQUNILHdCQUFzQixjQUFjLENBQ2xDLE1BQU0sRUFBRSxjQUFjLEdBQUcsZUFBZSxFQUN4QyxJQUFJLEVBQUUsWUFBWSxFQUNsQixJQUFJOzthQUF3RCxFQUM1RCxhQUFhLEVBQUUsV0FBVyxFQUMxQixnQkFBZ0IsRUFBRSxTQUFTLEdBQzFCLE9BQU8sQ0FBQyxRQUFRLENBQUMsQ0F3SW5CO0FBRUQsb0lBQWtJO0FBQ2xJLHdCQUFzQix5QkFBeUIsQ0FBQyxNQUFNLEVBQUUsa0JBQWtCLGlCQXlCekU7QUFFRDs7Ozs7R0FLRztBQUNILHdCQUFzQix5QkFBeUIsQ0FBQyxNQUFNLEVBQUUsa0JBQWtCLGlCQXNCekUifQ==
|
package/dest/factory.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../src/factory.ts"],"names":[],"mappings":"AAgBA,OAAO,KAAK,EAAmB,SAAS,EAAE,MAAM,qBAAqB,CAAC;AAGtE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC;AAK9D,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAMpD,OAAO,EAAE,QAAQ,EAAE,KAAK,YAAY,EAAE,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAE,KAAK,cAAc,EAAqB,MAAM,aAAa,CAAC;AAGrE,OAAO,EAAuB,KAAK,kBAAkB,EAA4B,MAAM,wBAAwB,CAAC;AAGhH,eAAO,MAAM,mBAAmB,aAAa,CAAC;AAE9C,iCAAiC;AACjC,wBAAsB,mBAAmB,CACvC,UAAU,EAAE,IAAI,CAAC,cAAc,EAAE,wBAAwB,CAAC,GAAG,eAAe,EAC5E,gBAAgB,EAAE,SAAS,GAC1B,OAAO,CAAC,kBAAkB,CAAC,CAO7B;AAED;;;;;;;;;GASG;AACH,wBAAsB,cAAc,CAClC,MAAM,EAAE,cAAc,GAAG,eAAe,EACxC,IAAI,EAAE,YAAY,EAClB,IAAI;;aAAwD,EAC5D,aAAa,EAAE,WAAW,EAC1B,gBAAgB,EAAE,SAAS,GAC1B,OAAO,CAAC,QAAQ,CAAC,CAwInB;AAED,oIAAkI;AAClI,wBAAsB,yBAAyB,CAAC,MAAM,EAAE,kBAAkB,iBAyBzE;AAED;;;;;GAKG;AACH,wBAAsB,yBAAyB,CAAC,MAAM,EAAE,kBAAkB,iBAsBzE"}
|
package/dest/factory.js
CHANGED
|
@@ -11,6 +11,7 @@ import { DateProvider } from '@aztec/foundation/timer';
|
|
|
11
11
|
import { createStore } from '@aztec/kv-store/lmdb-v2';
|
|
12
12
|
import { protocolContractNames } from '@aztec/protocol-contracts';
|
|
13
13
|
import { BundledProtocolContractsProvider } from '@aztec/protocol-contracts/providers/bundle';
|
|
14
|
+
import { getPublishableStandardContracts } from '@aztec/standard-contracts';
|
|
14
15
|
import { FunctionType, decodeFunctionSignature } from '@aztec/stdlib/abi';
|
|
15
16
|
import { DEFAULT_BLOCK_DURATION_MS } from '@aztec/stdlib/config';
|
|
16
17
|
import { computePublicBytecodeCommitment } from '@aztec/stdlib/contract';
|
|
@@ -47,6 +48,9 @@ export const ARCHIVER_STORE_NAME = 'archiver';
|
|
|
47
48
|
}, initialHeader, initialBlockHash) {
|
|
48
49
|
const archiverStore = await createArchiverStore(config, initialBlockHash);
|
|
49
50
|
await registerProtocolContracts(archiverStore);
|
|
51
|
+
if (config.testPreloadStandardContracts) {
|
|
52
|
+
await registerStandardContracts(archiverStore);
|
|
53
|
+
}
|
|
50
54
|
// Create Ethereum clients
|
|
51
55
|
const chain = createEthereumChain(config.l1RpcUrls, config.l1ChainId);
|
|
52
56
|
const httpTimeout = config.l1HttpTimeoutMS;
|
|
@@ -150,3 +154,30 @@ export const ARCHIVER_STORE_NAME = 'archiver';
|
|
|
150
154
|
], BlockNumber(blockNumber));
|
|
151
155
|
}
|
|
152
156
|
}
|
|
157
|
+
/**
|
|
158
|
+
* Preloads the standard contracts (AuthRegistry, PublicChecks, HandshakeRegistry) into the archiver store at block 0,
|
|
159
|
+
* mirroring {@link registerProtocolContracts}. Only invoked for test environments (via `testPreloadStandardContracts`),
|
|
160
|
+
* which also seed the matching registration/deployment nullifiers into the genesis nullifier tree so the store and tree
|
|
161
|
+
* stay consistent. Idempotent — skips contracts that already exist (e.g. on node restart).
|
|
162
|
+
*/ export async function registerStandardContracts(stores) {
|
|
163
|
+
const blockNumber = 0;
|
|
164
|
+
for (const contract of (await getPublishableStandardContracts())){
|
|
165
|
+
// Skip if already registered (happens on node restart with a persisted store).
|
|
166
|
+
if (await stores.contractClasses.getContractClass(contract.contractClass.id)) {
|
|
167
|
+
continue;
|
|
168
|
+
}
|
|
169
|
+
const publicBytecodeCommitment = await computePublicBytecodeCommitment(contract.contractClass.packedBytecode);
|
|
170
|
+
const contractClassPublic = {
|
|
171
|
+
...contract.contractClass,
|
|
172
|
+
publicBytecodeCommitment
|
|
173
|
+
};
|
|
174
|
+
const publicFunctionSignatures = contract.artifact.functions.filter((fn)=>fn.functionType === FunctionType.PUBLIC).map((fn)=>decodeFunctionSignature(fn.name, fn.parameters));
|
|
175
|
+
await stores.functionNames.register(publicFunctionSignatures);
|
|
176
|
+
await stores.contractClasses.addContractClasses([
|
|
177
|
+
contractClassPublic
|
|
178
|
+
], BlockNumber(blockNumber));
|
|
179
|
+
await stores.contractInstances.addContractInstances([
|
|
180
|
+
contract.instance
|
|
181
|
+
], BlockNumber(blockNumber));
|
|
182
|
+
}
|
|
183
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/archiver",
|
|
3
|
-
"version": "5.0.0-nightly.
|
|
3
|
+
"version": "5.0.0-nightly.20260710",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/index.js",
|
|
@@ -65,18 +65,19 @@
|
|
|
65
65
|
]
|
|
66
66
|
},
|
|
67
67
|
"dependencies": {
|
|
68
|
-
"@aztec/blob-client": "5.0.0-nightly.
|
|
69
|
-
"@aztec/blob-lib": "5.0.0-nightly.
|
|
70
|
-
"@aztec/constants": "5.0.0-nightly.
|
|
71
|
-
"@aztec/epoch-cache": "5.0.0-nightly.
|
|
72
|
-
"@aztec/ethereum": "5.0.0-nightly.
|
|
73
|
-
"@aztec/foundation": "5.0.0-nightly.
|
|
74
|
-
"@aztec/kv-store": "5.0.0-nightly.
|
|
75
|
-
"@aztec/l1-artifacts": "5.0.0-nightly.
|
|
76
|
-
"@aztec/noir-protocol-circuits-types": "5.0.0-nightly.
|
|
77
|
-
"@aztec/protocol-contracts": "5.0.0-nightly.
|
|
78
|
-
"@aztec/
|
|
79
|
-
"@aztec/
|
|
68
|
+
"@aztec/blob-client": "5.0.0-nightly.20260710",
|
|
69
|
+
"@aztec/blob-lib": "5.0.0-nightly.20260710",
|
|
70
|
+
"@aztec/constants": "5.0.0-nightly.20260710",
|
|
71
|
+
"@aztec/epoch-cache": "5.0.0-nightly.20260710",
|
|
72
|
+
"@aztec/ethereum": "5.0.0-nightly.20260710",
|
|
73
|
+
"@aztec/foundation": "5.0.0-nightly.20260710",
|
|
74
|
+
"@aztec/kv-store": "5.0.0-nightly.20260710",
|
|
75
|
+
"@aztec/l1-artifacts": "5.0.0-nightly.20260710",
|
|
76
|
+
"@aztec/noir-protocol-circuits-types": "5.0.0-nightly.20260710",
|
|
77
|
+
"@aztec/protocol-contracts": "5.0.0-nightly.20260710",
|
|
78
|
+
"@aztec/standard-contracts": "5.0.0-nightly.20260710",
|
|
79
|
+
"@aztec/stdlib": "5.0.0-nightly.20260710",
|
|
80
|
+
"@aztec/telemetry-client": "5.0.0-nightly.20260710",
|
|
80
81
|
"lodash.groupby": "^4.6.0",
|
|
81
82
|
"lodash.omit": "^4.5.0",
|
|
82
83
|
"tslib": "^2.5.0",
|
package/src/config.ts
CHANGED
|
@@ -90,6 +90,14 @@ export const archiverConfigMappings: ConfigMappingsType<ArchiverConfig> = {
|
|
|
90
90
|
description: 'Skip pruning orphan proposed blocks that have no matching proposed checkpoint.',
|
|
91
91
|
...booleanConfigHelper(false),
|
|
92
92
|
},
|
|
93
|
+
testPreloadStandardContracts: {
|
|
94
|
+
env: 'TEST_PRELOAD_STANDARD_CONTRACTS',
|
|
95
|
+
description:
|
|
96
|
+
'Preload the standard contracts (AuthRegistry, PublicChecks, HandshakeRegistry) into the contract store at ' +
|
|
97
|
+
'block 0. For test environments only, and only safe when genesis seeds the matching registration/deployment ' +
|
|
98
|
+
'nullifiers; otherwise a later on-chain publish would collide with the block-0 preload.',
|
|
99
|
+
...booleanConfigHelper(false),
|
|
100
|
+
},
|
|
93
101
|
...chainConfigMappings,
|
|
94
102
|
...l1ReaderConfigMappings,
|
|
95
103
|
viemPollingIntervalMS: {
|
package/src/factory.ts
CHANGED
|
@@ -12,6 +12,7 @@ import { DateProvider } from '@aztec/foundation/timer';
|
|
|
12
12
|
import { createStore } from '@aztec/kv-store/lmdb-v2';
|
|
13
13
|
import { protocolContractNames } from '@aztec/protocol-contracts';
|
|
14
14
|
import { BundledProtocolContractsProvider } from '@aztec/protocol-contracts/providers/bundle';
|
|
15
|
+
import { getPublishableStandardContracts } from '@aztec/standard-contracts';
|
|
15
16
|
import { FunctionType, decodeFunctionSignature } from '@aztec/stdlib/abi';
|
|
16
17
|
import type { ArchiverEmitter, BlockHash } from '@aztec/stdlib/block';
|
|
17
18
|
import { DEFAULT_BLOCK_DURATION_MS } from '@aztec/stdlib/config';
|
|
@@ -68,6 +69,9 @@ export async function createArchiver(
|
|
|
68
69
|
): Promise<Archiver> {
|
|
69
70
|
const archiverStore = await createArchiverStore(config, initialBlockHash);
|
|
70
71
|
await registerProtocolContracts(archiverStore);
|
|
72
|
+
if (config.testPreloadStandardContracts) {
|
|
73
|
+
await registerStandardContracts(archiverStore);
|
|
74
|
+
}
|
|
71
75
|
|
|
72
76
|
// Create Ethereum clients
|
|
73
77
|
const chain = createEthereumChain(config.l1RpcUrls, config.l1ChainId);
|
|
@@ -227,3 +231,33 @@ export async function registerProtocolContracts(stores: ArchiverDataStores) {
|
|
|
227
231
|
await stores.contractInstances.addContractInstances([contract.instance], BlockNumber(blockNumber));
|
|
228
232
|
}
|
|
229
233
|
}
|
|
234
|
+
|
|
235
|
+
/**
|
|
236
|
+
* Preloads the standard contracts (AuthRegistry, PublicChecks, HandshakeRegistry) into the archiver store at block 0,
|
|
237
|
+
* mirroring {@link registerProtocolContracts}. Only invoked for test environments (via `testPreloadStandardContracts`),
|
|
238
|
+
* which also seed the matching registration/deployment nullifiers into the genesis nullifier tree so the store and tree
|
|
239
|
+
* stay consistent. Idempotent — skips contracts that already exist (e.g. on node restart).
|
|
240
|
+
*/
|
|
241
|
+
export async function registerStandardContracts(stores: ArchiverDataStores) {
|
|
242
|
+
const blockNumber = 0;
|
|
243
|
+
for (const contract of await getPublishableStandardContracts()) {
|
|
244
|
+
// Skip if already registered (happens on node restart with a persisted store).
|
|
245
|
+
if (await stores.contractClasses.getContractClass(contract.contractClass.id)) {
|
|
246
|
+
continue;
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
const publicBytecodeCommitment = await computePublicBytecodeCommitment(contract.contractClass.packedBytecode);
|
|
250
|
+
const contractClassPublic: ContractClassPublicWithCommitment = {
|
|
251
|
+
...contract.contractClass,
|
|
252
|
+
publicBytecodeCommitment,
|
|
253
|
+
};
|
|
254
|
+
|
|
255
|
+
const publicFunctionSignatures = contract.artifact.functions
|
|
256
|
+
.filter(fn => fn.functionType === FunctionType.PUBLIC)
|
|
257
|
+
.map(fn => decodeFunctionSignature(fn.name, fn.parameters));
|
|
258
|
+
|
|
259
|
+
await stores.functionNames.register(publicFunctionSignatures);
|
|
260
|
+
await stores.contractClasses.addContractClasses([contractClassPublic], BlockNumber(blockNumber));
|
|
261
|
+
await stores.contractInstances.addContractInstances([contract.instance], BlockNumber(blockNumber));
|
|
262
|
+
}
|
|
263
|
+
}
|