@aztec/aztec 0.85.0 → 0.86.0
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/cli/chain_l2_config.js +1 -1
- package/dest/cli/cmds/start_archiver.d.ts.map +1 -1
- package/dest/cli/cmds/start_archiver.js +6 -8
- package/dest/cli/cmds/start_node.d.ts.map +1 -1
- package/dest/cli/cmds/start_node.js +1 -3
- package/dest/cli/cmds/start_prover_node.d.ts.map +1 -1
- package/dest/cli/cmds/start_prover_node.js +3 -5
- package/dest/examples/util.d.ts +3 -4
- package/dest/examples/util.d.ts.map +1 -1
- package/dest/examples/util.js +4 -5
- package/dest/sandbox/sandbox.d.ts +0 -1
- package/dest/sandbox/sandbox.d.ts.map +1 -1
- package/dest/sandbox/sandbox.js +2 -4
- package/package.json +30 -32
- package/src/cli/chain_l2_config.ts +1 -1
- package/src/cli/cmds/start_archiver.ts +4 -9
- package/src/cli/cmds/start_node.ts +1 -5
- package/src/cli/cmds/start_prover_node.ts +4 -6
- package/src/examples/util.ts +5 -7
- package/src/sandbox/sandbox.ts +2 -7
|
@@ -29,7 +29,7 @@ export const alphaTestnetL2ChainConfig = {
|
|
|
29
29
|
p2pEnabled: true,
|
|
30
30
|
p2pBootstrapNodes: [],
|
|
31
31
|
registryAddress: '0x4d2cc1d5fb6be65240e0bfc8154243e69c0fb19e',
|
|
32
|
-
slashFactoryAddress: '
|
|
32
|
+
slashFactoryAddress: '0x3c9ccf55a8ac3c2eeedf2ee2aa1722188fd676be',
|
|
33
33
|
feeAssetHandlerAddress: '0x80d848dc9f52df56789e2d62ce66f19555ff1019',
|
|
34
34
|
seqMinTxsPerBlock: 0,
|
|
35
35
|
seqMaxTxsPerBlock: 4,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start_archiver.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_archiver.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EAIpB,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"start_archiver.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_archiver.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,cAAc,EAIpB,MAAM,iBAAiB,CAAC;AAGzB,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,EAAE,KAAK,eAAe,EAAsB,MAAM,wBAAwB,CAAC;AAQlF,YAAY,EAAE,cAAc,EAAE,eAAe,EAAE,CAAC;AAEhD,oCAAoC;AACpC,wBAAsB,aAAa,CACjC,OAAO,EAAE,GAAG,EACZ,cAAc,EAAE,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,EACvC,QAAQ,EAAE,qBAAqB,GAC9B,OAAO,CAAC;IAAE,MAAM,EAAE,cAAc,GAAG,eAAe,CAAA;CAAE,CAAC,CAmCvD"}
|
|
@@ -1,18 +1,14 @@
|
|
|
1
1
|
import { Archiver, KVArchiverDataStore, archiverConfigMappings, getArchiverConfigFromEnv } from '@aztec/archiver';
|
|
2
2
|
import { createLogger } from '@aztec/aztec.js';
|
|
3
|
-
import { blobSinkConfigMapping, createBlobSinkClient
|
|
4
|
-
import { dataConfigMappings
|
|
3
|
+
import { blobSinkConfigMapping, createBlobSinkClient } from '@aztec/blob-sink/client';
|
|
4
|
+
import { dataConfigMappings } from '@aztec/kv-store/config';
|
|
5
5
|
import { createStore } from '@aztec/kv-store/lmdb-v2';
|
|
6
6
|
import { ArchiverApiSchema } from '@aztec/stdlib/interfaces/server';
|
|
7
7
|
import { getConfigEnvVars as getTelemetryClientConfig, initTelemetryClient } from '@aztec/telemetry-client';
|
|
8
8
|
import { getL1Config } from '../get_l1_config.js';
|
|
9
9
|
import { extractRelevantOptions } from '../util.js';
|
|
10
10
|
/** Starts a standalone archiver. */ export async function startArchiver(options, signalHandlers, services) {
|
|
11
|
-
const envConfig =
|
|
12
|
-
...getArchiverConfigFromEnv(),
|
|
13
|
-
...getDataConfigFromEnv(),
|
|
14
|
-
...getBlobSinkConfigFromEnv()
|
|
15
|
-
};
|
|
11
|
+
const envConfig = getArchiverConfigFromEnv();
|
|
16
12
|
const cliOptions = extractRelevantOptions(options, {
|
|
17
13
|
...archiverConfigMappings,
|
|
18
14
|
...dataConfigMappings,
|
|
@@ -36,7 +32,9 @@ import { extractRelevantOptions } from '../util.js';
|
|
|
36
32
|
const store = await createStore('archiver', KVArchiverDataStore.SCHEMA_VERSION, archiverConfig, storeLog);
|
|
37
33
|
const archiverStore = new KVArchiverDataStore(store, archiverConfig.maxLogs);
|
|
38
34
|
const telemetry = initTelemetryClient(getTelemetryClientConfig());
|
|
39
|
-
const blobSinkClient = createBlobSinkClient(archiverConfig
|
|
35
|
+
const blobSinkClient = createBlobSinkClient(archiverConfig, {
|
|
36
|
+
logger: createLogger('archiver:blob-sink:client')
|
|
37
|
+
});
|
|
40
38
|
const archiver = await Archiver.createAndSync(archiverConfig, archiverStore, {
|
|
41
39
|
telemetry,
|
|
42
40
|
blobSinkClient
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start_node.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_node.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,eAAe,EAA6C,MAAM,mBAAmB,CAAC;AAIpG,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAgBnD,wBAAsB,SAAS,CAC7B,OAAO,EAAE,GAAG,EACZ,cAAc,EAAE,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,EACvC,QAAQ,EAAE,qBAAqB,EAC/B,aAAa,EAAE,qBAAqB,EACpC,OAAO,EAAE,KAAK,GACb,OAAO,CAAC;IAAE,MAAM,EAAE,eAAe,CAAA;CAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"start_node.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_node.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,eAAe,EAA6C,MAAM,mBAAmB,CAAC;AAIpG,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAC/E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAgBnD,wBAAsB,SAAS,CAC7B,OAAO,EAAE,GAAG,EACZ,cAAc,EAAE,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,EACvC,QAAQ,EAAE,qBAAqB,EAC/B,aAAa,EAAE,qBAAqB,EACpC,OAAO,EAAE,KAAK,GACb,OAAO,CAAC;IAAE,MAAM,EAAE,eAAe,CAAA;CAAE,CAAC,CAuJtC"}
|
|
@@ -34,8 +34,7 @@ export async function startNode(options, signalHandlers, services, adminServices
|
|
|
34
34
|
] : [];
|
|
35
35
|
const initialFundedAccounts = testAccounts.concat(sponsoredFPCAccounts);
|
|
36
36
|
userLog(`Initial funded accounts: ${initialFundedAccounts.map((a)=>a.toString()).join(', ')}`);
|
|
37
|
-
const {
|
|
38
|
-
userLog(`Genesis block hash: ${genesisBlockHash.toString()}`);
|
|
37
|
+
const { genesisArchiveRoot, prefilledPublicData, fundingNeeded } = await getGenesisValues(initialFundedAccounts);
|
|
39
38
|
userLog(`Genesis archive root: ${genesisArchiveRoot.toString()}`);
|
|
40
39
|
// Deploy contracts if needed
|
|
41
40
|
if (nodeSpecificOptions.deployAztecContracts || nodeSpecificOptions.deployAztecContractsSalt) {
|
|
@@ -51,7 +50,6 @@ export async function startNode(options, signalHandlers, services, adminServices
|
|
|
51
50
|
await deployContractsToL1(nodeConfig, account, undefined, {
|
|
52
51
|
assumeProvenThroughBlockNumber: nodeSpecificOptions.assumeProvenThroughBlockNumber,
|
|
53
52
|
salt: nodeSpecificOptions.deployAztecContractsSalt,
|
|
54
|
-
genesisBlockHash,
|
|
55
53
|
genesisArchiveRoot,
|
|
56
54
|
feeJuicePortalInitialBalance: fundingNeeded
|
|
57
55
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"start_prover_node.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_prover_node.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAE/E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EACL,KAAK,gBAAgB,EAItB,MAAM,oBAAoB,CAAC;AAY5B,wBAAsB,eAAe,CACnC,OAAO,EAAE,GAAG,EACZ,cAAc,EAAE,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,EACvC,QAAQ,EAAE,qBAAqB,EAC/B,OAAO,EAAE,KAAK,GACb,OAAO,CAAC;IAAE,MAAM,EAAE,gBAAgB,CAAA;CAAE,CAAC,
|
|
1
|
+
{"version":3,"file":"start_prover_node.d.ts","sourceRoot":"","sources":["../../../src/cli/cmds/start_prover_node.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mCAAmC,CAAC;AAE/E,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,uBAAuB,CAAC;AAEnD,OAAO,EACL,KAAK,gBAAgB,EAItB,MAAM,oBAAoB,CAAC;AAY5B,wBAAsB,eAAe,CACnC,OAAO,EAAE,GAAG,EACZ,cAAc,EAAE,CAAC,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,EACvC,QAAQ,EAAE,qBAAqB,EAC/B,OAAO,EAAE,KAAK,GACb,OAAO,CAAC;IAAE,MAAM,EAAE,gBAAgB,CAAA;CAAE,CAAC,CA4FvC"}
|
|
@@ -50,8 +50,7 @@ export async function startProverNode(options, signalHandlers, services, userLog
|
|
|
50
50
|
] : [];
|
|
51
51
|
const initialFundedAccounts = testAccounts.concat(sponsoredFPCAccounts);
|
|
52
52
|
userLog(`Initial funded accounts: ${initialFundedAccounts.map((a)=>a.toString()).join(', ')}`);
|
|
53
|
-
const { genesisArchiveRoot,
|
|
54
|
-
userLog(`Genesis block hash: ${genesisBlockHash.toString()}`);
|
|
53
|
+
const { genesisArchiveRoot, prefilledPublicData } = await getGenesisValues(initialFundedAccounts);
|
|
55
54
|
userLog(`Genesis archive root: ${genesisArchiveRoot.toString()}`);
|
|
56
55
|
if (!Fr.fromHexString(config.genesisArchiveTreeRoot).equals(genesisArchiveRoot)) {
|
|
57
56
|
throw new Error(`The computed genesis archive tree root ${genesisArchiveRoot} does not match the expected genesis archive tree root ${config.genesisArchiveTreeRoot} for the rollup deployed at ${addresses.rollupAddress}`);
|
|
@@ -89,8 +88,7 @@ export async function startProverNode(options, signalHandlers, services, userLog
|
|
|
89
88
|
proverNode,
|
|
90
89
|
ProverNodeApiSchema
|
|
91
90
|
];
|
|
92
|
-
|
|
93
|
-
if (p2p) {
|
|
91
|
+
if (proverNode.getP2P()) {
|
|
94
92
|
services.p2p = [
|
|
95
93
|
proverNode.getP2P(),
|
|
96
94
|
P2PApiSchema
|
|
@@ -103,7 +101,7 @@ export async function startProverNode(options, signalHandlers, services, userLog
|
|
|
103
101
|
];
|
|
104
102
|
}
|
|
105
103
|
signalHandlers.push(proverNode.stop.bind(proverNode));
|
|
106
|
-
proverNode.start();
|
|
104
|
+
await proverNode.start();
|
|
107
105
|
return {
|
|
108
106
|
config: proverConfig
|
|
109
107
|
};
|
package/dest/examples/util.d.ts
CHANGED
|
@@ -1,17 +1,16 @@
|
|
|
1
1
|
import { EthAddress } from '@aztec/aztec.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ExtendedViemWalletClient } from '@aztec/ethereum';
|
|
3
3
|
import type { Abi, Narrow } from 'abitype';
|
|
4
4
|
import type { Hex } from 'viem';
|
|
5
5
|
/**
|
|
6
6
|
* Helper function to deploy ETH contracts.
|
|
7
|
-
* @param
|
|
8
|
-
* @param publicClient - A viem PublicClient.
|
|
7
|
+
* @param l1Client - A viem WalletClient extended with public actions.
|
|
9
8
|
* @param abi - The ETH contract's ABI (as abitype's Abi).
|
|
10
9
|
* @param bytecode - The ETH contract's bytecode.
|
|
11
10
|
* @param args - Constructor arguments for the contract.
|
|
12
11
|
* @returns The ETH address the contract was deployed to.
|
|
13
12
|
*/
|
|
14
|
-
export declare function deployL1Contract(
|
|
13
|
+
export declare function deployL1Contract(l1Client: ExtendedViemWalletClient, abi: Narrow<Abi | readonly unknown[]>, bytecode: Hex, args?: readonly unknown[]): Promise<EthAddress>;
|
|
15
14
|
/**
|
|
16
15
|
* Sleep for a given number of milliseconds.
|
|
17
16
|
* @param ms - the number of milliseconds to sleep for
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/examples/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"util.d.ts","sourceRoot":"","sources":["../../src/examples/util.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAGhE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AAC3C,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,MAAM,CAAC;AAEhC;;;;;;;GAOG;AACH,wBAAsB,gBAAgB,CACpC,QAAQ,EAAE,wBAAwB,EAClC,GAAG,EAAE,MAAM,CAAC,GAAG,GAAG,SAAS,OAAO,EAAE,CAAC,EACrC,QAAQ,EAAE,GAAG,EACb,IAAI,GAAE,SAAS,OAAO,EAAO,GAC5B,OAAO,CAAC,UAAU,CAAC,CAcrB;AAED;;;GAGG;AACH,wBAAgB,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE/C"}
|
package/dest/examples/util.js
CHANGED
|
@@ -2,19 +2,18 @@ import { EthAddress } from '@aztec/aztec.js';
|
|
|
2
2
|
import { jsonStringify } from '@aztec/foundation/json-rpc';
|
|
3
3
|
/**
|
|
4
4
|
* Helper function to deploy ETH contracts.
|
|
5
|
-
* @param
|
|
6
|
-
* @param publicClient - A viem PublicClient.
|
|
5
|
+
* @param l1Client - A viem WalletClient extended with public actions.
|
|
7
6
|
* @param abi - The ETH contract's ABI (as abitype's Abi).
|
|
8
7
|
* @param bytecode - The ETH contract's bytecode.
|
|
9
8
|
* @param args - Constructor arguments for the contract.
|
|
10
9
|
* @returns The ETH address the contract was deployed to.
|
|
11
|
-
*/ export async function deployL1Contract(
|
|
12
|
-
const hash = await
|
|
10
|
+
*/ export async function deployL1Contract(l1Client, abi, bytecode, args = []) {
|
|
11
|
+
const hash = await l1Client.deployContract({
|
|
13
12
|
abi,
|
|
14
13
|
bytecode,
|
|
15
14
|
args
|
|
16
15
|
});
|
|
17
|
-
const receipt = await
|
|
16
|
+
const receipt = await l1Client.waitForTransactionReceipt({
|
|
18
17
|
hash
|
|
19
18
|
});
|
|
20
19
|
const contractAddress = receipt.contractAddress;
|
|
@@ -17,7 +17,6 @@ export declare function deployContractsToL1(aztecNodeConfig: AztecNodeConfig, hd
|
|
|
17
17
|
assumeProvenThroughBlockNumber?: number;
|
|
18
18
|
salt?: number;
|
|
19
19
|
genesisArchiveRoot?: Fr;
|
|
20
|
-
genesisBlockHash?: Fr;
|
|
21
20
|
feeJuicePortalInitialBalance?: bigint;
|
|
22
21
|
}): Promise<{
|
|
23
22
|
rollupAddress: import("@aztec/foundation/schemas").EthAddress;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sandbox.d.ts","sourceRoot":"","sources":["../../src/sandbox/sandbox.ts"],"names":[],"mappings":";AAGA,OAAO,EAAE,KAAK,eAAe,EAAE,gBAAgB,EAAoB,MAAM,mBAAmB,CAAC;AAE7F,OAAO,EAAE,KAA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Vars } from '@aztec/aztec-node';
|
|
|
5
5
|
import { AnvilTestWatcher, EthCheatCodes } from '@aztec/aztec.js/testing';
|
|
6
6
|
import { createBlobSinkClient } from '@aztec/blob-sink/client';
|
|
7
7
|
import { setupSponsoredFPC } from '@aztec/cli/cli-utils';
|
|
8
|
-
import { GENESIS_ARCHIVE_ROOT
|
|
8
|
+
import { GENESIS_ARCHIVE_ROOT } from '@aztec/constants';
|
|
9
9
|
import { NULL_KEY, createEthereumChain, deployL1Contracts, getL1ContractsConfigEnvVars, waitForPublicClient } from '@aztec/ethereum';
|
|
10
10
|
import { Fr } from '@aztec/foundation/fields';
|
|
11
11
|
import { createLogger } from '@aztec/foundation/log';
|
|
@@ -38,7 +38,6 @@ const localAnvil = foundry;
|
|
|
38
38
|
vkTreeRoot: getVKTreeRoot(),
|
|
39
39
|
protocolContractTreeRoot,
|
|
40
40
|
genesisArchiveRoot: opts.genesisArchiveRoot ?? new Fr(GENESIS_ARCHIVE_ROOT),
|
|
41
|
-
genesisBlockHash: opts.genesisBlockHash ?? new Fr(GENESIS_BLOCK_HASH),
|
|
42
41
|
salt: opts.salt,
|
|
43
42
|
feeJuicePortalInitialBalance: opts.feeJuicePortalInitialBalance
|
|
44
43
|
});
|
|
@@ -89,13 +88,12 @@ const localAnvil = foundry;
|
|
|
89
88
|
bananaFPC,
|
|
90
89
|
sponsoredFPC
|
|
91
90
|
] : [];
|
|
92
|
-
const { genesisArchiveRoot,
|
|
91
|
+
const { genesisArchiveRoot, prefilledPublicData, fundingNeeded } = await getGenesisValues(fundedAddresses);
|
|
93
92
|
let watcher = undefined;
|
|
94
93
|
if (!aztecNodeConfig.p2pEnabled) {
|
|
95
94
|
const l1ContractAddresses = await deployContractsToL1(aztecNodeConfig, hdAccount, undefined, {
|
|
96
95
|
assumeProvenThroughBlockNumber: Number.MAX_SAFE_INTEGER,
|
|
97
96
|
genesisArchiveRoot,
|
|
98
|
-
genesisBlockHash,
|
|
99
97
|
salt: config.l1Salt ? parseInt(config.l1Salt) : undefined,
|
|
100
98
|
feeJuicePortalInitialBalance: fundingNeeded
|
|
101
99
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/aztec",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.86.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/index.js"
|
|
@@ -19,8 +19,6 @@
|
|
|
19
19
|
"start:debug": "node --inspect=0.0.0.0:9221 --no-warnings ./dest/bin",
|
|
20
20
|
"start:sandbox": "ETHEREUM_HOSTS=http://0.0.0.0:8545/ && yarn start start --sandbox",
|
|
21
21
|
"clean": "rm -rf ./dest .tsbuildinfo",
|
|
22
|
-
"formatting": "run -T prettier --check ./src && run -T eslint ./src",
|
|
23
|
-
"formatting:fix": "run -T eslint --fix ./src && run -T prettier -w ./src",
|
|
24
22
|
"build:dev": "tsc -b --watch",
|
|
25
23
|
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}",
|
|
26
24
|
"run:example:token": "LOG_LEVEL='verbose' node ./dest/examples/token.js"
|
|
@@ -29,35 +27,35 @@
|
|
|
29
27
|
"../package.common.json"
|
|
30
28
|
],
|
|
31
29
|
"dependencies": {
|
|
32
|
-
"@aztec/accounts": "0.
|
|
33
|
-
"@aztec/archiver": "0.
|
|
34
|
-
"@aztec/aztec-faucet": "0.
|
|
35
|
-
"@aztec/aztec-node": "0.
|
|
36
|
-
"@aztec/aztec.js": "0.
|
|
37
|
-
"@aztec/bb-prover": "0.
|
|
38
|
-
"@aztec/bb.js": "0.
|
|
39
|
-
"@aztec/blob-sink": "0.
|
|
40
|
-
"@aztec/bot": "0.
|
|
41
|
-
"@aztec/builder": "0.
|
|
42
|
-
"@aztec/cli": "0.
|
|
43
|
-
"@aztec/cli-wallet": "0.
|
|
44
|
-
"@aztec/constants": "0.
|
|
45
|
-
"@aztec/entrypoints": "0.
|
|
46
|
-
"@aztec/ethereum": "0.
|
|
47
|
-
"@aztec/foundation": "0.
|
|
48
|
-
"@aztec/kv-store": "0.
|
|
49
|
-
"@aztec/noir-contracts.js": "0.
|
|
50
|
-
"@aztec/noir-protocol-circuits-types": "0.
|
|
51
|
-
"@aztec/p2p": "0.
|
|
52
|
-
"@aztec/p2p-bootstrap": "0.
|
|
53
|
-
"@aztec/protocol-contracts": "0.
|
|
54
|
-
"@aztec/prover-client": "0.
|
|
55
|
-
"@aztec/prover-node": "0.
|
|
56
|
-
"@aztec/pxe": "0.
|
|
57
|
-
"@aztec/stdlib": "0.
|
|
58
|
-
"@aztec/telemetry-client": "0.
|
|
59
|
-
"@aztec/txe": "0.
|
|
60
|
-
"@aztec/world-state": "0.
|
|
30
|
+
"@aztec/accounts": "0.86.0",
|
|
31
|
+
"@aztec/archiver": "0.86.0",
|
|
32
|
+
"@aztec/aztec-faucet": "0.86.0",
|
|
33
|
+
"@aztec/aztec-node": "0.86.0",
|
|
34
|
+
"@aztec/aztec.js": "0.86.0",
|
|
35
|
+
"@aztec/bb-prover": "0.86.0",
|
|
36
|
+
"@aztec/bb.js": "0.86.0",
|
|
37
|
+
"@aztec/blob-sink": "0.86.0",
|
|
38
|
+
"@aztec/bot": "0.86.0",
|
|
39
|
+
"@aztec/builder": "0.86.0",
|
|
40
|
+
"@aztec/cli": "0.86.0",
|
|
41
|
+
"@aztec/cli-wallet": "0.86.0",
|
|
42
|
+
"@aztec/constants": "0.86.0",
|
|
43
|
+
"@aztec/entrypoints": "0.86.0",
|
|
44
|
+
"@aztec/ethereum": "0.86.0",
|
|
45
|
+
"@aztec/foundation": "0.86.0",
|
|
46
|
+
"@aztec/kv-store": "0.86.0",
|
|
47
|
+
"@aztec/noir-contracts.js": "0.86.0",
|
|
48
|
+
"@aztec/noir-protocol-circuits-types": "0.86.0",
|
|
49
|
+
"@aztec/p2p": "0.86.0",
|
|
50
|
+
"@aztec/p2p-bootstrap": "0.86.0",
|
|
51
|
+
"@aztec/protocol-contracts": "0.86.0",
|
|
52
|
+
"@aztec/prover-client": "0.86.0",
|
|
53
|
+
"@aztec/prover-node": "0.86.0",
|
|
54
|
+
"@aztec/pxe": "0.86.0",
|
|
55
|
+
"@aztec/stdlib": "0.86.0",
|
|
56
|
+
"@aztec/telemetry-client": "0.86.0",
|
|
57
|
+
"@aztec/txe": "0.86.0",
|
|
58
|
+
"@aztec/world-state": "0.86.0",
|
|
61
59
|
"@types/chalk": "^2.2.0",
|
|
62
60
|
"abitype": "^0.8.11",
|
|
63
61
|
"chalk": "^5.3.0",
|
|
@@ -54,7 +54,7 @@ export const alphaTestnetL2ChainConfig: L2ChainConfig = {
|
|
|
54
54
|
p2pEnabled: true,
|
|
55
55
|
p2pBootstrapNodes: [],
|
|
56
56
|
registryAddress: '0x4d2cc1d5fb6be65240e0bfc8154243e69c0fb19e',
|
|
57
|
-
slashFactoryAddress: '
|
|
57
|
+
slashFactoryAddress: '0x3c9ccf55a8ac3c2eeedf2ee2aa1722188fd676be',
|
|
58
58
|
feeAssetHandlerAddress: '0x80d848dc9f52df56789e2d62ce66f19555ff1019',
|
|
59
59
|
seqMinTxsPerBlock: 0,
|
|
60
60
|
seqMaxTxsPerBlock: 4,
|
|
@@ -6,14 +6,9 @@ import {
|
|
|
6
6
|
getArchiverConfigFromEnv,
|
|
7
7
|
} from '@aztec/archiver';
|
|
8
8
|
import { createLogger } from '@aztec/aztec.js';
|
|
9
|
-
import {
|
|
10
|
-
type BlobSinkConfig,
|
|
11
|
-
blobSinkConfigMapping,
|
|
12
|
-
createBlobSinkClient,
|
|
13
|
-
getBlobSinkConfigFromEnv,
|
|
14
|
-
} from '@aztec/blob-sink/client';
|
|
9
|
+
import { type BlobSinkConfig, blobSinkConfigMapping, createBlobSinkClient } from '@aztec/blob-sink/client';
|
|
15
10
|
import type { NamespacedApiHandlers } from '@aztec/foundation/json-rpc/server';
|
|
16
|
-
import { type DataStoreConfig, dataConfigMappings
|
|
11
|
+
import { type DataStoreConfig, dataConfigMappings } from '@aztec/kv-store/config';
|
|
17
12
|
import { createStore } from '@aztec/kv-store/lmdb-v2';
|
|
18
13
|
import { ArchiverApiSchema } from '@aztec/stdlib/interfaces/server';
|
|
19
14
|
import { getConfigEnvVars as getTelemetryClientConfig, initTelemetryClient } from '@aztec/telemetry-client';
|
|
@@ -29,7 +24,7 @@ export async function startArchiver(
|
|
|
29
24
|
signalHandlers: (() => Promise<void>)[],
|
|
30
25
|
services: NamespacedApiHandlers,
|
|
31
26
|
): Promise<{ config: ArchiverConfig & DataStoreConfig }> {
|
|
32
|
-
const envConfig =
|
|
27
|
+
const envConfig = getArchiverConfigFromEnv();
|
|
33
28
|
const cliOptions = extractRelevantOptions<ArchiverConfig & DataStoreConfig & BlobSinkConfig>(
|
|
34
29
|
options,
|
|
35
30
|
{ ...archiverConfigMappings, ...dataConfigMappings, ...blobSinkConfigMapping },
|
|
@@ -57,7 +52,7 @@ export async function startArchiver(
|
|
|
57
52
|
const archiverStore = new KVArchiverDataStore(store, archiverConfig.maxLogs);
|
|
58
53
|
|
|
59
54
|
const telemetry = initTelemetryClient(getTelemetryClientConfig());
|
|
60
|
-
const blobSinkClient = createBlobSinkClient(archiverConfig);
|
|
55
|
+
const blobSinkClient = createBlobSinkClient(archiverConfig, { logger: createLogger('archiver:blob-sink:client') });
|
|
61
56
|
const archiver = await Archiver.createAndSync(archiverConfig, archiverStore, { telemetry, blobSinkClient }, true);
|
|
62
57
|
services.archiver = [archiver, ArchiverApiSchema];
|
|
63
58
|
signalHandlers.push(archiver.stop);
|
|
@@ -55,11 +55,8 @@ export async function startNode(
|
|
|
55
55
|
|
|
56
56
|
userLog(`Initial funded accounts: ${initialFundedAccounts.map(a => a.toString()).join(', ')}`);
|
|
57
57
|
|
|
58
|
-
const {
|
|
59
|
-
initialFundedAccounts,
|
|
60
|
-
);
|
|
58
|
+
const { genesisArchiveRoot, prefilledPublicData, fundingNeeded } = await getGenesisValues(initialFundedAccounts);
|
|
61
59
|
|
|
62
|
-
userLog(`Genesis block hash: ${genesisBlockHash.toString()}`);
|
|
63
60
|
userLog(`Genesis archive root: ${genesisArchiveRoot.toString()}`);
|
|
64
61
|
|
|
65
62
|
// Deploy contracts if needed
|
|
@@ -76,7 +73,6 @@ export async function startNode(
|
|
|
76
73
|
await deployContractsToL1(nodeConfig, account!, undefined, {
|
|
77
74
|
assumeProvenThroughBlockNumber: nodeSpecificOptions.assumeProvenThroughBlockNumber,
|
|
78
75
|
salt: nodeSpecificOptions.deployAztecContractsSalt,
|
|
79
|
-
genesisBlockHash,
|
|
80
76
|
genesisArchiveRoot,
|
|
81
77
|
feeJuicePortalInitialBalance: fundingNeeded,
|
|
82
78
|
});
|
|
@@ -72,9 +72,8 @@ export async function startProverNode(
|
|
|
72
72
|
const initialFundedAccounts = testAccounts.concat(sponsoredFPCAccounts);
|
|
73
73
|
|
|
74
74
|
userLog(`Initial funded accounts: ${initialFundedAccounts.map(a => a.toString()).join(', ')}`);
|
|
75
|
-
const { genesisArchiveRoot,
|
|
75
|
+
const { genesisArchiveRoot, prefilledPublicData } = await getGenesisValues(initialFundedAccounts);
|
|
76
76
|
|
|
77
|
-
userLog(`Genesis block hash: ${genesisBlockHash.toString()}`);
|
|
78
77
|
userLog(`Genesis archive root: ${genesisArchiveRoot.toString()}`);
|
|
79
78
|
|
|
80
79
|
if (!Fr.fromHexString(config.genesisArchiveTreeRoot).equals(genesisArchiveRoot)) {
|
|
@@ -109,9 +108,8 @@ export async function startProverNode(
|
|
|
109
108
|
const proverNode = await createProverNode(proverConfig, { telemetry, broker }, { prefilledPublicData });
|
|
110
109
|
services.proverNode = [proverNode, ProverNodeApiSchema];
|
|
111
110
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
services.p2p = [proverNode.getP2P(), P2PApiSchema];
|
|
111
|
+
if (proverNode.getP2P()) {
|
|
112
|
+
services.p2p = [proverNode.getP2P()!, P2PApiSchema];
|
|
115
113
|
}
|
|
116
114
|
|
|
117
115
|
if (!proverConfig.proverBrokerUrl) {
|
|
@@ -120,6 +118,6 @@ export async function startProverNode(
|
|
|
120
118
|
|
|
121
119
|
signalHandlers.push(proverNode.stop.bind(proverNode));
|
|
122
120
|
|
|
123
|
-
proverNode.start();
|
|
121
|
+
await proverNode.start();
|
|
124
122
|
return { config: proverConfig };
|
|
125
123
|
}
|
package/src/examples/util.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EthAddress } from '@aztec/aztec.js';
|
|
2
|
-
import type {
|
|
2
|
+
import type { ExtendedViemWalletClient } from '@aztec/ethereum';
|
|
3
3
|
import { jsonStringify } from '@aztec/foundation/json-rpc';
|
|
4
4
|
|
|
5
5
|
import type { Abi, Narrow } from 'abitype';
|
|
@@ -7,27 +7,25 @@ import type { Hex } from 'viem';
|
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Helper function to deploy ETH contracts.
|
|
10
|
-
* @param
|
|
11
|
-
* @param publicClient - A viem PublicClient.
|
|
10
|
+
* @param l1Client - A viem WalletClient extended with public actions.
|
|
12
11
|
* @param abi - The ETH contract's ABI (as abitype's Abi).
|
|
13
12
|
* @param bytecode - The ETH contract's bytecode.
|
|
14
13
|
* @param args - Constructor arguments for the contract.
|
|
15
14
|
* @returns The ETH address the contract was deployed to.
|
|
16
15
|
*/
|
|
17
16
|
export async function deployL1Contract(
|
|
18
|
-
|
|
19
|
-
publicClient: ViemPublicClient,
|
|
17
|
+
l1Client: ExtendedViemWalletClient,
|
|
20
18
|
abi: Narrow<Abi | readonly unknown[]>,
|
|
21
19
|
bytecode: Hex,
|
|
22
20
|
args: readonly unknown[] = [],
|
|
23
21
|
): Promise<EthAddress> {
|
|
24
|
-
const hash = await
|
|
22
|
+
const hash = await l1Client.deployContract({
|
|
25
23
|
abi,
|
|
26
24
|
bytecode,
|
|
27
25
|
args,
|
|
28
26
|
});
|
|
29
27
|
|
|
30
|
-
const receipt = await
|
|
28
|
+
const receipt = await l1Client.waitForTransactionReceipt({ hash });
|
|
31
29
|
const contractAddress = receipt.contractAddress;
|
|
32
30
|
if (!contractAddress) {
|
|
33
31
|
throw new Error(`No contract address found in receipt: ${jsonStringify(receipt)}`);
|
package/src/sandbox/sandbox.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { type AztecNodeConfig, AztecNodeService, getConfigEnvVars } from '@aztec
|
|
|
5
5
|
import { AnvilTestWatcher, EthCheatCodes } from '@aztec/aztec.js/testing';
|
|
6
6
|
import { type BlobSinkClientInterface, createBlobSinkClient } from '@aztec/blob-sink/client';
|
|
7
7
|
import { setupSponsoredFPC } from '@aztec/cli/cli-utils';
|
|
8
|
-
import { GENESIS_ARCHIVE_ROOT
|
|
8
|
+
import { GENESIS_ARCHIVE_ROOT } from '@aztec/constants';
|
|
9
9
|
import {
|
|
10
10
|
NULL_KEY,
|
|
11
11
|
createEthereumChain,
|
|
@@ -53,7 +53,6 @@ export async function deployContractsToL1(
|
|
|
53
53
|
assumeProvenThroughBlockNumber?: number;
|
|
54
54
|
salt?: number;
|
|
55
55
|
genesisArchiveRoot?: Fr;
|
|
56
|
-
genesisBlockHash?: Fr;
|
|
57
56
|
feeJuicePortalInitialBalance?: bigint;
|
|
58
57
|
} = {},
|
|
59
58
|
) {
|
|
@@ -75,7 +74,6 @@ export async function deployContractsToL1(
|
|
|
75
74
|
vkTreeRoot: getVKTreeRoot(),
|
|
76
75
|
protocolContractTreeRoot,
|
|
77
76
|
genesisArchiveRoot: opts.genesisArchiveRoot ?? new Fr(GENESIS_ARCHIVE_ROOT),
|
|
78
|
-
genesisBlockHash: opts.genesisBlockHash ?? new Fr(GENESIS_BLOCK_HASH),
|
|
79
77
|
salt: opts.salt,
|
|
80
78
|
feeJuicePortalInitialBalance: opts.feeJuicePortalInitialBalance,
|
|
81
79
|
},
|
|
@@ -140,16 +138,13 @@ export async function createSandbox(config: Partial<SandboxConfig> = {}, userLog
|
|
|
140
138
|
const fundedAddresses = initialAccounts.length
|
|
141
139
|
? [...initialAccounts.map(a => a.address), bananaFPC, sponsoredFPC]
|
|
142
140
|
: [];
|
|
143
|
-
const { genesisArchiveRoot,
|
|
144
|
-
fundedAddresses,
|
|
145
|
-
);
|
|
141
|
+
const { genesisArchiveRoot, prefilledPublicData, fundingNeeded } = await getGenesisValues(fundedAddresses);
|
|
146
142
|
|
|
147
143
|
let watcher: AnvilTestWatcher | undefined = undefined;
|
|
148
144
|
if (!aztecNodeConfig.p2pEnabled) {
|
|
149
145
|
const l1ContractAddresses = await deployContractsToL1(aztecNodeConfig, hdAccount, undefined, {
|
|
150
146
|
assumeProvenThroughBlockNumber: Number.MAX_SAFE_INTEGER,
|
|
151
147
|
genesisArchiveRoot,
|
|
152
|
-
genesisBlockHash,
|
|
153
148
|
salt: config.l1Salt ? parseInt(config.l1Salt) : undefined,
|
|
154
149
|
feeJuicePortalInitialBalance: fundingNeeded,
|
|
155
150
|
});
|