@aztec/end-to-end 1.0.0-nightly.20250617 → 1.0.0-nightly.20250618
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/e2e_epochs/epochs_test.d.ts +6 -1
- package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.js +20 -3
- package/dest/fixtures/e2e_prover_test.d.ts.map +1 -1
- package/dest/fixtures/e2e_prover_test.js +2 -1
- package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
- package/dest/fixtures/setup_p2p_test.js +4 -3
- package/dest/fixtures/snapshot_manager.d.ts.map +1 -1
- package/dest/fixtures/snapshot_manager.js +10 -4
- package/dest/fixtures/utils.d.ts +2 -3
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +9 -11
- package/package.json +36 -35
- package/src/e2e_epochs/epochs_test.ts +20 -4
- package/src/fixtures/e2e_prover_test.ts +2 -1
- package/src/fixtures/setup_p2p_test.ts +3 -2
- package/src/fixtures/snapshot_manager.ts +8 -2
- package/src/fixtures/utils.ts +10 -16
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type AztecNodeConfig, AztecNodeService } from '@aztec/aztec-node';
|
|
2
2
|
import { Fr, type Logger, type Wallet } from '@aztec/aztec.js';
|
|
3
|
-
import type
|
|
3
|
+
import { type ExtendedViemWalletClient } from '@aztec/ethereum';
|
|
4
4
|
import { RollupContract } from '@aztec/ethereum/contracts';
|
|
5
5
|
import { ChainMonitor, type Delayer } from '@aztec/ethereum/test';
|
|
6
6
|
import { SpamContract } from '@aztec/noir-test-contracts.js/Spam';
|
|
@@ -61,6 +61,11 @@ export declare class EpochsTestContext {
|
|
|
61
61
|
waitForNodeToSync(blockNumber: number, type: 'proven' | 'finalised' | 'historic'): Promise<void>;
|
|
62
62
|
/** Registers the SpamContract on the given wallet. */
|
|
63
63
|
registerSpamContract(wallet: Wallet, salt?: Fr): Promise<SpamContract>;
|
|
64
|
+
/** Creates an L1 client using a fresh account with funds from anvil, with a tx delayer already set up. */
|
|
65
|
+
createL1Client(): Promise<{
|
|
66
|
+
client: ExtendedViemWalletClient;
|
|
67
|
+
delayer: Delayer;
|
|
68
|
+
}>;
|
|
64
69
|
/** Verifies whether the given block number is found on the aztec node. */
|
|
65
70
|
verifyHistoricBlock(blockNumber: L2BlockNumber, expectedSuccess: boolean): Promise<void>;
|
|
66
71
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"epochs_test.d.ts","sourceRoot":"","sources":["../../src/e2e_epochs/epochs_test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EACL,EAAE,EACF,KAAK,MAAM,EAEX,KAAK,MAAM,EAKZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"epochs_test.d.ts","sourceRoot":"","sources":["../../src/e2e_epochs/epochs_test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,eAAe,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EACL,EAAE,EACF,KAAK,MAAM,EAEX,KAAK,MAAM,EAKZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,KAAK,wBAAwB,EAA0B,MAAM,iBAAiB,CAAC;AACxF,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAkB,KAAK,OAAO,EAAqC,MAAM,sBAAsB,CAAC;AAIrH,OAAO,EAAE,YAAY,EAAE,MAAM,oCAAoC,CAAC;AAElE,OAAO,EAAE,UAAU,EAAuB,MAAM,oBAAoB,CAAC;AAIrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,KAAK,iBAAiB,EAAuC,MAAM,6BAA6B,CAAC;A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C5B,IAAI,GAAE,OAAO,CAAC,eAAe,CAAC,GAAG;QAAE,kBAAkB,CAAC,EAAE,OAAO,CAAA;KAAO;YAM1D,UAAU;IA+BxB,OAAO,CAAC,iBAAiB;IAKzB,0FAA0F;IAC7E,oBAAoB,CAAC,KAAK,EAAE,MAAM;IAO/C,sDAAsD;IACzC,sBAAsB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,SAAK;IAShE,iEAAiE;IACpD,4BAA4B,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,SAAK;IAUjE,4EAA4E;IAC/D,mCAAmC,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM;IAO7E,mEAAmE;IACtD,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,WAAW,GAAG,UAAU;IAoB7F,sDAAsD;IACzC,oBAAoB,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,KAAU;IAYhE,0GAA0G;IAC7F,cAAc;;;;IAa3B,0EAA0E;IAC7D,mBAAmB,CAAC,WAAW,EAAE,aAAa,EAAE,eAAe,EAAE,OAAO;CAUtF"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { AztecNodeService } from '@aztec/aztec-node';
|
|
2
2
|
import { Fr, MerkleTreeId, getContractInstanceFromDeployParams, getTimestampRangeForEpoch, retryUntil, sleep } from '@aztec/aztec.js';
|
|
3
|
+
import { createExtendedL1Client } from '@aztec/ethereum';
|
|
3
4
|
import { RollupContract } from '@aztec/ethereum/contracts';
|
|
4
|
-
import { ChainMonitor, waitUntilL1Timestamp } from '@aztec/ethereum/test';
|
|
5
|
+
import { ChainMonitor, waitUntilL1Timestamp, withDelayer } from '@aztec/ethereum/test';
|
|
6
|
+
import { SecretValue } from '@aztec/foundation/config';
|
|
5
7
|
import { randomBytes } from '@aztec/foundation/crypto';
|
|
6
8
|
import { withLogNameSuffix } from '@aztec/foundation/log';
|
|
7
9
|
import { SpamContract } from '@aztec/noir-test-contracts.js/Spam';
|
|
@@ -9,6 +11,7 @@ import { getMockPubSubP2PServiceFactory } from '@aztec/p2p/test-helpers';
|
|
|
9
11
|
import { getProofSubmissionDeadlineTimestamp } from '@aztec/stdlib/epoch-helpers';
|
|
10
12
|
import { tryStop } from '@aztec/stdlib/interfaces/server';
|
|
11
13
|
import { join } from 'path';
|
|
14
|
+
import { privateKeyToAccount } from 'viem/accounts';
|
|
12
15
|
import { createAndSyncProverNode, getPrivateKeyFromIndex, setup } from '../fixtures/utils.js';
|
|
13
16
|
export const WORLD_STATE_BLOCK_HISTORY = 2;
|
|
14
17
|
export const WORLD_STATE_BLOCK_CHECK_INTERVAL = 50;
|
|
@@ -142,7 +145,7 @@ export const ARCHIVER_POLL_INTERVAL = 50;
|
|
|
142
145
|
return this.createNode({
|
|
143
146
|
...opts,
|
|
144
147
|
disableValidator: false,
|
|
145
|
-
validatorPrivateKeys: privateKeys
|
|
148
|
+
validatorPrivateKeys: new SecretValue(privateKeys)
|
|
146
149
|
});
|
|
147
150
|
}
|
|
148
151
|
async createNode(opts = {}) {
|
|
@@ -157,7 +160,7 @@ export const ARCHIVER_POLL_INTERVAL = 50;
|
|
|
157
160
|
const node = await withLogNameSuffix(suffix, ()=>AztecNodeService.createAndSync({
|
|
158
161
|
...resolvedConfig,
|
|
159
162
|
dataDirectory: join(this.context.config.dataDirectory, randomBytes(8).toString('hex')),
|
|
160
|
-
validatorPrivateKeys: opts.validatorPrivateKeys,
|
|
163
|
+
validatorPrivateKeys: opts.validatorPrivateKeys ?? new SecretValue([]),
|
|
161
164
|
p2pEnabled,
|
|
162
165
|
p2pIp
|
|
163
166
|
}, {
|
|
@@ -235,6 +238,20 @@ export const ARCHIVER_POLL_INTERVAL = 50;
|
|
|
235
238
|
});
|
|
236
239
|
return SpamContract.at(instance.address, wallet);
|
|
237
240
|
}
|
|
241
|
+
/** Creates an L1 client using a fresh account with funds from anvil, with a tx delayer already set up. */ async createL1Client() {
|
|
242
|
+
const { client, delayer } = withDelayer(createExtendedL1Client([
|
|
243
|
+
...this.l1Client.chain.rpcUrls.default.http
|
|
244
|
+
], privateKeyToAccount(this.getNextPrivateKey()), this.l1Client.chain), {
|
|
245
|
+
ethereumSlotDuration: this.L1_BLOCK_TIME_IN_S
|
|
246
|
+
});
|
|
247
|
+
expect(await client.getBalance({
|
|
248
|
+
address: client.account.address
|
|
249
|
+
})).toBeGreaterThan(0n);
|
|
250
|
+
return {
|
|
251
|
+
client,
|
|
252
|
+
delayer
|
|
253
|
+
};
|
|
254
|
+
}
|
|
238
255
|
/** Verifies whether the given block number is found on the aztec node. */ async verifyHistoricBlock(blockNumber, expectedSuccess) {
|
|
239
256
|
// We use `findLeavesIndexes` here, but could use any function that queries the world-state
|
|
240
257
|
// at a particular block, so we know whether that historic block is available or has been
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"e2e_prover_test.d.ts","sourceRoot":"","sources":["../../src/fixtures/e2e_prover_test.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAElE,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,SAAS,EACd,KAAK,eAAe,EACpB,UAAU,EACV,KAAK,MAAM,EAGZ,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACrD,OAAO,EAAqB,KAAK,6BAA6B,EAAuB,MAAM,kBAAkB,CAAC;AAE9G,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"e2e_prover_test.d.ts","sourceRoot":"","sources":["../../src/fixtures/e2e_prover_test.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAElE,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,SAAS,EACd,KAAK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C,OAAO,CAAC,iBAAiB,CAAC,CAAsB;IAChD,oBAAoB,CAAC,EAAE,6BAA6B,CAAC;IACrD,YAAY,EAAE,aAAa,EAAE,CAAM;IACnC,OAAO,CAAC,OAAO,CAAqB;IACpC,OAAO,CAAC,UAAU,CAAc;IAChC,OAAO,CAAC,mBAAmB,CAAc;IAClC,WAAW,EAAG,2BAA2B,CAAC;IAC1C,aAAa,EAAG,UAAU,CAAC;gBAGhC,QAAQ,EAAE,MAAM,EACR,sBAAsB,EAAE,MAAM,EACtC,QAAQ,EAAE,UAAU,EACZ,UAAU,UAAO;IAa3B;;;;OAIG;IACG,kBAAkB;IAqDlB,KAAK;YA+JG,WAAW;IAQzB,QAAQ,GAAI,CAAC,EACX,MAAM,MAAM,EACZ,OAAO,CAAC,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,CAAC,CAAC,EACjD,UAAS,CAAC,YAAY,EAAE,CAAC,EAAE,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAA2B,KAChG,OAAO,CAAC,IAAI,CAAC,CAAwD;IAElE,QAAQ;IAeR,iBAAiB;CA8CxB"}
|
|
@@ -4,6 +4,7 @@ import { EthAddress, createLogger } from '@aztec/aztec.js';
|
|
|
4
4
|
import { BBCircuitVerifier, TestCircuitVerifier } from '@aztec/bb-prover';
|
|
5
5
|
import { createBlobSinkClient } from '@aztec/blob-sink/client';
|
|
6
6
|
import { Buffer32 } from '@aztec/foundation/buffer';
|
|
7
|
+
import { SecretValue } from '@aztec/foundation/config';
|
|
7
8
|
import { TestERC20Abi } from '@aztec/l1-artifacts';
|
|
8
9
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
9
10
|
import { createProverNode } from '@aztec/prover-node';
|
|
@@ -192,7 +193,7 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
192
193
|
proverId: this.proverAddress.toField(),
|
|
193
194
|
realProofs: this.realProofs,
|
|
194
195
|
proverAgentCount: 2,
|
|
195
|
-
publisherPrivateKey: `0x${proverNodePrivateKey.toString('hex')}
|
|
196
|
+
publisherPrivateKey: new SecretValue(`0x${proverNodePrivateKey.toString('hex')}`),
|
|
196
197
|
proverNodeMaxPendingJobs: 100,
|
|
197
198
|
proverNodeMaxParallelBlocksPerEpoch: 32,
|
|
198
199
|
proverNodePollingIntervalMs: 100,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup_p2p_test.d.ts","sourceRoot":"","sources":["../../src/fixtures/setup_p2p_test.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,KAAK,eAAe,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;
|
|
1
|
+
{"version":3,"file":"setup_p2p_test.d.ts","sourceRoot":"","sources":["../../src/fixtures/setup_p2p_test.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,OAAO,EAAE,KAAK,eAAe,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,iBAAiB,CAAC;AAG9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAG9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAQrD,eAAO,MAAM,iCAAiC,IAAI,CAAC;AAEnD,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,gBAAgB,CAAC;IACvB,UAAU,EAAE,UAAU,CAAC;IACvB,GAAG,EAAE,MAAM,EAAE,CAAC;CACf;AAED,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,KAAK,MAAM,EAAE,EAAE,CAO7F;AAED,wBAAsB,WAAW,CAC/B,MAAM,EAAE,eAAe,EACvB,YAAY,EAAE,YAAY,EAC1B,gBAAgB,EAAE,MAAM,EACxB,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,MAAM,EACpB,mBAAmB,CAAC,EAAE,kBAAkB,EAAE,EAC1C,aAAa,CAAC,EAAE,MAAM,EACtB,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,gBAAgB,EAAE,CAAC,CAmC7B;AAGD,wBAAsB,UAAU,CAC9B,MAAM,EAAE,eAAe,EACvB,YAAY,EAAE,YAAY,EAC1B,OAAO,EAAE,MAAM,EACf,aAAa,EAAE,MAAM,GAAG,SAAS,EACjC,YAAY,EAAE,MAAM,EACpB,mBAAmB,CAAC,EAAE,kBAAkB,EAAE,EAC1C,aAAa,CAAC,EAAE,MAAM,EACtB,WAAW,CAAC,EAAE,MAAM,EACpB,eAAe,CAAC,EAAE,iBAAiB,CAAC,MAAM,CAAC,6BAQ5C;AAED,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,eAAe,EACvB,gBAAgB,CAAC,EAAE,MAAM,EACzB,IAAI,CAAC,EAAE,MAAM,EACb,YAAY,GAAE,MAAU,EACxB,aAAa,CAAC,EAAE,MAAM,4BAuBvB"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Test fixtures and utilities to set up and run a test using multiple validators
|
|
3
3
|
*/ import { AztecNodeService } from '@aztec/aztec-node';
|
|
4
|
+
import { SecretValue } from '@aztec/foundation/config';
|
|
4
5
|
import { addLogNameHandler, removeLogNameHandler } from '@aztec/foundation/log';
|
|
5
6
|
import getPort from 'get-port';
|
|
6
7
|
import { AsyncLocalStorage } from 'node:async_hooks';
|
|
@@ -56,10 +57,10 @@ export async function createNode(config, dateProvider, tcpPort, bootstrapNode, a
|
|
|
56
57
|
export async function createValidatorConfig(config, bootstrapNodeEnr, port, addressIndex = 1, dataDirectory) {
|
|
57
58
|
port = port ?? await getPort();
|
|
58
59
|
const attesterPrivateKey = `0x${getPrivateKeyFromIndex(ATTESTER_PRIVATE_KEYS_START_INDEX + addressIndex).toString('hex')}`;
|
|
59
|
-
config.validatorPrivateKeys = [
|
|
60
|
+
config.validatorPrivateKeys = new SecretValue([
|
|
60
61
|
attesterPrivateKey
|
|
61
|
-
];
|
|
62
|
-
config.publisherPrivateKey = attesterPrivateKey;
|
|
62
|
+
]);
|
|
63
|
+
config.publisherPrivateKey = new SecretValue(attesterPrivateKey);
|
|
63
64
|
const nodeConfig = {
|
|
64
65
|
...config,
|
|
65
66
|
p2pIp: `127.0.0.1`,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"snapshot_manager.d.ts","sourceRoot":"","sources":["../../src/fixtures/snapshot_manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,kBAAkB,EAAwD,MAAM,yBAAyB,CAAC;AACxH,OAAO,EAAE,KAAK,eAAe,EAAE,gBAAgB,EAAoB,MAAM,mBAAmB,CAAC;AAC7F,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,SAAS,EAEd,KAAK,eAAe,EAGpB,KAAK,MAAM,EACX,KAAK,GAAG,EACR,KAAK,MAAM,EAGZ,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AACvE,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,yBAAyB,CAAC;AACpF,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,
|
|
1
|
+
{"version":3,"file":"snapshot_manager.d.ts","sourceRoot":"","sources":["../../src/fixtures/snapshot_manager.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,kBAAkB,EAAwD,MAAM,yBAAyB,CAAC;AACxH,OAAO,EAAE,KAAK,eAAe,EAAE,gBAAgB,EAAoB,MAAM,mBAAmB,CAAC;AAC7F,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,SAAS,EAEd,KAAK,eAAe,EAGp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AAM,EACR,QAAQ,EAAE,MAAM,EAChB,MAAM,GAAE,OAAO,CAAC,YAAY,CAAM,EAClC,qBAAqB,GAAE,OAAO,CAAC,qBAAqB,CAAM;IAMvD,QAAQ,CAAC,CAAC,EACrB,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,CAAC,CAAC,EACjD,OAAO,GAAE,CAAC,YAAY,EAAE,CAAC,EAAE,OAAO,EAAE,iBAAiB,KAAK,OAAO,CAAC,IAAI,CAA2B;IA4CnG;;;;OAIG;IACU,KAAK;IA0BlB;;OAEG;IACU,QAAQ;CAKtB;AA0VD;;;GAGG;AACH,eAAO,MAAM,cAAc,GACxB,kBAAkB,MAAM,EAAE,QAAQ,MAAM,EAAE,yBAAuB,MAC3D,gCAAgC;IAAE,GAAG,EAAE,GAAG,CAAC;IAAC,qBAAqB,EAAE,kBAAkB,EAAE,CAAA;CAAE;;EAe/F,CAAC;AAEJ;;;;;;;GAOG;AACH,wBAAsB,oBAAoB,CACxC,MAAM,EAAE,MAAM,EACd,gBAAgB,EAAE,CAAC,eAAe,GAAG,YAAY,CAAC,EAAE,EACpD,eAAe,UAAQ,EACvB,SAAS,CAAC,EAAE,GAAG,GAAG,SAAS,iBAyB5B"}
|
|
@@ -5,9 +5,10 @@ import { BatchCall, DefaultWaitForProvenOpts, getContractClassFromArtifact, wait
|
|
|
5
5
|
import { deployInstance, registerContractClass } from '@aztec/aztec.js/deployment';
|
|
6
6
|
import { AnvilTestWatcher, CheatCodes } from '@aztec/aztec.js/testing';
|
|
7
7
|
import { createBlobSinkServer } from '@aztec/blob-sink/server';
|
|
8
|
-
import { createExtendedL1Client, getL1ContractsConfigEnvVars, l1Artifacts } from '@aztec/ethereum';
|
|
8
|
+
import { createExtendedL1Client, deployMulticall3, getL1ContractsConfigEnvVars, l1Artifacts } from '@aztec/ethereum';
|
|
9
9
|
import { EthCheatCodesWithState, startAnvil } from '@aztec/ethereum/test';
|
|
10
10
|
import { asyncMap } from '@aztec/foundation/async-map';
|
|
11
|
+
import { SecretValue } from '@aztec/foundation/config';
|
|
11
12
|
import { randomBytes } from '@aztec/foundation/crypto';
|
|
12
13
|
import { tryRmDir } from '@aztec/foundation/fs';
|
|
13
14
|
import { createLogger } from '@aztec/foundation/log';
|
|
@@ -25,6 +26,7 @@ import { tmpdir } from 'os';
|
|
|
25
26
|
import path, { join } from 'path';
|
|
26
27
|
import { getContract } from 'viem';
|
|
27
28
|
import { mnemonicToAccount } from 'viem/accounts';
|
|
29
|
+
import { foundry } from 'viem/chains';
|
|
28
30
|
import { MNEMONIC, TEST_PEER_CHECK_INTERVAL_MS } from './fixtures.js';
|
|
29
31
|
import { getACVMConfig } from './get_acvm_config.js';
|
|
30
32
|
import { getBBConfig } from './get_bb_config.js';
|
|
@@ -247,10 +249,10 @@ export function createSnapshotManager(testName, dataPath, config = {}, deployL1C
|
|
|
247
249
|
const publisherPrivKey = publisherPrivKeyRaw === null ? null : Buffer.from(publisherPrivKeyRaw);
|
|
248
250
|
const validatorPrivKey = getPrivateKeyFromIndex(0);
|
|
249
251
|
const proverNodePrivateKey = getPrivateKeyFromIndex(0);
|
|
250
|
-
aztecNodeConfig.publisherPrivateKey = `0x${publisherPrivKey.toString('hex')}
|
|
251
|
-
aztecNodeConfig.validatorPrivateKeys = [
|
|
252
|
+
aztecNodeConfig.publisherPrivateKey = new SecretValue(`0x${publisherPrivKey.toString('hex')}`);
|
|
253
|
+
aztecNodeConfig.validatorPrivateKeys = new SecretValue([
|
|
252
254
|
`0x${validatorPrivKey.toString('hex')}`
|
|
253
|
-
];
|
|
255
|
+
]);
|
|
254
256
|
const ethCheatCodes = new EthCheatCodesWithState(aztecNodeConfig.l1RpcUrls);
|
|
255
257
|
if (opts.l1StartTime) {
|
|
256
258
|
await ethCheatCodes.warp(opts.l1StartTime);
|
|
@@ -258,6 +260,10 @@ export function createSnapshotManager(testName, dataPath, config = {}, deployL1C
|
|
|
258
260
|
const initialFundedAccounts = await generateSchnorrAccounts(numberOfInitialFundedAccounts);
|
|
259
261
|
const sponsoredFPCAddress = await getSponsoredFPCAddress();
|
|
260
262
|
const { genesisArchiveRoot, prefilledPublicData, fundingNeeded } = await getGenesisValues(initialFundedAccounts.map((a)=>a.address).concat(sponsoredFPCAddress), opts.initialAccountFeeJuice);
|
|
263
|
+
const l1Client = createExtendedL1Client([
|
|
264
|
+
aztecNodeConfig.l1RpcUrls[0]
|
|
265
|
+
], hdAccount, foundry);
|
|
266
|
+
await deployMulticall3(l1Client, logger);
|
|
261
267
|
const deployL1ContractsValues = await setupL1Contracts(aztecNodeConfig.l1RpcUrls[0], hdAccount, logger, {
|
|
262
268
|
...getL1ContractsConfigEnvVars(),
|
|
263
269
|
genesisArchiveRoot,
|
package/dest/fixtures/utils.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { type AztecNodeConfig } from '@aztec/aztec-node';
|
|
|
3
3
|
import { type AccountWalletWithSecretKey, type AztecAddress, type AztecNode, type ContractMethod, type Logger, type PXE, type Wallet } from '@aztec/aztec.js';
|
|
4
4
|
import { AnvilTestWatcher, CheatCodes } from '@aztec/aztec.js/testing';
|
|
5
5
|
import { type BlobSinkServer } from '@aztec/blob-sink/server';
|
|
6
|
-
import { type DeployL1ContractsArgs, type DeployL1ContractsReturnType,
|
|
6
|
+
import { type DeployL1ContractsArgs, type DeployL1ContractsReturnType, type Operator } from '@aztec/ethereum';
|
|
7
7
|
import { startAnvil } from '@aztec/ethereum/test';
|
|
8
8
|
import { Fr } from '@aztec/foundation/fields';
|
|
9
9
|
import { TestDateProvider } from '@aztec/foundation/timer';
|
|
@@ -15,7 +15,7 @@ import type { SequencerClient } from '@aztec/sequencer-client';
|
|
|
15
15
|
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
16
16
|
import type { PublicDataTreeLeaf } from '@aztec/stdlib/trees';
|
|
17
17
|
import { type TelemetryClient, type TelemetryClientConfig } from '@aztec/telemetry-client';
|
|
18
|
-
import { type Chain, type HDAccount, type
|
|
18
|
+
import { type Chain, type HDAccount, type PrivateKeyAccount } from 'viem';
|
|
19
19
|
export { deployAndInitializeTokenAndBridgeContracts } from '../shared/cross_chain_test_harness.js';
|
|
20
20
|
export { startAnvil };
|
|
21
21
|
export declare const getPrivateKeyFromIndex: (index: number) => Buffer | null;
|
|
@@ -171,5 +171,4 @@ export declare function getSponsoredFPCAddress(): Promise<AztecAddress>;
|
|
|
171
171
|
export declare function setupSponsoredFPC(pxe: PXE): Promise<import("@aztec/aztec.js").ContractInstanceWithAddress>;
|
|
172
172
|
export declare function waitForProvenChain(node: AztecNode, targetBlock?: number, timeoutSec?: number, intervalSec?: number): Promise<void>;
|
|
173
173
|
export declare function createAndSyncProverNode(proverNodePrivateKey: `0x${string}`, aztecNodeConfig: AztecNodeConfig, proverNodeConfig: Partial<ProverNodeConfig> & Pick<DataStoreConfig, 'dataDirectory'>, aztecNode: AztecNode, prefilledPublicData?: PublicDataTreeLeaf[]): Promise<ProverNode>;
|
|
174
|
-
export declare function createForwarderContract(aztecNodeConfig: AztecNodeConfig, privateKey: `0x${string}`, rollupAddress: Hex): Promise<ForwarderContract>;
|
|
175
174
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/fixtures/utils.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,kBAAkB,EAKxB,MAAM,yBAAyB,CAAC;AAEjC,OAAO,EAAE,KAAK,eAAe,EAAsC,MAAM,mBAAmB,CAAC;AAC7F,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,YAAY,EACjB,KAAK,SAAS,EAEd,KAAK,cAAc,EACnB,KAAK,MAAM,EACX,KAAK,GAAG,EACR,KAAK,MAAM,EAMZ,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAEvE,OAAO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EACpF,SAAS,EAAE,SAAS,EACpB,mBAAmB,GAAE,kBAAkB,EAAO,uBA6C/C"}
|
package/dest/fixtures/utils.js
CHANGED
|
@@ -8,8 +8,9 @@ import { AnvilTestWatcher, CheatCodes } from '@aztec/aztec.js/testing';
|
|
|
8
8
|
import { createBlobSinkClient } from '@aztec/blob-sink/client';
|
|
9
9
|
import { createBlobSinkServer } from '@aztec/blob-sink/server';
|
|
10
10
|
import { GENESIS_ARCHIVE_ROOT, SPONSORED_FPC_SALT } from '@aztec/constants';
|
|
11
|
-
import {
|
|
11
|
+
import { NULL_KEY, createExtendedL1Client, deployL1Contracts, deployMulticall3, getL1ContractsConfigEnvVars, isAnvilTestChain, l1Artifacts } from '@aztec/ethereum';
|
|
12
12
|
import { DelayedTxUtils, EthCheatCodesWithState, startAnvil } from '@aztec/ethereum/test';
|
|
13
|
+
import { SecretValue } from '@aztec/foundation/config';
|
|
13
14
|
import { randomBytes } from '@aztec/foundation/crypto';
|
|
14
15
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
15
16
|
import { Fr } from '@aztec/foundation/fields';
|
|
@@ -189,7 +190,7 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
189
190
|
...opts
|
|
190
191
|
};
|
|
191
192
|
// use initialValidators for the node config
|
|
192
|
-
config.validatorPrivateKeys = opts.initialValidators?.map((v)=>v.privateKey);
|
|
193
|
+
config.validatorPrivateKeys = new SecretValue(opts.initialValidators?.map((v)=>v.privateKey) ?? []);
|
|
193
194
|
config.peerCheckIntervalMS = TEST_PEER_CHECK_INTERVAL_MS;
|
|
194
195
|
// For tests we only want proving enabled if specifically requested
|
|
195
196
|
config.realProofs = !!opts.realProofs;
|
|
@@ -234,8 +235,8 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
234
235
|
}
|
|
235
236
|
let publisherPrivKey = undefined;
|
|
236
237
|
let publisherHdAccount = undefined;
|
|
237
|
-
if (config.publisherPrivateKey && config.publisherPrivateKey != NULL_KEY) {
|
|
238
|
-
publisherHdAccount = privateKeyToAccount(config.publisherPrivateKey);
|
|
238
|
+
if (config.publisherPrivateKey && config.publisherPrivateKey.getValue() != NULL_KEY) {
|
|
239
|
+
publisherHdAccount = privateKeyToAccount(config.publisherPrivateKey.getValue());
|
|
239
240
|
} else if (!MNEMONIC) {
|
|
240
241
|
throw new Error(`Mnemonic not provided and no publisher private key`);
|
|
241
242
|
} else {
|
|
@@ -244,7 +245,7 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
244
245
|
});
|
|
245
246
|
const publisherPrivKeyRaw = publisherHdAccount.getHdKey().privateKey;
|
|
246
247
|
publisherPrivKey = publisherPrivKeyRaw === null ? null : Buffer.from(publisherPrivKeyRaw);
|
|
247
|
-
config.publisherPrivateKey = `0x${publisherPrivKey.toString('hex')}
|
|
248
|
+
config.publisherPrivateKey = new SecretValue(`0x${publisherPrivKey.toString('hex')}`);
|
|
248
249
|
}
|
|
249
250
|
if (PXE_URL) {
|
|
250
251
|
// we are setting up against a remote environment, l1 contracts are assumed to already be deployed
|
|
@@ -257,6 +258,8 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
257
258
|
if (enableAutomine) {
|
|
258
259
|
await ethCheatCodes.setAutomine(true);
|
|
259
260
|
}
|
|
261
|
+
const l1Client = createExtendedL1Client(config.l1RpcUrls, publisherHdAccount, chain);
|
|
262
|
+
await deployMulticall3(l1Client, logger);
|
|
260
263
|
const deployL1ContractsValues = opts.deployL1ContractsValues ?? await setupL1Contracts(config.l1RpcUrls, publisherHdAccount, logger, {
|
|
261
264
|
...opts,
|
|
262
265
|
genesisArchiveRoot,
|
|
@@ -555,7 +558,7 @@ export function createAndSyncProverNode(proverNodePrivateKey, aztecNodeConfig, p
|
|
|
555
558
|
proverCoordinationNodeUrls: [],
|
|
556
559
|
realProofs: false,
|
|
557
560
|
proverAgentCount: 2,
|
|
558
|
-
publisherPrivateKey: proverNodePrivateKey,
|
|
561
|
+
publisherPrivateKey: new SecretValue(proverNodePrivateKey),
|
|
559
562
|
proverNodeMaxPendingJobs: 10,
|
|
560
563
|
proverNodeMaxParallelBlocksPerEpoch: 32,
|
|
561
564
|
proverNodePollingIntervalMs: 200,
|
|
@@ -587,8 +590,3 @@ function createDelayedL1TxUtils(aztecNodeConfig, privateKey, logName) {
|
|
|
587
590
|
l1TxUtils.enableDelayer(aztecNodeConfig.ethereumSlotDuration);
|
|
588
591
|
return l1TxUtils;
|
|
589
592
|
}
|
|
590
|
-
export async function createForwarderContract(aztecNodeConfig, privateKey, rollupAddress) {
|
|
591
|
-
const l1Client = createExtendedL1Client(aztecNodeConfig.l1RpcUrls, privateKey, foundry);
|
|
592
|
-
const forwarderContract = await ForwarderContract.create(l1Client, createLogger('forwarder'), rollupAddress);
|
|
593
|
-
return forwarderContract;
|
|
594
|
-
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/end-to-end",
|
|
3
|
-
"version": "1.0.0-nightly.
|
|
3
|
+
"version": "1.0.0-nightly.20250618",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": "./dest/index.js",
|
|
6
6
|
"inherits": [
|
|
@@ -25,40 +25,40 @@
|
|
|
25
25
|
"formatting": "run -T prettier --check ./src && run -T eslint ./src"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@aztec/accounts": "1.0.0-nightly.
|
|
29
|
-
"@aztec/archiver": "1.0.0-nightly.
|
|
30
|
-
"@aztec/aztec": "1.0.0-nightly.
|
|
31
|
-
"@aztec/aztec-node": "1.0.0-nightly.
|
|
32
|
-
"@aztec/aztec.js": "1.0.0-nightly.
|
|
33
|
-
"@aztec/bb-prover": "1.0.0-nightly.
|
|
34
|
-
"@aztec/blob-lib": "1.0.0-nightly.
|
|
35
|
-
"@aztec/blob-sink": "1.0.0-nightly.
|
|
36
|
-
"@aztec/bot": "1.0.0-nightly.
|
|
37
|
-
"@aztec/cli": "1.0.0-nightly.
|
|
38
|
-
"@aztec/constants": "1.0.0-nightly.
|
|
39
|
-
"@aztec/entrypoints": "1.0.0-nightly.
|
|
40
|
-
"@aztec/epoch-cache": "1.0.0-nightly.
|
|
41
|
-
"@aztec/ethereum": "1.0.0-nightly.
|
|
42
|
-
"@aztec/foundation": "1.0.0-nightly.
|
|
43
|
-
"@aztec/kv-store": "1.0.0-nightly.
|
|
44
|
-
"@aztec/l1-artifacts": "1.0.0-nightly.
|
|
45
|
-
"@aztec/merkle-tree": "1.0.0-nightly.
|
|
46
|
-
"@aztec/noir-contracts.js": "1.0.0-nightly.
|
|
47
|
-
"@aztec/noir-noirc_abi": "1.0.0-nightly.
|
|
48
|
-
"@aztec/noir-protocol-circuits-types": "1.0.0-nightly.
|
|
49
|
-
"@aztec/noir-test-contracts.js": "1.0.0-nightly.
|
|
50
|
-
"@aztec/p2p": "1.0.0-nightly.
|
|
51
|
-
"@aztec/protocol-contracts": "1.0.0-nightly.
|
|
52
|
-
"@aztec/prover-client": "1.0.0-nightly.
|
|
53
|
-
"@aztec/prover-node": "1.0.0-nightly.
|
|
54
|
-
"@aztec/pxe": "1.0.0-nightly.
|
|
55
|
-
"@aztec/sequencer-client": "1.0.0-nightly.
|
|
56
|
-
"@aztec/simulator": "1.0.0-nightly.
|
|
57
|
-
"@aztec/slasher": "1.0.0-nightly.
|
|
58
|
-
"@aztec/stdlib": "1.0.0-nightly.
|
|
59
|
-
"@aztec/telemetry-client": "1.0.0-nightly.
|
|
60
|
-
"@aztec/validator-client": "1.0.0-nightly.
|
|
61
|
-
"@aztec/world-state": "1.0.0-nightly.
|
|
28
|
+
"@aztec/accounts": "1.0.0-nightly.20250618",
|
|
29
|
+
"@aztec/archiver": "1.0.0-nightly.20250618",
|
|
30
|
+
"@aztec/aztec": "1.0.0-nightly.20250618",
|
|
31
|
+
"@aztec/aztec-node": "1.0.0-nightly.20250618",
|
|
32
|
+
"@aztec/aztec.js": "1.0.0-nightly.20250618",
|
|
33
|
+
"@aztec/bb-prover": "1.0.0-nightly.20250618",
|
|
34
|
+
"@aztec/blob-lib": "1.0.0-nightly.20250618",
|
|
35
|
+
"@aztec/blob-sink": "1.0.0-nightly.20250618",
|
|
36
|
+
"@aztec/bot": "1.0.0-nightly.20250618",
|
|
37
|
+
"@aztec/cli": "1.0.0-nightly.20250618",
|
|
38
|
+
"@aztec/constants": "1.0.0-nightly.20250618",
|
|
39
|
+
"@aztec/entrypoints": "1.0.0-nightly.20250618",
|
|
40
|
+
"@aztec/epoch-cache": "1.0.0-nightly.20250618",
|
|
41
|
+
"@aztec/ethereum": "1.0.0-nightly.20250618",
|
|
42
|
+
"@aztec/foundation": "1.0.0-nightly.20250618",
|
|
43
|
+
"@aztec/kv-store": "1.0.0-nightly.20250618",
|
|
44
|
+
"@aztec/l1-artifacts": "1.0.0-nightly.20250618",
|
|
45
|
+
"@aztec/merkle-tree": "1.0.0-nightly.20250618",
|
|
46
|
+
"@aztec/noir-contracts.js": "1.0.0-nightly.20250618",
|
|
47
|
+
"@aztec/noir-noirc_abi": "1.0.0-nightly.20250618",
|
|
48
|
+
"@aztec/noir-protocol-circuits-types": "1.0.0-nightly.20250618",
|
|
49
|
+
"@aztec/noir-test-contracts.js": "1.0.0-nightly.20250618",
|
|
50
|
+
"@aztec/p2p": "1.0.0-nightly.20250618",
|
|
51
|
+
"@aztec/protocol-contracts": "1.0.0-nightly.20250618",
|
|
52
|
+
"@aztec/prover-client": "1.0.0-nightly.20250618",
|
|
53
|
+
"@aztec/prover-node": "1.0.0-nightly.20250618",
|
|
54
|
+
"@aztec/pxe": "1.0.0-nightly.20250618",
|
|
55
|
+
"@aztec/sequencer-client": "1.0.0-nightly.20250618",
|
|
56
|
+
"@aztec/simulator": "1.0.0-nightly.20250618",
|
|
57
|
+
"@aztec/slasher": "1.0.0-nightly.20250618",
|
|
58
|
+
"@aztec/stdlib": "1.0.0-nightly.20250618",
|
|
59
|
+
"@aztec/telemetry-client": "1.0.0-nightly.20250618",
|
|
60
|
+
"@aztec/validator-client": "1.0.0-nightly.20250618",
|
|
61
|
+
"@aztec/world-state": "1.0.0-nightly.20250618",
|
|
62
62
|
"@iarna/toml": "^2.2.5",
|
|
63
63
|
"@jest/globals": "^29.5.0",
|
|
64
64
|
"@noble/curves": "^1.0.0",
|
|
@@ -123,6 +123,7 @@
|
|
|
123
123
|
"jest": {
|
|
124
124
|
"slowTestThreshold": 300,
|
|
125
125
|
"setupFilesAfterEnv": [
|
|
126
|
+
"../../foundation/src/jest/setupAfterEnv.mjs",
|
|
126
127
|
"jest-extended/all",
|
|
127
128
|
"./shared/jest_setup.ts"
|
|
128
129
|
],
|
|
@@ -9,9 +9,10 @@ import {
|
|
|
9
9
|
retryUntil,
|
|
10
10
|
sleep,
|
|
11
11
|
} from '@aztec/aztec.js';
|
|
12
|
-
import type
|
|
12
|
+
import { type ExtendedViemWalletClient, createExtendedL1Client } from '@aztec/ethereum';
|
|
13
13
|
import { RollupContract } from '@aztec/ethereum/contracts';
|
|
14
|
-
import { ChainMonitor, DelayedTxUtils, type Delayer, waitUntilL1Timestamp } from '@aztec/ethereum/test';
|
|
14
|
+
import { ChainMonitor, DelayedTxUtils, type Delayer, waitUntilL1Timestamp, withDelayer } from '@aztec/ethereum/test';
|
|
15
|
+
import { SecretValue } from '@aztec/foundation/config';
|
|
15
16
|
import { randomBytes } from '@aztec/foundation/crypto';
|
|
16
17
|
import { withLogNameSuffix } from '@aztec/foundation/log';
|
|
17
18
|
import { SpamContract } from '@aztec/noir-test-contracts.js/Spam';
|
|
@@ -26,6 +27,7 @@ import { tryStop } from '@aztec/stdlib/interfaces/server';
|
|
|
26
27
|
|
|
27
28
|
import { join } from 'path';
|
|
28
29
|
import type { Hex } from 'viem';
|
|
30
|
+
import { privateKeyToAccount } from 'viem/accounts';
|
|
29
31
|
|
|
30
32
|
import {
|
|
31
33
|
type EndToEndContext,
|
|
@@ -205,7 +207,7 @@ export class EpochsTestContext {
|
|
|
205
207
|
opts: Partial<AztecNodeConfig> & { dontStartSequencer?: boolean } = {},
|
|
206
208
|
) {
|
|
207
209
|
this.logger.warn('Creating and syncing a validator node...');
|
|
208
|
-
return this.createNode({ ...opts, disableValidator: false, validatorPrivateKeys: privateKeys });
|
|
210
|
+
return this.createNode({ ...opts, disableValidator: false, validatorPrivateKeys: new SecretValue(privateKeys) });
|
|
209
211
|
}
|
|
210
212
|
|
|
211
213
|
private async createNode(opts: Partial<AztecNodeConfig> & { dontStartSequencer?: boolean } = {}) {
|
|
@@ -219,7 +221,7 @@ export class EpochsTestContext {
|
|
|
219
221
|
{
|
|
220
222
|
...resolvedConfig,
|
|
221
223
|
dataDirectory: join(this.context.config.dataDirectory!, randomBytes(8).toString('hex')),
|
|
222
|
-
validatorPrivateKeys: opts.validatorPrivateKeys,
|
|
224
|
+
validatorPrivateKeys: opts.validatorPrivateKeys ?? new SecretValue([]),
|
|
223
225
|
p2pEnabled,
|
|
224
226
|
p2pIp,
|
|
225
227
|
},
|
|
@@ -315,6 +317,20 @@ export class EpochsTestContext {
|
|
|
315
317
|
return SpamContract.at(instance.address, wallet);
|
|
316
318
|
}
|
|
317
319
|
|
|
320
|
+
/** Creates an L1 client using a fresh account with funds from anvil, with a tx delayer already set up. */
|
|
321
|
+
public async createL1Client() {
|
|
322
|
+
const { client, delayer } = withDelayer(
|
|
323
|
+
createExtendedL1Client(
|
|
324
|
+
[...this.l1Client.chain.rpcUrls.default.http],
|
|
325
|
+
privateKeyToAccount(this.getNextPrivateKey()),
|
|
326
|
+
this.l1Client.chain,
|
|
327
|
+
),
|
|
328
|
+
{ ethereumSlotDuration: this.L1_BLOCK_TIME_IN_S },
|
|
329
|
+
);
|
|
330
|
+
expect(await client.getBalance({ address: client.account.address })).toBeGreaterThan(0n);
|
|
331
|
+
return { client, delayer };
|
|
332
|
+
}
|
|
333
|
+
|
|
318
334
|
/** Verifies whether the given block number is found on the aztec node. */
|
|
319
335
|
public async verifyHistoricBlock(blockNumber: L2BlockNumber, expectedSuccess: boolean) {
|
|
320
336
|
// We use `findLeavesIndexes` here, but could use any function that queries the world-state
|
|
@@ -20,6 +20,7 @@ import { createBlobSinkClient } from '@aztec/blob-sink/client';
|
|
|
20
20
|
import type { BlobSinkServer } from '@aztec/blob-sink/server';
|
|
21
21
|
import type { DeployL1ContractsReturnType } from '@aztec/ethereum';
|
|
22
22
|
import { Buffer32 } from '@aztec/foundation/buffer';
|
|
23
|
+
import { SecretValue } from '@aztec/foundation/config';
|
|
23
24
|
import { TestERC20Abi } from '@aztec/l1-artifacts';
|
|
24
25
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
25
26
|
import { type ProverNode, type ProverNodeConfig, createProverNode } from '@aztec/prover-node';
|
|
@@ -289,7 +290,7 @@ export class FullProverTest {
|
|
|
289
290
|
proverId: this.proverAddress.toField(),
|
|
290
291
|
realProofs: this.realProofs,
|
|
291
292
|
proverAgentCount: 2,
|
|
292
|
-
publisherPrivateKey: `0x${proverNodePrivateKey!.toString('hex')}
|
|
293
|
+
publisherPrivateKey: new SecretValue(`0x${proverNodePrivateKey!.toString('hex')}` as const),
|
|
293
294
|
proverNodeMaxPendingJobs: 100,
|
|
294
295
|
proverNodeMaxParallelBlocksPerEpoch: 32,
|
|
295
296
|
proverNodePollingIntervalMs: 100,
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
*/
|
|
4
4
|
import { type AztecNodeConfig, AztecNodeService } from '@aztec/aztec-node';
|
|
5
5
|
import type { SentTx } from '@aztec/aztec.js';
|
|
6
|
+
import { SecretValue } from '@aztec/foundation/config';
|
|
6
7
|
import { addLogNameHandler, removeLogNameHandler } from '@aztec/foundation/log';
|
|
7
8
|
import type { DateProvider } from '@aztec/foundation/timer';
|
|
8
9
|
import type { PXEService } from '@aztec/pxe/server';
|
|
@@ -113,8 +114,8 @@ export async function createValidatorConfig(
|
|
|
113
114
|
ATTESTER_PRIVATE_KEYS_START_INDEX + addressIndex,
|
|
114
115
|
)!.toString('hex')}`;
|
|
115
116
|
|
|
116
|
-
config.validatorPrivateKeys = [attesterPrivateKey];
|
|
117
|
-
config.publisherPrivateKey = attesterPrivateKey;
|
|
117
|
+
config.validatorPrivateKeys = new SecretValue([attesterPrivateKey]);
|
|
118
|
+
config.publisherPrivateKey = new SecretValue(attesterPrivateKey);
|
|
118
119
|
|
|
119
120
|
const nodeConfig: AztecNodeConfig = {
|
|
120
121
|
...config,
|
|
@@ -21,11 +21,13 @@ import {
|
|
|
21
21
|
type DeployL1ContractsArgs,
|
|
22
22
|
type DeployL1ContractsReturnType,
|
|
23
23
|
createExtendedL1Client,
|
|
24
|
+
deployMulticall3,
|
|
24
25
|
getL1ContractsConfigEnvVars,
|
|
25
26
|
l1Artifacts,
|
|
26
27
|
} from '@aztec/ethereum';
|
|
27
28
|
import { EthCheatCodesWithState, startAnvil } from '@aztec/ethereum/test';
|
|
28
29
|
import { asyncMap } from '@aztec/foundation/async-map';
|
|
30
|
+
import { SecretValue } from '@aztec/foundation/config';
|
|
29
31
|
import { randomBytes } from '@aztec/foundation/crypto';
|
|
30
32
|
import { tryRmDir } from '@aztec/foundation/fs';
|
|
31
33
|
import { createLogger } from '@aztec/foundation/log';
|
|
@@ -46,6 +48,7 @@ import { tmpdir } from 'os';
|
|
|
46
48
|
import path, { join } from 'path';
|
|
47
49
|
import { type Hex, getContract } from 'viem';
|
|
48
50
|
import { mnemonicToAccount } from 'viem/accounts';
|
|
51
|
+
import { foundry } from 'viem/chains';
|
|
49
52
|
|
|
50
53
|
import { MNEMONIC, TEST_PEER_CHECK_INTERVAL_MS } from './fixtures.js';
|
|
51
54
|
import { getACVMConfig } from './get_acvm_config.js';
|
|
@@ -338,8 +341,8 @@ async function setupFromFresh(
|
|
|
338
341
|
const validatorPrivKey = getPrivateKeyFromIndex(0);
|
|
339
342
|
const proverNodePrivateKey = getPrivateKeyFromIndex(0);
|
|
340
343
|
|
|
341
|
-
aztecNodeConfig.publisherPrivateKey = `0x${publisherPrivKey!.toString('hex')}
|
|
342
|
-
aztecNodeConfig.validatorPrivateKeys = [`0x${validatorPrivKey!.toString('hex')}`];
|
|
344
|
+
aztecNodeConfig.publisherPrivateKey = new SecretValue<`0x${string}`>(`0x${publisherPrivKey!.toString('hex')}`);
|
|
345
|
+
aztecNodeConfig.validatorPrivateKeys = new SecretValue([`0x${validatorPrivKey!.toString('hex')}`]);
|
|
343
346
|
|
|
344
347
|
const ethCheatCodes = new EthCheatCodesWithState(aztecNodeConfig.l1RpcUrls);
|
|
345
348
|
|
|
@@ -354,6 +357,9 @@ async function setupFromFresh(
|
|
|
354
357
|
opts.initialAccountFeeJuice,
|
|
355
358
|
);
|
|
356
359
|
|
|
360
|
+
const l1Client = createExtendedL1Client([aztecNodeConfig.l1RpcUrls[0]], hdAccount, foundry);
|
|
361
|
+
await deployMulticall3(l1Client, logger);
|
|
362
|
+
|
|
357
363
|
const deployL1ContractsValues = await setupL1Contracts(aztecNodeConfig.l1RpcUrls[0], hdAccount, logger, {
|
|
358
364
|
...getL1ContractsConfigEnvVars(),
|
|
359
365
|
genesisArchiveRoot,
|
package/src/fixtures/utils.ts
CHANGED
|
@@ -31,16 +31,17 @@ import { GENESIS_ARCHIVE_ROOT, SPONSORED_FPC_SALT } from '@aztec/constants';
|
|
|
31
31
|
import {
|
|
32
32
|
type DeployL1ContractsArgs,
|
|
33
33
|
type DeployL1ContractsReturnType,
|
|
34
|
-
ForwarderContract,
|
|
35
34
|
NULL_KEY,
|
|
36
35
|
type Operator,
|
|
37
36
|
createExtendedL1Client,
|
|
38
37
|
deployL1Contracts,
|
|
38
|
+
deployMulticall3,
|
|
39
39
|
getL1ContractsConfigEnvVars,
|
|
40
40
|
isAnvilTestChain,
|
|
41
41
|
l1Artifacts,
|
|
42
42
|
} from '@aztec/ethereum';
|
|
43
43
|
import { DelayedTxUtils, EthCheatCodesWithState, startAnvil } from '@aztec/ethereum/test';
|
|
44
|
+
import { SecretValue } from '@aztec/foundation/config';
|
|
44
45
|
import { randomBytes } from '@aztec/foundation/crypto';
|
|
45
46
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
46
47
|
import { Fr } from '@aztec/foundation/fields';
|
|
@@ -367,7 +368,7 @@ export async function setup(
|
|
|
367
368
|
|
|
368
369
|
const config = { ...getConfigEnvVars(), ...opts };
|
|
369
370
|
// use initialValidators for the node config
|
|
370
|
-
config.validatorPrivateKeys = opts.initialValidators?.map(v => v.privateKey);
|
|
371
|
+
config.validatorPrivateKeys = new SecretValue(opts.initialValidators?.map(v => v.privateKey) ?? []);
|
|
371
372
|
|
|
372
373
|
config.peerCheckIntervalMS = TEST_PEER_CHECK_INTERVAL_MS;
|
|
373
374
|
// For tests we only want proving enabled if specifically requested
|
|
@@ -419,15 +420,15 @@ export async function setup(
|
|
|
419
420
|
let publisherPrivKey = undefined;
|
|
420
421
|
let publisherHdAccount = undefined;
|
|
421
422
|
|
|
422
|
-
if (config.publisherPrivateKey && config.publisherPrivateKey != NULL_KEY) {
|
|
423
|
-
publisherHdAccount = privateKeyToAccount(config.publisherPrivateKey);
|
|
423
|
+
if (config.publisherPrivateKey && config.publisherPrivateKey.getValue() != NULL_KEY) {
|
|
424
|
+
publisherHdAccount = privateKeyToAccount(config.publisherPrivateKey.getValue());
|
|
424
425
|
} else if (!MNEMONIC) {
|
|
425
426
|
throw new Error(`Mnemonic not provided and no publisher private key`);
|
|
426
427
|
} else {
|
|
427
428
|
publisherHdAccount = mnemonicToAccount(MNEMONIC, { addressIndex: 0 });
|
|
428
429
|
const publisherPrivKeyRaw = publisherHdAccount.getHdKey().privateKey;
|
|
429
430
|
publisherPrivKey = publisherPrivKeyRaw === null ? null : Buffer.from(publisherPrivKeyRaw);
|
|
430
|
-
config.publisherPrivateKey = `0x${publisherPrivKey!.toString('hex')}
|
|
431
|
+
config.publisherPrivateKey = new SecretValue(`0x${publisherPrivKey!.toString('hex')}` as const);
|
|
431
432
|
}
|
|
432
433
|
|
|
433
434
|
if (PXE_URL) {
|
|
@@ -450,6 +451,9 @@ export async function setup(
|
|
|
450
451
|
await ethCheatCodes.setAutomine(true);
|
|
451
452
|
}
|
|
452
453
|
|
|
454
|
+
const l1Client = createExtendedL1Client(config.l1RpcUrls, publisherHdAccount!, chain);
|
|
455
|
+
await deployMulticall3(l1Client, logger);
|
|
456
|
+
|
|
453
457
|
const deployL1ContractsValues =
|
|
454
458
|
opts.deployL1ContractsValues ??
|
|
455
459
|
(await setupL1Contracts(
|
|
@@ -839,7 +843,7 @@ export function createAndSyncProverNode(
|
|
|
839
843
|
proverCoordinationNodeUrls: [],
|
|
840
844
|
realProofs: false,
|
|
841
845
|
proverAgentCount: 2,
|
|
842
|
-
publisherPrivateKey: proverNodePrivateKey,
|
|
846
|
+
publisherPrivateKey: new SecretValue(proverNodePrivateKey),
|
|
843
847
|
proverNodeMaxPendingJobs: 10,
|
|
844
848
|
proverNodeMaxParallelBlocksPerEpoch: 32,
|
|
845
849
|
proverNodePollingIntervalMs: 200,
|
|
@@ -871,13 +875,3 @@ function createDelayedL1TxUtils(aztecNodeConfig: AztecNodeConfig, privateKey: `0
|
|
|
871
875
|
l1TxUtils.enableDelayer(aztecNodeConfig.ethereumSlotDuration);
|
|
872
876
|
return l1TxUtils;
|
|
873
877
|
}
|
|
874
|
-
|
|
875
|
-
export async function createForwarderContract(
|
|
876
|
-
aztecNodeConfig: AztecNodeConfig,
|
|
877
|
-
privateKey: `0x${string}`,
|
|
878
|
-
rollupAddress: Hex,
|
|
879
|
-
) {
|
|
880
|
-
const l1Client = createExtendedL1Client(aztecNodeConfig.l1RpcUrls, privateKey, foundry);
|
|
881
|
-
const forwarderContract = await ForwarderContract.create(l1Client, createLogger('forwarder'), rollupAddress);
|
|
882
|
-
return forwarderContract;
|
|
883
|
-
}
|