@aztec/end-to-end 0.84.0 → 0.85.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/bench/utils.d.ts +1 -1
- package/dest/bench/utils.d.ts.map +1 -1
- package/dest/bench/utils.js +3 -3
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts +2 -2
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.d.ts.map +1 -1
- package/dest/e2e_blacklist_token_contract/blacklist_token_contract_test.js +3 -3
- package/dest/e2e_epochs/epochs_test.d.ts +2 -2
- package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.js +10 -5
- package/dest/e2e_p2p/p2p_network.d.ts +235 -1
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +32 -18
- package/dest/e2e_p2p/shared.d.ts +7 -1
- package/dest/e2e_p2p/shared.d.ts.map +1 -1
- package/dest/e2e_p2p/shared.js +30 -1
- package/dest/e2e_token_contract/token_contract_test.d.ts +2 -2
- package/dest/e2e_token_contract/token_contract_test.d.ts.map +1 -1
- package/dest/e2e_token_contract/token_contract_test.js +3 -3
- package/dest/fixtures/fixtures.d.ts.map +1 -1
- package/dest/fixtures/fixtures.js +1 -1
- package/dest/fixtures/snapshot_manager.js +2 -2
- package/dest/fixtures/utils.js +1 -1
- package/dest/shared/capture_private_execution_steps.d.ts.map +1 -1
- package/dest/shared/capture_private_execution_steps.js +29 -28
- package/dest/shared/cross_chain_test_harness.d.ts.map +1 -1
- package/dest/shared/cross_chain_test_harness.js +6 -2
- package/dest/spartan/setup_test_wallets.d.ts.map +1 -1
- package/dest/spartan/setup_test_wallets.js +2 -1
- package/package.json +36 -39
- package/src/bench/utils.ts +3 -7
- package/src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts +4 -4
- package/src/e2e_epochs/epochs_test.ts +13 -5
- package/src/e2e_p2p/p2p_network.ts +39 -26
- package/src/e2e_p2p/shared.ts +33 -7
- package/src/e2e_token_contract/token_contract_test.ts +4 -4
- package/src/fixtures/fixtures.ts +1 -1
- package/src/fixtures/snapshot_manager.ts +2 -2
- package/src/fixtures/utils.ts +1 -1
- package/src/guides/up_quick_start.sh +1 -0
- package/src/shared/capture_private_execution_steps.ts +25 -28
- package/src/shared/cross_chain_test_harness.ts +4 -2
- package/src/spartan/setup_test_wallets.ts +2 -1
package/dest/bench/utils.d.ts
CHANGED
|
@@ -41,6 +41,6 @@ export declare function waitTxs(txs: SentTx[], context: EndToEndContext, txWaitO
|
|
|
41
41
|
* @param startingBlock - First l2 block to process.
|
|
42
42
|
* @returns The new PXE.
|
|
43
43
|
*/
|
|
44
|
-
export declare function createNewPXE(node: AztecNode, contract: BenchmarkingContract
|
|
44
|
+
export declare function createNewPXE(node: AztecNode, contract: BenchmarkingContract): Promise<PXEService>;
|
|
45
45
|
export {};
|
|
46
46
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/bench/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/bench/utils.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,SAAS,EAAa,KAAK,MAAM,EAAE,KAAK,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAExF,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,KAAK,UAAU,EAA2C,MAAM,mBAAmB,CAAC;AAC7F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAA4C,wBAAwB,EAAE,MAAM,+BAA+B,CAAC;AAIxH,OAAO,EAAE,KAAK,eAAe,EAAE,KAAK,YAAY,EAAS,MAAM,sBAAsB,CAAC;AAEtF;;GAEG;AACH,wBAAsB,cAAc,CAClC,IAAI,EAAE,OAAO,CAAC,YAAY,CAAC,GAAG;IAC5B,6BAA6B,CAAC,OAAO,EAAE,CAAC,WAAW,GAAG,YAAY,CAAC,EAAE,CAAC;IACtE,kFAAkF;IAClF,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;;;;;GAuBF;AAED,KAAK,YAAY,GAAG;IAClB,MAAM,EAAE,WAAW,CAAC;IACpB,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,MAAM,CAAC;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAuEF;;;;;;;;GAQG;AACH,wBAAsB,OAAO,CAC3B,OAAO,EAAE,MAAM,EACf,OAAO,EAAE,eAAe,EACxB,QAAQ,EAAE,oBAAoB,EAC9B,kBAAkB,GAAE,OAAe,GAClC,OAAO,CAAC,MAAM,EAAE,CAAC,CAMnB;AAED,wBAAsB,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,OAAO,EAAE,eAAe,EAAE,UAAU,CAAC,EAAE,QAAQ,iBAI3F;AAED;;;;;;GAMG;AACH,wBAAsB,YAAY,CAAC,IAAI,EAAE,SAAS,EAAE,QAAQ,EAAE,oBAAoB,GAAG,OAAO,CAAC,UAAU,CAAC,CAevG"}
|
package/dest/bench/utils.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { BatchCall
|
|
1
|
+
import { BatchCall } from '@aztec/aztec.js';
|
|
2
2
|
import { mean, stdDev, times } from '@aztec/foundation/collection';
|
|
3
3
|
import { BenchmarkingContract } from '@aztec/noir-contracts.js/Benchmarking';
|
|
4
4
|
import { createPXEService } from '@aztec/pxe/server';
|
|
@@ -127,11 +127,11 @@ export async function waitTxs(txs, context, txWaitOpts) {
|
|
|
127
127
|
* @param contract - Benchmark contract to add to the pxe.
|
|
128
128
|
* @param startingBlock - First l2 block to process.
|
|
129
129
|
* @returns The new PXE.
|
|
130
|
-
*/ export async function createNewPXE(node, contract
|
|
130
|
+
*/ export async function createNewPXE(node, contract) {
|
|
131
131
|
const l1Contracts = await node.getL1ContractAddresses();
|
|
132
132
|
const { l1ChainId, rollupVersion } = await node.getNodeInfo();
|
|
133
133
|
const pxeConfig = {
|
|
134
|
-
|
|
134
|
+
l2BlockBatchSize: 200,
|
|
135
135
|
l2BlockPollingIntervalMS: 100,
|
|
136
136
|
dataDirectory: undefined,
|
|
137
137
|
dataStoreMapSizeKB: 1024 * 1024,
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type AccountWallet, AztecAddress, type CompleteAddress, Fr, type Logger, type PXE, type TxHash } from '@aztec/aztec.js';
|
|
2
|
-
import {
|
|
2
|
+
import { InvalidAccountContract } from '@aztec/noir-contracts.js/InvalidAccount';
|
|
3
3
|
import { TokenBlacklistContract } from '@aztec/noir-contracts.js/TokenBlacklist';
|
|
4
4
|
import { type SubsystemsContext } from '../fixtures/snapshot_manager.js';
|
|
5
5
|
import { TokenSimulator } from '../simulators/token_simulator.js';
|
|
@@ -26,7 +26,7 @@ export declare class BlacklistTokenContractTest {
|
|
|
26
26
|
accounts: CompleteAddress[];
|
|
27
27
|
asset: TokenBlacklistContract;
|
|
28
28
|
tokenSim: TokenSimulator;
|
|
29
|
-
badAccount:
|
|
29
|
+
badAccount: InvalidAccountContract;
|
|
30
30
|
admin: AccountWallet;
|
|
31
31
|
other: AccountWallet;
|
|
32
32
|
blacklisted: AccountWallet;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"blacklist_token_contract_test.d.ts","sourceRoot":"","sources":["../../src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,aAAa,EAClB,YAAY,EACZ,KAAK,eAAe,EACpB,EAAE,EACF,KAAK,MAAM,EACX,KAAK,GAAG,EACR,KAAK,MAAM,EAGZ,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"blacklist_token_contract_test.d.ts","sourceRoot":"","sources":["../../src/e2e_blacklist_token_contract/blacklist_token_contract_test.ts"],"names":[],"mappings":"AACA,OAAO,EACL,KAAK,aAAa,EAClB,YAAY,EACZ,KAAK,eAAe,EACpB,EAAE,EACF,KAAK,MAAM,EACX,KAAK,GAAG,EACR,KAAK,MAAM,EAGZ,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AAEjF,OAAO,EAAE,sBAAsB,EAAE,MAAM,yCAAyC,CAAC;AAIjF,OAAO,EAEL,KAAK,iBAAiB,EAIvB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,kCAAkC,CAAC;AAIlE,qBAAa,IAAI;IACf,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,aAAa,CAAS;IAE9B,SAAS;IAKT,UAAU;IAKV,eAAe;IAKf,YAAY;;;;;CAKb;AAED,qBAAa,0BAA0B;;IAGrC,MAAM,CAAC,KAAK,SAAK;IAEjB,OAAO,CAAC,eAAe,CAAmB;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,aAAa,EAAE,CAAM;IAC9B,GAAG,EAAG,GAAG,CAAC;IACV,QAAQ,EAAE,eAAe,EAAE,CAAM;IACjC,KAAK,EAAG,sBAAsB,CAAC;IAC/B,QAAQ,EAAG,cAAc,CAAC;IAC1B,UAAU,EAAG,sBAAsB,CAAC;IAEpC,KAAK,EAAG,aAAa,CAAC;IACtB,KAAK,EAAG,aAAa,CAAC;IACtB,WAAW,EAAG,aAAa,CAAC;gBAEhB,QAAQ,EAAE,MAAM;IAKtB,UAAU,CAAC,MAAM,GAAE,MAAyC;IAMlE;;;;OAIG;IACG,kBAAkB;IA2DlB,KAAK;IAIX,QAAQ,YACA,MAAM,SACL,CAAC,OAAO,EAAE,iBAAiB,KAAK,QAAQ,CAAC,CAAC,YACxC,CAAC,YAAY,EAAE,CAAC,EAAE,OAAO,EAAE,iBAAiB,KAAK,QAAQ,IAAI,CAAC,KACtE,QAAQ,IAAI,CAAC,CAAwD;IAElE,QAAQ;IAQR,yBAAyB,CAC7B,QAAQ,EAAE,sBAAsB,EAChC,SAAS,EAAE,YAAY,EACvB,MAAM,EAAE,MAAM,EACd,UAAU,EAAE,EAAE,EACd,MAAM,EAAE,MAAM;IAgBV,iBAAiB;CAmExB"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { getSchnorrWallet } from '@aztec/accounts/schnorr';
|
|
2
2
|
import { Fr, computeSecretHash, createLogger } from '@aztec/aztec.js';
|
|
3
3
|
import { MAX_NOTE_HASHES_PER_TX } from '@aztec/constants';
|
|
4
|
-
import {
|
|
4
|
+
import { InvalidAccountContract } from '@aztec/noir-contracts.js/InvalidAccount';
|
|
5
5
|
import { TokenBlacklistContract } from '@aztec/noir-contracts.js/TokenBlacklist';
|
|
6
6
|
import { jest } from '@jest/globals';
|
|
7
7
|
import { createSnapshotManager, deployAccounts, publicDeployAccounts } from '../fixtures/snapshot_manager.js';
|
|
@@ -81,7 +81,7 @@ export class BlacklistTokenContractTest {
|
|
|
81
81
|
this.asset = await TokenBlacklistContract.deploy(this.admin, this.admin.getAddress()).send().deployed();
|
|
82
82
|
this.logger.verbose(`Token deployed to ${this.asset.address}`);
|
|
83
83
|
this.logger.verbose(`Deploying bad account...`);
|
|
84
|
-
this.badAccount = await
|
|
84
|
+
this.badAccount = await InvalidAccountContract.deploy(this.wallets[0]).send().deployed();
|
|
85
85
|
this.logger.verbose(`Deployed to ${this.badAccount.address}.`);
|
|
86
86
|
await this.mineBlocks();
|
|
87
87
|
return {
|
|
@@ -93,7 +93,7 @@ export class BlacklistTokenContractTest {
|
|
|
93
93
|
this.asset = await TokenBlacklistContract.at(tokenContractAddress, this.wallets[0]);
|
|
94
94
|
this.logger.verbose(`Token contract address: ${this.asset.address}`);
|
|
95
95
|
this.tokenSim = new TokenSimulator(this.asset, this.wallets[0], this.logger, this.accounts.map((a)=>a.address));
|
|
96
|
-
this.badAccount = await
|
|
96
|
+
this.badAccount = await InvalidAccountContract.at(badAccountAddress, this.wallets[0]);
|
|
97
97
|
this.logger.verbose(`Bad account address: ${this.badAccount.address}`);
|
|
98
98
|
expect(await this.asset.methods.get_roles(this.admin.getAddress()).simulate()).toEqual(new Role().withAdmin().toNoirStruct());
|
|
99
99
|
});
|
|
@@ -8,12 +8,11 @@ import type { L1RollupConstants } from '@aztec/stdlib/epoch-helpers';
|
|
|
8
8
|
import type { PublicClient } from 'viem';
|
|
9
9
|
import { type EndToEndContext, type SetupOptions } from '../fixtures/utils.js';
|
|
10
10
|
export declare const L1_BLOCK_TIME_IN_S: number;
|
|
11
|
-
export declare const EPOCH_DURATION_IN_L2_SLOTS = 4;
|
|
12
11
|
export declare const L2_SLOT_DURATION_IN_L1_SLOTS = 2;
|
|
13
12
|
export declare const WORLD_STATE_BLOCK_HISTORY = 2;
|
|
14
13
|
export declare const WORLD_STATE_BLOCK_CHECK_INTERVAL = 50;
|
|
15
14
|
export declare const ARCHIVER_POLL_INTERVAL = 50;
|
|
16
|
-
export type EpochsTestOpts = Partial<Pick<SetupOptions, 'startProverNode'>>;
|
|
15
|
+
export type EpochsTestOpts = Partial<Pick<SetupOptions, 'startProverNode' | 'aztecProofSubmissionWindow' | 'aztecEpochDuration' | 'proverTestDelayMs'>>;
|
|
17
16
|
/**
|
|
18
17
|
* Tests building of epochs using fast block times and short epochs.
|
|
19
18
|
* Spawns an aztec node and a prover node with fake proofs.
|
|
@@ -30,6 +29,7 @@ export declare class EpochsTestContext {
|
|
|
30
29
|
sequencerDelayer: Delayer;
|
|
31
30
|
proverNodes: ProverNode[];
|
|
32
31
|
nodes: AztecNodeService[];
|
|
32
|
+
epochDuration: number;
|
|
33
33
|
static setup(opts?: EpochsTestOpts): Promise<EpochsTestContext>;
|
|
34
34
|
setup(opts?: EpochsTestOpts): Promise<void>;
|
|
35
35
|
teardown(): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"epochs_test.d.ts","sourceRoot":"","sources":["../../src/e2e_epochs/epochs_test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAM,KAAK,MAAM,EAA8D,MAAM,iBAAiB,CAAC;AAC9G,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAkB,KAAK,OAAO,EAAwB,MAAM,sBAAsB,CAAC;AAGxG,OAAO,EAAE,UAAU,EAAuB,MAAM,oBAAoB,CAAC;AAIrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,6BAA6B,CAAC;AAGrE,OAAO,KAAK,EAAO,YAAY,EAAE,MAAM,MAAM,CAAC;AAE9C,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,YAAY,EAIlB,MAAM,sBAAsB,CAAC;AAG9B,eAAO,MAAM,kBAAkB,QAAsE,CAAC;AACtG,eAAO,MAAM,
|
|
1
|
+
{"version":3,"file":"epochs_test.d.ts","sourceRoot":"","sources":["../../src/e2e_epochs/epochs_test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AACrD,OAAO,EAAM,KAAK,MAAM,EAA8D,MAAM,iBAAiB,CAAC;AAC9G,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAkB,KAAK,OAAO,EAAwB,MAAM,sBAAsB,CAAC;AAGxG,OAAO,EAAE,UAAU,EAAuB,MAAM,oBAAoB,CAAC;AAIrE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,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E,mEAAmE;IACtD,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,GAAG,UAAU;IAclF,0EAA0E;IAC7D,mBAAmB,CAAC,WAAW,EAAE,aAAa,EAAE,eAAe,EAAE,OAAO;CAUtF"}
|
|
@@ -8,7 +8,6 @@ import { join } from 'path';
|
|
|
8
8
|
import { createAndSyncProverNode, getPrivateKeyFromIndex, setup } from '../fixtures/utils.js';
|
|
9
9
|
// This can be lowered to as much as 2s in non-CI
|
|
10
10
|
export const L1_BLOCK_TIME_IN_S = process.env.L1_BLOCK_TIME ? parseInt(process.env.L1_BLOCK_TIME) : 8;
|
|
11
|
-
export const EPOCH_DURATION_IN_L2_SLOTS = 4;
|
|
12
11
|
export const L2_SLOT_DURATION_IN_L1_SLOTS = 2;
|
|
13
12
|
export const WORLD_STATE_BLOCK_HISTORY = 2;
|
|
14
13
|
export const WORLD_STATE_BLOCK_CHECK_INTERVAL = 50;
|
|
@@ -28,6 +27,7 @@ export const ARCHIVER_POLL_INTERVAL = 50;
|
|
|
28
27
|
sequencerDelayer;
|
|
29
28
|
proverNodes = [];
|
|
30
29
|
nodes = [];
|
|
30
|
+
epochDuration;
|
|
31
31
|
static async setup(opts = {}) {
|
|
32
32
|
const test = new EpochsTestContext();
|
|
33
33
|
await test.setup(opts);
|
|
@@ -36,19 +36,22 @@ export const ARCHIVER_POLL_INTERVAL = 50;
|
|
|
36
36
|
async setup(opts = {}) {
|
|
37
37
|
// Set up system without any account nor protocol contracts
|
|
38
38
|
// and with faster block times and shorter epochs.
|
|
39
|
+
const aztecEpochDuration = opts.aztecEpochDuration ?? 4;
|
|
40
|
+
const proofSubmissionWindow = opts.aztecProofSubmissionWindow ?? aztecEpochDuration * 2 - 1;
|
|
39
41
|
const context = await setup(0, {
|
|
40
42
|
checkIntervalMs: 50,
|
|
41
43
|
archiverPollingIntervalMS: ARCHIVER_POLL_INTERVAL,
|
|
42
44
|
worldStateBlockCheckIntervalMS: WORLD_STATE_BLOCK_CHECK_INTERVAL,
|
|
43
45
|
skipProtocolContracts: true,
|
|
44
46
|
salt: 1,
|
|
45
|
-
aztecEpochDuration
|
|
47
|
+
aztecEpochDuration,
|
|
46
48
|
aztecSlotDuration: L1_BLOCK_TIME_IN_S * L2_SLOT_DURATION_IN_L1_SLOTS,
|
|
47
49
|
ethereumSlotDuration: L1_BLOCK_TIME_IN_S,
|
|
48
|
-
aztecProofSubmissionWindow:
|
|
50
|
+
aztecProofSubmissionWindow: proofSubmissionWindow,
|
|
49
51
|
minTxsPerBlock: 0,
|
|
50
52
|
realProofs: false,
|
|
51
53
|
startProverNode: true,
|
|
54
|
+
proverTestDelayMs: opts.proverTestDelayMs ?? 0,
|
|
52
55
|
// We use numeric incremental prover ids for simplicity, but we can switch to
|
|
53
56
|
// using the prover's eth address if the proverId is used for something in the rollup contract
|
|
54
57
|
proverId: Fr.fromString('1'),
|
|
@@ -78,12 +81,14 @@ export const ARCHIVER_POLL_INTERVAL = 50;
|
|
|
78
81
|
throw new Error(`Could not find prover or sequencer delayer`);
|
|
79
82
|
}
|
|
80
83
|
// Constants used for time calculation
|
|
84
|
+
this.epochDuration = aztecEpochDuration;
|
|
81
85
|
this.constants = {
|
|
82
|
-
epochDuration:
|
|
86
|
+
epochDuration: aztecEpochDuration,
|
|
83
87
|
slotDuration: L1_BLOCK_TIME_IN_S * L2_SLOT_DURATION_IN_L1_SLOTS,
|
|
84
88
|
l1StartBlock: await this.rollup.getL1StartBlock(),
|
|
85
89
|
l1GenesisTime: await this.rollup.getL1GenesisTime(),
|
|
86
|
-
ethereumSlotDuration: L1_BLOCK_TIME_IN_S
|
|
90
|
+
ethereumSlotDuration: L1_BLOCK_TIME_IN_S,
|
|
91
|
+
proofSubmissionWindow
|
|
87
92
|
};
|
|
88
93
|
this.logger.info(`L2 genesis at L1 block ${this.constants.l1StartBlock} (timestamp ${this.constants.l1GenesisTime})`);
|
|
89
94
|
}
|
|
@@ -18,7 +18,230 @@ export declare class P2PNetworkTest {
|
|
|
18
18
|
private numberOfNodes;
|
|
19
19
|
private metricsPort?;
|
|
20
20
|
private snapshotManager;
|
|
21
|
-
|
|
21
|
+
baseAccountPrivateKey: `0x${string}`;
|
|
22
|
+
baseAccount: {
|
|
23
|
+
address: `0x${string}`;
|
|
24
|
+
nonceManager?: import("viem").NonceManager | undefined;
|
|
25
|
+
sign: (parameters: {
|
|
26
|
+
hash: `0x${string}`;
|
|
27
|
+
}) => Promise<`0x${string}`>;
|
|
28
|
+
experimental_signAuthorization: (parameters: import("viem/experimental").Authorization) => Promise<import("viem/accounts").SignAuthorizationReturnType>;
|
|
29
|
+
signMessage: ({ message }: {
|
|
30
|
+
message: import("viem").SignableMessage;
|
|
31
|
+
}) => Promise<`0x${string}`>;
|
|
32
|
+
signTransaction: <serializer extends import("viem").SerializeTransactionFn<import("viem").TransactionSerializable> = import("viem").SerializeTransactionFn<import("viem").TransactionSerializable>, transaction extends Parameters<serializer>[0] = Parameters<serializer>[0]>(transaction: transaction, options?: {
|
|
33
|
+
serializer?: serializer | undefined;
|
|
34
|
+
} | undefined) => Promise<import("viem").IsNarrowable<import("viem").TransactionSerialized<import("viem").GetTransactionType<transaction>>, `0x${string}`> extends true ? import("viem").TransactionSerialized<import("viem").GetTransactionType<transaction>> : `0x${string}`>;
|
|
35
|
+
signTypedData: <const typedData extends Record<string, unknown> | {
|
|
36
|
+
[x: string]: readonly import("viem").TypedDataParameter[];
|
|
37
|
+
[x: `string[${string}]`]: undefined;
|
|
38
|
+
[x: `function[${string}]`]: undefined;
|
|
39
|
+
[x: `address[${string}]`]: undefined;
|
|
40
|
+
[x: `bool[${string}]`]: undefined;
|
|
41
|
+
[x: `bytes[${string}]`]: undefined;
|
|
42
|
+
[x: `bytes8[${string}]`]: undefined;
|
|
43
|
+
[x: `bytes18[${string}]`]: undefined;
|
|
44
|
+
[x: `bytes4[${string}]`]: undefined;
|
|
45
|
+
[x: `bytes1[${string}]`]: undefined;
|
|
46
|
+
[x: `bytes23[${string}]`]: undefined;
|
|
47
|
+
[x: `bytes2[${string}]`]: undefined;
|
|
48
|
+
[x: `bytes3[${string}]`]: undefined;
|
|
49
|
+
[x: `bytes5[${string}]`]: undefined;
|
|
50
|
+
[x: `bytes6[${string}]`]: undefined;
|
|
51
|
+
[x: `bytes7[${string}]`]: undefined;
|
|
52
|
+
[x: `bytes9[${string}]`]: undefined;
|
|
53
|
+
[x: `bytes10[${string}]`]: undefined;
|
|
54
|
+
[x: `bytes11[${string}]`]: undefined;
|
|
55
|
+
[x: `bytes12[${string}]`]: undefined;
|
|
56
|
+
[x: `bytes13[${string}]`]: undefined;
|
|
57
|
+
[x: `bytes14[${string}]`]: undefined;
|
|
58
|
+
[x: `bytes15[${string}]`]: undefined;
|
|
59
|
+
[x: `bytes16[${string}]`]: undefined;
|
|
60
|
+
[x: `bytes17[${string}]`]: undefined;
|
|
61
|
+
[x: `bytes19[${string}]`]: undefined;
|
|
62
|
+
[x: `bytes20[${string}]`]: undefined;
|
|
63
|
+
[x: `bytes21[${string}]`]: undefined;
|
|
64
|
+
[x: `bytes22[${string}]`]: undefined;
|
|
65
|
+
[x: `bytes24[${string}]`]: undefined;
|
|
66
|
+
[x: `bytes25[${string}]`]: undefined;
|
|
67
|
+
[x: `bytes26[${string}]`]: undefined;
|
|
68
|
+
[x: `bytes27[${string}]`]: undefined;
|
|
69
|
+
[x: `bytes28[${string}]`]: undefined;
|
|
70
|
+
[x: `bytes29[${string}]`]: undefined;
|
|
71
|
+
[x: `bytes30[${string}]`]: undefined;
|
|
72
|
+
[x: `bytes31[${string}]`]: undefined;
|
|
73
|
+
[x: `bytes32[${string}]`]: undefined;
|
|
74
|
+
[x: `int[${string}]`]: undefined;
|
|
75
|
+
[x: `int8[${string}]`]: undefined;
|
|
76
|
+
[x: `int16[${string}]`]: undefined;
|
|
77
|
+
[x: `int24[${string}]`]: undefined;
|
|
78
|
+
[x: `int32[${string}]`]: undefined;
|
|
79
|
+
[x: `int40[${string}]`]: undefined;
|
|
80
|
+
[x: `int48[${string}]`]: undefined;
|
|
81
|
+
[x: `int56[${string}]`]: undefined;
|
|
82
|
+
[x: `int64[${string}]`]: undefined;
|
|
83
|
+
[x: `int72[${string}]`]: undefined;
|
|
84
|
+
[x: `int80[${string}]`]: undefined;
|
|
85
|
+
[x: `int88[${string}]`]: undefined;
|
|
86
|
+
[x: `int96[${string}]`]: undefined;
|
|
87
|
+
[x: `int104[${string}]`]: undefined;
|
|
88
|
+
[x: `int112[${string}]`]: undefined;
|
|
89
|
+
[x: `int120[${string}]`]: undefined;
|
|
90
|
+
[x: `int128[${string}]`]: undefined;
|
|
91
|
+
[x: `int136[${string}]`]: undefined;
|
|
92
|
+
[x: `int144[${string}]`]: undefined;
|
|
93
|
+
[x: `int152[${string}]`]: undefined;
|
|
94
|
+
[x: `int160[${string}]`]: undefined;
|
|
95
|
+
[x: `int168[${string}]`]: undefined;
|
|
96
|
+
[x: `int176[${string}]`]: undefined;
|
|
97
|
+
[x: `int184[${string}]`]: undefined;
|
|
98
|
+
[x: `int192[${string}]`]: undefined;
|
|
99
|
+
[x: `int200[${string}]`]: undefined;
|
|
100
|
+
[x: `int208[${string}]`]: undefined;
|
|
101
|
+
[x: `int216[${string}]`]: undefined;
|
|
102
|
+
[x: `int224[${string}]`]: undefined;
|
|
103
|
+
[x: `int232[${string}]`]: undefined;
|
|
104
|
+
[x: `int240[${string}]`]: undefined;
|
|
105
|
+
[x: `int248[${string}]`]: undefined;
|
|
106
|
+
[x: `int256[${string}]`]: undefined;
|
|
107
|
+
[x: `uint[${string}]`]: undefined;
|
|
108
|
+
[x: `uint8[${string}]`]: undefined;
|
|
109
|
+
[x: `uint16[${string}]`]: undefined;
|
|
110
|
+
[x: `uint24[${string}]`]: undefined;
|
|
111
|
+
[x: `uint32[${string}]`]: undefined;
|
|
112
|
+
[x: `uint40[${string}]`]: undefined;
|
|
113
|
+
[x: `uint48[${string}]`]: undefined;
|
|
114
|
+
[x: `uint56[${string}]`]: undefined;
|
|
115
|
+
[x: `uint64[${string}]`]: undefined;
|
|
116
|
+
[x: `uint72[${string}]`]: undefined;
|
|
117
|
+
[x: `uint80[${string}]`]: undefined;
|
|
118
|
+
[x: `uint88[${string}]`]: undefined;
|
|
119
|
+
[x: `uint96[${string}]`]: undefined;
|
|
120
|
+
[x: `uint104[${string}]`]: undefined;
|
|
121
|
+
[x: `uint112[${string}]`]: undefined;
|
|
122
|
+
[x: `uint120[${string}]`]: undefined;
|
|
123
|
+
[x: `uint128[${string}]`]: undefined;
|
|
124
|
+
[x: `uint136[${string}]`]: undefined;
|
|
125
|
+
[x: `uint144[${string}]`]: undefined;
|
|
126
|
+
[x: `uint152[${string}]`]: undefined;
|
|
127
|
+
[x: `uint160[${string}]`]: undefined;
|
|
128
|
+
[x: `uint168[${string}]`]: undefined;
|
|
129
|
+
[x: `uint176[${string}]`]: undefined;
|
|
130
|
+
[x: `uint184[${string}]`]: undefined;
|
|
131
|
+
[x: `uint192[${string}]`]: undefined;
|
|
132
|
+
[x: `uint200[${string}]`]: undefined;
|
|
133
|
+
[x: `uint208[${string}]`]: undefined;
|
|
134
|
+
[x: `uint216[${string}]`]: undefined;
|
|
135
|
+
[x: `uint224[${string}]`]: undefined;
|
|
136
|
+
[x: `uint232[${string}]`]: undefined;
|
|
137
|
+
[x: `uint240[${string}]`]: undefined;
|
|
138
|
+
[x: `uint248[${string}]`]: undefined;
|
|
139
|
+
[x: `uint256[${string}]`]: undefined;
|
|
140
|
+
string?: undefined;
|
|
141
|
+
address?: undefined;
|
|
142
|
+
bool?: undefined;
|
|
143
|
+
bytes?: undefined;
|
|
144
|
+
bytes8?: undefined;
|
|
145
|
+
bytes18?: undefined;
|
|
146
|
+
bytes4?: undefined;
|
|
147
|
+
bytes1?: undefined;
|
|
148
|
+
bytes23?: undefined;
|
|
149
|
+
bytes2?: undefined;
|
|
150
|
+
bytes3?: undefined;
|
|
151
|
+
bytes5?: undefined;
|
|
152
|
+
bytes6?: undefined;
|
|
153
|
+
bytes7?: undefined;
|
|
154
|
+
bytes9?: undefined;
|
|
155
|
+
bytes10?: undefined;
|
|
156
|
+
bytes11?: undefined;
|
|
157
|
+
bytes12?: undefined;
|
|
158
|
+
bytes13?: undefined;
|
|
159
|
+
bytes14?: undefined;
|
|
160
|
+
bytes15?: undefined;
|
|
161
|
+
bytes16?: undefined;
|
|
162
|
+
bytes17?: undefined;
|
|
163
|
+
bytes19?: undefined;
|
|
164
|
+
bytes20?: undefined;
|
|
165
|
+
bytes21?: undefined;
|
|
166
|
+
bytes22?: undefined;
|
|
167
|
+
bytes24?: undefined;
|
|
168
|
+
bytes25?: undefined;
|
|
169
|
+
bytes26?: undefined;
|
|
170
|
+
bytes27?: undefined;
|
|
171
|
+
bytes28?: undefined;
|
|
172
|
+
bytes29?: undefined;
|
|
173
|
+
bytes30?: undefined;
|
|
174
|
+
bytes31?: undefined;
|
|
175
|
+
bytes32?: undefined;
|
|
176
|
+
int8?: undefined;
|
|
177
|
+
int16?: undefined;
|
|
178
|
+
int24?: undefined;
|
|
179
|
+
int32?: undefined;
|
|
180
|
+
int40?: undefined;
|
|
181
|
+
int48?: undefined;
|
|
182
|
+
int56?: undefined;
|
|
183
|
+
int64?: undefined;
|
|
184
|
+
int72?: undefined;
|
|
185
|
+
int80?: undefined;
|
|
186
|
+
int88?: undefined;
|
|
187
|
+
int96?: undefined;
|
|
188
|
+
int104?: undefined;
|
|
189
|
+
int112?: undefined;
|
|
190
|
+
int120?: undefined;
|
|
191
|
+
int128?: undefined;
|
|
192
|
+
int136?: undefined;
|
|
193
|
+
int144?: undefined;
|
|
194
|
+
int152?: undefined;
|
|
195
|
+
int160?: undefined;
|
|
196
|
+
int168?: undefined;
|
|
197
|
+
int176?: undefined;
|
|
198
|
+
int184?: undefined;
|
|
199
|
+
int192?: undefined;
|
|
200
|
+
int200?: undefined;
|
|
201
|
+
int208?: undefined;
|
|
202
|
+
int216?: undefined;
|
|
203
|
+
int224?: undefined;
|
|
204
|
+
int232?: undefined;
|
|
205
|
+
int240?: undefined;
|
|
206
|
+
int248?: undefined;
|
|
207
|
+
int256?: undefined;
|
|
208
|
+
uint8?: undefined;
|
|
209
|
+
uint16?: undefined;
|
|
210
|
+
uint24?: undefined;
|
|
211
|
+
uint32?: undefined;
|
|
212
|
+
uint40?: undefined;
|
|
213
|
+
uint48?: undefined;
|
|
214
|
+
uint56?: undefined;
|
|
215
|
+
uint64?: undefined;
|
|
216
|
+
uint72?: undefined;
|
|
217
|
+
uint80?: undefined;
|
|
218
|
+
uint88?: undefined;
|
|
219
|
+
uint96?: undefined;
|
|
220
|
+
uint104?: undefined;
|
|
221
|
+
uint112?: undefined;
|
|
222
|
+
uint120?: undefined;
|
|
223
|
+
uint128?: undefined;
|
|
224
|
+
uint136?: undefined;
|
|
225
|
+
uint144?: undefined;
|
|
226
|
+
uint152?: undefined;
|
|
227
|
+
uint160?: undefined;
|
|
228
|
+
uint168?: undefined;
|
|
229
|
+
uint176?: undefined;
|
|
230
|
+
uint184?: undefined;
|
|
231
|
+
uint192?: undefined;
|
|
232
|
+
uint200?: undefined;
|
|
233
|
+
uint208?: undefined;
|
|
234
|
+
uint216?: undefined;
|
|
235
|
+
uint224?: undefined;
|
|
236
|
+
uint232?: undefined;
|
|
237
|
+
uint240?: undefined;
|
|
238
|
+
uint248?: undefined;
|
|
239
|
+
uint256?: undefined;
|
|
240
|
+
}, primaryType extends "EIP712Domain" | keyof typedData = keyof typedData>(parameters: import("viem").TypedDataDefinition<typedData, primaryType>) => Promise<`0x${string}`>;
|
|
241
|
+
publicKey: `0x${string}`;
|
|
242
|
+
source: "privateKey";
|
|
243
|
+
type: "local";
|
|
244
|
+
};
|
|
22
245
|
logger: Logger;
|
|
23
246
|
monitor: ChainMonitor;
|
|
24
247
|
ctx: SubsystemsContext;
|
|
@@ -30,6 +253,7 @@ export declare class P2PNetworkTest {
|
|
|
30
253
|
attester: `0x${string}`;
|
|
31
254
|
proposer: `0x${string}`;
|
|
32
255
|
withdrawer: `0x${string}`;
|
|
256
|
+
amount: bigint;
|
|
33
257
|
}[];
|
|
34
258
|
deployedAccounts: InitialAccountData[];
|
|
35
259
|
prefilledPublicData: PublicDataTreeLeaf[];
|
|
@@ -55,6 +279,16 @@ export declare class P2PNetworkTest {
|
|
|
55
279
|
* When using fake timers, we need to keep the system and anvil clocks in sync.
|
|
56
280
|
*/
|
|
57
281
|
syncMockSystemTime(): Promise<void>;
|
|
282
|
+
addBootstrapNode(): Promise<void>;
|
|
283
|
+
getValidators(): {
|
|
284
|
+
validators: {
|
|
285
|
+
readonly attester: `0x${string}`;
|
|
286
|
+
readonly proposer: `0x${string}`;
|
|
287
|
+
readonly withdrawer: `0x${string}`;
|
|
288
|
+
readonly amount: bigint;
|
|
289
|
+
}[];
|
|
290
|
+
proposerEOAs: string[];
|
|
291
|
+
};
|
|
58
292
|
applyBaseSnapshots(): Promise<void>;
|
|
59
293
|
setupAccount(): Promise<void>;
|
|
60
294
|
deploySpamContract(): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"p2p_network.d.ts","sourceRoot":"","sources":["../../src/e2e_p2p/p2p_network.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,iBAAiB,CAAC;AAGlE,OAAO,EAAE,YAAY,EAA0B,MAAM,sBAAsB,CAAC;AAC5E,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,uBAAuB,CAAC;AAElE,OAAO,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAC7D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAE1D,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAa9D,OAAO,EAEL,KAAK,iBAAiB,EAGvB,MAAM,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eAAe,CAAC,CAAC;KAC1C;IAcD,IAAI,aAAa,uBAKhB;IAED;;OAEG;IACI,+BAA+B;IAMtC;;OAEG;IACU,kBAAkB;IAczB,gBAAgB;IActB,aAAa;;;;;;;;;IA0BP,kBAAkB;IAiElB,YAAY;IAYZ,kBAAkB;IAoBlB,iBAAiB;IAsBjB,KAAK;IA2BL,SAAS,CAAC,KAAK,EAAE,gBAAgB,EAAE;IAanC,QAAQ;CAQf"}
|
|
@@ -28,6 +28,7 @@ export class P2PNetworkTest {
|
|
|
28
28
|
numberOfNodes;
|
|
29
29
|
metricsPort;
|
|
30
30
|
snapshotManager;
|
|
31
|
+
baseAccountPrivateKey;
|
|
31
32
|
baseAccount;
|
|
32
33
|
logger;
|
|
33
34
|
monitor;
|
|
@@ -62,7 +63,8 @@ export class P2PNetworkTest {
|
|
|
62
63
|
this.gasUtils = undefined;
|
|
63
64
|
this.logger = createLogger(`e2e:e2e_p2p:${testName}`);
|
|
64
65
|
// Set up the base account and node private keys for the initial network deployment
|
|
65
|
-
this.
|
|
66
|
+
this.baseAccountPrivateKey = `0x${getPrivateKeyFromIndex(0).toString('hex')}`;
|
|
67
|
+
this.baseAccount = privateKeyToAccount(this.baseAccountPrivateKey);
|
|
66
68
|
this.proposerPrivateKeys = generatePrivateKeys(PROPOSER_PRIVATE_KEYS_START_INDEX, numberOfNodes);
|
|
67
69
|
this.attesterPrivateKeys = generatePrivateKeys(ATTESTER_PRIVATE_KEYS_START_INDEX, numberOfNodes);
|
|
68
70
|
this.attesterPublicKeys = this.attesterPrivateKeys.map((privateKey)=>privateKeyToAccount(privateKey).address);
|
|
@@ -121,13 +123,39 @@ export class P2PNetworkTest {
|
|
|
121
123
|
this.logger.info(`Timestamp: ${timestamp.timestamp}`);
|
|
122
124
|
dateProvider.setTime(Number(timestamp.timestamp) * 1000);
|
|
123
125
|
}
|
|
124
|
-
async
|
|
126
|
+
async addBootstrapNode() {
|
|
125
127
|
await this.snapshotManager.snapshot('add-bootstrap-node', async ({ aztecNodeConfig })=>{
|
|
126
128
|
const telemetry = getEndToEndTestTelemetryClient(this.metricsPort);
|
|
127
129
|
this.bootstrapNode = await createBootstrapNodeFromPrivateKey(BOOTSTRAP_NODE_PRIVATE_KEY, this.bootNodePort, telemetry, aztecNodeConfig);
|
|
128
130
|
// Overwrite enr with updated info
|
|
129
131
|
this.bootstrapNodeEnr = this.bootstrapNode.getENR().encodeTxt();
|
|
130
132
|
});
|
|
133
|
+
}
|
|
134
|
+
getValidators() {
|
|
135
|
+
const validators = [];
|
|
136
|
+
const proposerEOAs = [];
|
|
137
|
+
for(let i = 0; i < this.numberOfNodes; i++){
|
|
138
|
+
const attester = privateKeyToAccount(this.attesterPrivateKeys[i]);
|
|
139
|
+
const proposerEOA = privateKeyToAccount(this.proposerPrivateKeys[i]);
|
|
140
|
+
proposerEOAs.push(proposerEOA.address);
|
|
141
|
+
const forwarder = getExpectedAddress(ForwarderAbi, ForwarderBytecode, [
|
|
142
|
+
proposerEOA.address
|
|
143
|
+
], proposerEOA.address).address;
|
|
144
|
+
validators.push({
|
|
145
|
+
attester: attester.address,
|
|
146
|
+
proposer: forwarder,
|
|
147
|
+
withdrawer: attester.address,
|
|
148
|
+
amount: l1ContractsConfig.minimumStake
|
|
149
|
+
});
|
|
150
|
+
this.logger.info(`Adding attester ${attester.address} proposer ${forwarder} as validator`);
|
|
151
|
+
}
|
|
152
|
+
return {
|
|
153
|
+
validators,
|
|
154
|
+
proposerEOAs
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
async applyBaseSnapshots() {
|
|
158
|
+
await this.addBootstrapNode();
|
|
131
159
|
await this.snapshotManager.snapshot('add-validators', async ({ deployL1ContractsValues, aztecNodeConfig, dateProvider })=>{
|
|
132
160
|
const rollup = getContract({
|
|
133
161
|
address: deployL1ContractsValues.l1ContractAddresses.rollupAddress.toString(),
|
|
@@ -153,25 +181,11 @@ export class P2PNetworkTest {
|
|
|
153
181
|
].map((txHash)=>deployL1ContractsValues.publicClient.waitForTransactionReceipt({
|
|
154
182
|
hash: txHash
|
|
155
183
|
})));
|
|
156
|
-
const validators =
|
|
157
|
-
for(let i = 0; i < this.numberOfNodes; i++){
|
|
158
|
-
const attester = privateKeyToAccount(this.attesterPrivateKeys[i]);
|
|
159
|
-
const proposerEOA = privateKeyToAccount(this.proposerPrivateKeys[i]);
|
|
160
|
-
const forwarder = getExpectedAddress(ForwarderAbi, ForwarderBytecode, [
|
|
161
|
-
proposerEOA.address
|
|
162
|
-
], proposerEOA.address).address;
|
|
163
|
-
validators.push({
|
|
164
|
-
attester: attester.address,
|
|
165
|
-
proposer: forwarder,
|
|
166
|
-
withdrawer: attester.address,
|
|
167
|
-
amount: l1ContractsConfig.minimumStake
|
|
168
|
-
});
|
|
169
|
-
this.logger.info(`Adding attester ${attester.address} proposer ${forwarder} as validator`);
|
|
170
|
-
}
|
|
184
|
+
const { validators } = this.getValidators();
|
|
171
185
|
this.validators = validators;
|
|
172
186
|
await deployL1ContractsValues.publicClient.waitForTransactionReceipt({
|
|
173
187
|
hash: await rollup.write.cheat__InitialiseValidatorSet([
|
|
174
|
-
validators
|
|
188
|
+
this.validators
|
|
175
189
|
])
|
|
176
190
|
});
|
|
177
191
|
const slotsInEpoch = await rollup.read.getEpochDuration();
|
package/dest/e2e_p2p/shared.d.ts
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
1
|
import type { InitialAccountData } from '@aztec/accounts/testing';
|
|
2
2
|
import type { AztecNodeService } from '@aztec/aztec-node';
|
|
3
|
-
import { type Logger, type SentTx } from '@aztec/aztec.js';
|
|
3
|
+
import { type Logger, ProvenTx, type SentTx } from '@aztec/aztec.js';
|
|
4
4
|
import type { SpamContract } from '@aztec/noir-contracts.js/Spam';
|
|
5
|
+
import { PXEService } from '@aztec/pxe/server';
|
|
5
6
|
import type { NodeContext } from '../fixtures/setup_p2p_test.js';
|
|
6
7
|
export declare const submitComplexTxsTo: (logger: Logger, spamContract: SpamContract, numTxs: number, opts?: {
|
|
7
8
|
callPublic?: boolean;
|
|
8
9
|
}) => Promise<SentTx[]>;
|
|
9
10
|
export declare const createPXEServiceAndSubmitTransactions: (logger: Logger, node: AztecNodeService, numTxs: number, fundedAccount: InitialAccountData) => Promise<NodeContext>;
|
|
11
|
+
export declare function createPXEServiceAndPrepareTransactions(logger: Logger, node: AztecNodeService, numTxs: number, fundedAccount: InitialAccountData): Promise<{
|
|
12
|
+
pxeService: PXEService;
|
|
13
|
+
txs: ProvenTx[];
|
|
14
|
+
node: AztecNodeService;
|
|
15
|
+
}>;
|
|
10
16
|
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/e2e_p2p/shared.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../../src/e2e_p2p/shared.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAClE,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAM,KAAK,MAAM,EAAE,QAAQ,EAAE,KAAK,MAAM,EAAiD,MAAM,iBAAiB,CAAC;AAExH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAC;AAElE,OAAO,EAAE,UAAU,EAAyD,MAAM,mBAAmB,CAAC;AAEtG,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,+BAA+B,CAAC;AAIjE,eAAO,MAAM,kBAAkB,WACrB,MAAM,gBACA,YAAY,UAClB,MAAM,SACR;IAAE,UAAU,CAAC,EAAE,OAAO,CAAA;CAAE,sBAwB/B,CAAC;AAGF,eAAO,MAAM,qCAAqC,WACxC,MAAM,QACR,gBAAgB,UACd,MAAM,iBACC,kBAAkB,KAChC,QAAQ,WAAW,CAgBrB,CAAC;AAEF,wBAAsB,sCAAsC,CAC1D,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,gBAAgB,EACtB,MAAM,EAAE,MAAM,EACd,aAAa,EAAE,kBAAkB,GAChC,OAAO,CAAC;IAAE,UAAU,EAAE,UAAU,CAAC;IAAC,GAAG,EAAE,QAAQ,EAAE,CAAC;IAAC,IAAI,EAAE,gBAAgB,CAAA;CAAE,CAAC,CAqB9E"}
|
package/dest/e2e_p2p/shared.js
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import { getSchnorrAccount } from '@aztec/accounts/schnorr';
|
|
2
|
-
import { TxStatus } from '@aztec/aztec.js';
|
|
2
|
+
import { Fr, TxStatus, getContractInstanceFromDeployParams } from '@aztec/aztec.js';
|
|
3
|
+
import { timesAsync } from '@aztec/foundation/collection';
|
|
4
|
+
import { TestContract, TestContractArtifact } from '@aztec/noir-contracts.js/Test';
|
|
3
5
|
import { createPXEService, getPXEServiceConfig as getRpcConfig } from '@aztec/pxe/server';
|
|
4
6
|
import { submitTxsTo } from '../shared/submit-transactions.js';
|
|
5
7
|
// submits a set of transactions to the provided Private eXecution Environment (PXE)
|
|
@@ -38,3 +40,30 @@ export const createPXEServiceAndSubmitTransactions = async (logger, node, numTxs
|
|
|
38
40
|
node
|
|
39
41
|
};
|
|
40
42
|
};
|
|
43
|
+
export async function createPXEServiceAndPrepareTransactions(logger, node, numTxs, fundedAccount) {
|
|
44
|
+
const rpcConfig = getRpcConfig();
|
|
45
|
+
rpcConfig.proverEnabled = false;
|
|
46
|
+
const pxe = await createPXEService(node, rpcConfig, true);
|
|
47
|
+
const account = await getSchnorrAccount(pxe, fundedAccount.secret, fundedAccount.signingKey, fundedAccount.salt);
|
|
48
|
+
await account.register();
|
|
49
|
+
const wallet = await account.getWallet();
|
|
50
|
+
const testContractInstance = await getContractInstanceFromDeployParams(TestContractArtifact, {});
|
|
51
|
+
await wallet.registerContract({
|
|
52
|
+
instance: testContractInstance,
|
|
53
|
+
artifact: TestContractArtifact
|
|
54
|
+
});
|
|
55
|
+
const contract = await TestContract.at(testContractInstance.address, wallet);
|
|
56
|
+
const txs = await timesAsync(numTxs, async ()=>{
|
|
57
|
+
const tx = await contract.methods.emit_nullifier(Fr.random()).prove({
|
|
58
|
+
skipPublicSimulation: true
|
|
59
|
+
});
|
|
60
|
+
const txHash = await tx.getTxHash();
|
|
61
|
+
logger.info(`Tx prepared with hash ${txHash}`);
|
|
62
|
+
return tx;
|
|
63
|
+
});
|
|
64
|
+
return {
|
|
65
|
+
txs,
|
|
66
|
+
pxeService: pxe,
|
|
67
|
+
node
|
|
68
|
+
};
|
|
69
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type AccountWallet, type AztecNode, type CompleteAddress, type Logger } from '@aztec/aztec.js';
|
|
2
|
-
import {
|
|
2
|
+
import { InvalidAccountContract } from '@aztec/noir-contracts.js/InvalidAccount';
|
|
3
3
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
4
4
|
import { type SubsystemsContext } from '../fixtures/snapshot_manager.js';
|
|
5
5
|
import { TokenSimulator } from '../simulators/token_simulator.js';
|
|
@@ -13,7 +13,7 @@ export declare class TokenContractTest {
|
|
|
13
13
|
accounts: CompleteAddress[];
|
|
14
14
|
asset: TokenContract;
|
|
15
15
|
tokenSim: TokenSimulator;
|
|
16
|
-
badAccount:
|
|
16
|
+
badAccount: InvalidAccountContract;
|
|
17
17
|
node: AztecNode;
|
|
18
18
|
constructor(testName: string);
|
|
19
19
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"token_contract_test.d.ts","sourceRoot":"","sources":["../../src/e2e_token_contract/token_contract_test.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,aAAa,EAAE,KAAK,SAAS,EAAE,KAAK,eAAe,EAAE,KAAK,MAAM,EAAgB,MA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