@aztec/end-to-end 3.0.0-nightly.20250916 → 3.0.0-nightly.20250918
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_cross_chain_messaging/cross_chain_messaging_test.d.ts +4 -2
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.d.ts.map +1 -1
- package/dest/e2e_cross_chain_messaging/cross_chain_messaging_test.js +12 -8
- package/dest/e2e_fees/fees_test.d.ts.map +1 -1
- package/dest/e2e_fees/fees_test.js +3 -2
- package/dest/e2e_l1_publisher/write_json.js +1 -1
- package/dest/e2e_p2p/inactivity_slash_test.d.ts +3 -0
- package/dest/e2e_p2p/inactivity_slash_test.d.ts.map +1 -1
- package/dest/e2e_p2p/inactivity_slash_test.js +18 -5
- package/dest/fixtures/utils.js +1 -1
- package/package.json +37 -37
- package/src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts +14 -8
- package/src/e2e_fees/fees_test.ts +3 -2
- package/src/e2e_l1_publisher/write_json.ts +1 -1
- package/src/e2e_p2p/inactivity_slash_test.ts +27 -8
- package/src/fixtures/utils.ts +1 -1
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import type { AztecNodeConfig } from '@aztec/aztec-node';
|
|
2
2
|
import { AztecAddress, type AztecNode, EthAddress, type Logger, type PXE } from '@aztec/aztec.js';
|
|
3
3
|
import { CheatCodes } from '@aztec/aztec/testing';
|
|
4
|
-
import { type DeployL1ContractsReturnType, type ExtendedViemWalletClient } from '@aztec/ethereum';
|
|
4
|
+
import { type DeployL1ContractsArgs, type DeployL1ContractsReturnType, type ExtendedViemWalletClient } from '@aztec/ethereum';
|
|
5
5
|
import { TokenContract } from '@aztec/noir-contracts.js/Token';
|
|
6
6
|
import { TokenBridgeContract } from '@aztec/noir-contracts.js/TokenBridge';
|
|
7
7
|
import type { AztecNodeAdmin } from '@aztec/stdlib/interfaces/client';
|
|
8
8
|
import type { TestWallet } from '@aztec/test-wallet';
|
|
9
9
|
import { type SubsystemsContext } from '../fixtures/snapshot_manager.js';
|
|
10
|
+
import type { SetupOptions } from '../fixtures/utils.js';
|
|
10
11
|
import { CrossChainTestHarness } from '../shared/cross_chain_test_harness.js';
|
|
11
12
|
export declare class CrossChainMessagingTest {
|
|
12
13
|
private snapshotManager;
|
|
@@ -15,6 +16,7 @@ export declare class CrossChainMessagingTest {
|
|
|
15
16
|
pxe: PXE;
|
|
16
17
|
aztecNodeConfig: AztecNodeConfig;
|
|
17
18
|
aztecNodeAdmin: AztecNodeAdmin;
|
|
19
|
+
ctx: SubsystemsContext;
|
|
18
20
|
l1Client: ExtendedViemWalletClient | undefined;
|
|
19
21
|
wallet: TestWallet;
|
|
20
22
|
ownerAddress: AztecAddress;
|
|
@@ -28,7 +30,7 @@ export declare class CrossChainMessagingTest {
|
|
|
28
30
|
outbox: any;
|
|
29
31
|
cheatCodes: CheatCodes;
|
|
30
32
|
deployL1ContractsValues: DeployL1ContractsReturnType;
|
|
31
|
-
constructor(testName: string);
|
|
33
|
+
constructor(testName: string, opts?: SetupOptions, deployL1ContractsArgs?: Partial<DeployL1ContractsArgs>);
|
|
32
34
|
assumeProven(): Promise<void>;
|
|
33
35
|
setup(): Promise<void>;
|
|
34
36
|
snapshot: <T>(name: string, apply: (context: SubsystemsContext) => Promise<T>, restore?: (snapshotData: T, context: SubsystemsContext) => Promise<void>) => Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cross_chain_messaging_test.d.ts","sourceRoot":"","sources":["../../src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,KAAK,SAAS,EAAE,UAAU,EAAE,KAAK,MAAM,EAAE,KAAK,GAAG,EAAgB,MAAM,iBAAiB,CAAC;AAChH,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EACL,KAAK,2BAA2B,EAChC,KAAK,wBAAwB,EAG9B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAKrD,OAAO,EAEL,KAAK,iBAAiB,EAIvB,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAI9E,qBAAa,uBAAuB;IAClC,OAAO,CAAC,eAAe,CAAmB;IAC1C,MAAM,EAAE,MAAM,CAAC;IACf,SAAS,EAAG,SAAS,CAAC;IACtB,GAAG,EAAG,GAAG,CAAC;IACV,eAAe,EAAG,eAAe,CAAC;IAClC,cAAc,EAAG,cAAc,CAAC;
|
|
1
|
+
{"version":3,"file":"cross_chain_messaging_test.d.ts","sourceRoot":"","sources":["../../src/e2e_cross_chain_messaging/cross_chain_messaging_test.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,KAAK,SAAS,EAAE,UAAU,EAAE,KAAK,MAAM,EAAE,KAAK,GAAG,EAAgB,MAAM,iBAAiB,CAAC;AAChH,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EAChC,KAAK,wBAAwB,EAG9B,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,aAAa,EAAE,MAAM,gCAAgC,CAAC;AAC/D,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,iCAAiC,CAAC;AACtE,OAA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AI,CAAC,CAAwD;IAElE,QAAQ;IAIR,kBAAkB;CA0FzB"}
|
|
@@ -16,6 +16,7 @@ export class CrossChainMessagingTest {
|
|
|
16
16
|
pxe;
|
|
17
17
|
aztecNodeConfig;
|
|
18
18
|
aztecNodeAdmin;
|
|
19
|
+
ctx;
|
|
19
20
|
l1Client;
|
|
20
21
|
wallet;
|
|
21
22
|
ownerAddress;
|
|
@@ -29,21 +30,24 @@ export class CrossChainMessagingTest {
|
|
|
29
30
|
outbox;
|
|
30
31
|
cheatCodes;
|
|
31
32
|
deployL1ContractsValues;
|
|
32
|
-
constructor(testName){
|
|
33
|
+
constructor(testName, opts = {}, deployL1ContractsArgs = {}){
|
|
33
34
|
this.logger = createLogger(`e2e:e2e_cross_chain_messaging:${testName}`);
|
|
34
|
-
this.snapshotManager = createSnapshotManager(`e2e_cross_chain_messaging/${testName}`, dataPath
|
|
35
|
+
this.snapshotManager = createSnapshotManager(`e2e_cross_chain_messaging/${testName}`, dataPath, opts, {
|
|
36
|
+
initialValidators: [],
|
|
37
|
+
...deployL1ContractsArgs
|
|
38
|
+
});
|
|
35
39
|
}
|
|
36
40
|
async assumeProven() {
|
|
37
41
|
await this.cheatCodes.rollup.markAsProven();
|
|
38
42
|
}
|
|
39
43
|
async setup() {
|
|
40
|
-
|
|
41
|
-
this.aztecNode = aztecNode;
|
|
42
|
-
this.pxe = pxe;
|
|
43
|
-
this.aztecNodeConfig = aztecNodeConfig;
|
|
44
|
+
this.ctx = await this.snapshotManager.setup();
|
|
45
|
+
this.aztecNode = this.ctx.aztecNode;
|
|
46
|
+
this.pxe = this.ctx.pxe;
|
|
47
|
+
this.aztecNodeConfig = this.ctx.aztecNodeConfig;
|
|
44
48
|
this.cheatCodes = await CheatCodes.create(this.aztecNodeConfig.l1RpcUrls, this.pxe);
|
|
45
|
-
this.deployL1ContractsValues = deployL1ContractsValues;
|
|
46
|
-
this.aztecNodeAdmin = aztecNode;
|
|
49
|
+
this.deployL1ContractsValues = this.ctx.deployL1ContractsValues;
|
|
50
|
+
this.aztecNodeAdmin = this.ctx.aztecNode;
|
|
47
51
|
}
|
|
48
52
|
snapshot = (name, apply, restore = ()=>Promise.resolve())=>this.snapshotManager.snapshot(name, apply, restore);
|
|
49
53
|
async teardown() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fees_test.d.ts","sourceRoot":"","sources":["../../src/e2e_fees/fees_test.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,SAAS,EAAE,KAAK,MAAM,EAAE,KAAK,GAAG,EAAuB,MAAM,iBAAiB,CAAC;AAChH,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,EAAE,KAAK,qBAAqB,EAAE,cAAc,EAA0B,MAAM,iBAAiB,CAAC;AACrG,OAAO,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,0CAA0C,CAAC;AACnF,OAAO,EAAE,WAAW,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAC;AAC7E,OAAO,EAAE,aAAa,IAAI,UAAU,EAAE,MAAM,gCAAgC,CAAC;AAC7E,OAAO,EAAE,eAAe,EAAE,MAAM,uCAAuC,CAAC;AAGxE,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC;AAChD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAKhD,OAAO,EAEL,KAAK,iBAAiB,EAGvB,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EACL,KAAK,UAAU,EACf,KAAK,YAAY,EAIlB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAuC,KAAK,sBAAsB,EAAE,MAAM,sCAAsC,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YAAY,GAAG,qBAAqB,CAAM;IAgB5D,KAAK;IASL,QAAQ;IAKd,oBAAoB,CAAC,CAAC,EAAE,OAAO;IAIzB,kBAAkB;IAOlB,eAAe;;;;IAef,qBAAqB,CAAC,MAAM,EAAE,YAAY,EAAE,SAAS,EAAE,YAAY;IASzE,sFAAsF;IAChF,kBAAkB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,YAAY;IAajD,kBAAkB;IAOzB,4BAA4B;IAkC5B,iCAAiC;IAMjC,0BAA0B;IA4B1B,8BAA8B;IA6BvB,qBAAqB;IAoErB,8BAA8B;IAoB9B,yBAAyB;IAczB,gCAAgC;CAS9C"}
|
|
@@ -102,9 +102,10 @@ const { E2E_DATA_PATH: dataPath } = process.env;
|
|
|
102
102
|
}
|
|
103
103
|
async getBlockRewards() {
|
|
104
104
|
const blockReward = await this.rollupContract.getBlockReward();
|
|
105
|
-
const
|
|
105
|
+
const rewardConfig = await this.rollupContract.getRewardConfig();
|
|
106
|
+
const balance = await this.feeJuiceBridgeTestHarness.getL1FeeJuiceBalance(EthAddress.fromString(rewardConfig.rewardDistributor));
|
|
106
107
|
const toDistribute = balance > blockReward ? blockReward : balance;
|
|
107
|
-
const sequencerBlockRewards = toDistribute /
|
|
108
|
+
const sequencerBlockRewards = toDistribute * BigInt(rewardConfig.sequencerBps) / 10000n;
|
|
108
109
|
const proverBlockRewards = toDistribute - sequencerBlockRewards;
|
|
109
110
|
return {
|
|
110
111
|
sequencerBlockRewards,
|
|
@@ -48,7 +48,7 @@ const AZTEC_GENERATE_TEST_DATA = !!process.env.AZTEC_GENERATE_TEST_DATA;
|
|
|
48
48
|
},
|
|
49
49
|
totalManaUsed: block.header.totalManaUsed.toNumber()
|
|
50
50
|
},
|
|
51
|
-
headerHash: asHex(block.
|
|
51
|
+
headerHash: asHex(block.getCheckpointHeader().hash()),
|
|
52
52
|
numTxs: block.body.txEffects.length
|
|
53
53
|
}
|
|
54
54
|
};
|
|
@@ -12,12 +12,15 @@ export declare class P2PInactivityTest {
|
|
|
12
12
|
offlineValidators: EthAddress[];
|
|
13
13
|
private dataDir;
|
|
14
14
|
private inactiveNodeCount;
|
|
15
|
+
private keepInitialNode;
|
|
15
16
|
constructor(test: P2PNetworkTest, opts: {
|
|
16
17
|
inactiveNodeCount: number;
|
|
18
|
+
keepInitialNode?: boolean;
|
|
17
19
|
});
|
|
18
20
|
static create(testName: string, opts: {
|
|
19
21
|
slashInactivityConsecutiveEpochThreshold: number;
|
|
20
22
|
inactiveNodeCount: number;
|
|
23
|
+
keepInitialNode?: boolean;
|
|
21
24
|
}): Promise<P2PInactivityTest>;
|
|
22
25
|
setup(): Promise<this>;
|
|
23
26
|
teardown(): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"inactivity_slash_test.d.ts","sourceRoot":"","sources":["../../src/e2e_p2p/inactivity_slash_test.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGjD,OAAO,eAAe,CAAC;AAKvB,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"inactivity_slash_test.d.ts","sourceRoot":"","sources":["../../src/e2e_p2p/inactivity_slash_test.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC1D,OAAO,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAC7C,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGjD,OAAO,eAAe,CAAC;AAKvB,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAiBlD,qBAAa,iBAAiB;aAaV,IAAI,EAAE,cAAc;IAZ/B,KAAK,EAAG,gBAAgB,EAAE,CAAC;IAC3B,WAAW,EAAG,gBAAgB,EAAE,CAAC;IACjC,aAAa,EAAG,gBAAgB,EAAE,CAAC;IAEnC,MAAM,EAAG,cAAc,CAAC;IACxB,iBAAiB,EAAG,UAAU,EAAE,CAAC;IAExC,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,iBAAiB,CAAS;IAClC,OAAO,CAAC,eAAe,CAAU;gBAGf,IAAI,EAAE,cAAc,EACpC,IAAI,EAAE;QAAE,iBAAiB,EAAE,MAAM,CAAC;QAAC,eAAe,CAAC,EAAE,OAAO,CAAA;KAAE;WAOnD,MAAM,CACjB,QAAQ,EAAE,MAAM,EAChB,IAAI,EAAE;QAAE,wCAAwC,EAAE,MAAM,CAAC;QAAC,iBAAiB,EAAE,MAAM,CAAC;QAAC,eAAe,CAAC,EAAE,OAAO,CAAA;KAAE;IAgCrG,KAAK;IAwEL,QAAQ;IAQrB,IAAW,GAAG,gEAEb;IAED,IAAW,MAAM,qCAEhB;IAED,IAAW,cAAc,WAExB;CACF"}
|
|
@@ -15,6 +15,8 @@ const ETHEREUM_SLOT_DURATION = 4;
|
|
|
15
15
|
const AZTEC_SLOT_DURATION = 8;
|
|
16
16
|
const SLASHING_UNIT = BigInt(1e18);
|
|
17
17
|
const SLASHING_AMOUNT = SLASHING_UNIT * 3n;
|
|
18
|
+
// How many epochs it may take to set everything up, so we dont slash during this period
|
|
19
|
+
const SETUP_EPOCH_DURATION = 5;
|
|
18
20
|
export class P2PInactivityTest {
|
|
19
21
|
test;
|
|
20
22
|
nodes;
|
|
@@ -24,10 +26,12 @@ export class P2PInactivityTest {
|
|
|
24
26
|
offlineValidators;
|
|
25
27
|
dataDir;
|
|
26
28
|
inactiveNodeCount;
|
|
29
|
+
keepInitialNode;
|
|
27
30
|
constructor(test, opts){
|
|
28
31
|
this.test = test;
|
|
29
32
|
this.dataDir = fs.mkdtempSync(path.join(os.tmpdir(), test.testName));
|
|
30
33
|
this.inactiveNodeCount = opts.inactiveNodeCount;
|
|
34
|
+
this.keepInitialNode = opts.keepInitialNode ?? false;
|
|
31
35
|
}
|
|
32
36
|
static async create(testName, opts) {
|
|
33
37
|
const test = await P2PNetworkTest.create({
|
|
@@ -51,8 +55,8 @@ export class P2PInactivityTest {
|
|
|
51
55
|
sentinelEnabled: true,
|
|
52
56
|
slashingQuorum: SLASHING_QUORUM,
|
|
53
57
|
slashingRoundSizeInEpochs: SLASHING_ROUND_SIZE_IN_EPOCHS,
|
|
54
|
-
slashInactivityTargetPercentage: 0.
|
|
55
|
-
slashGracePeriodL2Slots: EPOCH_DURATION,
|
|
58
|
+
slashInactivityTargetPercentage: 0.8,
|
|
59
|
+
slashGracePeriodL2Slots: SETUP_EPOCH_DURATION * EPOCH_DURATION,
|
|
56
60
|
slashAmountSmall: SLASHING_UNIT,
|
|
57
61
|
slashAmountMedium: SLASHING_UNIT * 2n,
|
|
58
62
|
slashAmountLarge: SLASHING_UNIT * 3n,
|
|
@@ -75,10 +79,11 @@ export class P2PInactivityTest {
|
|
|
75
79
|
expect(activationThreshold - SLASHING_AMOUNT).toBeLessThan(biggestEjection);
|
|
76
80
|
this.test.ctx.aztecNodeConfig.slashInactivityPenalty = SLASHING_AMOUNT;
|
|
77
81
|
this.rollup = rollup;
|
|
78
|
-
|
|
79
|
-
|
|
82
|
+
if (!this.keepInitialNode) {
|
|
83
|
+
await this.test.ctx.aztecNode.stop();
|
|
84
|
+
}
|
|
80
85
|
// Create all active nodes
|
|
81
|
-
this.activeNodes = await createNodes(this.test.ctx.aztecNodeConfig, this.test.ctx.dateProvider, this.test.bootstrapNodeEnr, NUM_NODES - this.inactiveNodeCount, BOOT_NODE_UDP_PORT, this.test.prefilledPublicData, this.dataDir);
|
|
86
|
+
this.activeNodes = await createNodes(this.test.ctx.aztecNodeConfig, this.test.ctx.dateProvider, this.test.bootstrapNodeEnr, NUM_NODES - this.inactiveNodeCount - Number(this.keepInitialNode), BOOT_NODE_UDP_PORT, this.test.prefilledPublicData, this.dataDir, undefined, Number(this.keepInitialNode));
|
|
82
87
|
// And the ones with an initially disabled sequencer
|
|
83
88
|
const inactiveConfig = {
|
|
84
89
|
...this.test.ctx.aztecNodeConfig,
|
|
@@ -86,14 +91,22 @@ export class P2PInactivityTest {
|
|
|
86
91
|
};
|
|
87
92
|
this.inactiveNodes = await createNodes(inactiveConfig, this.test.ctx.dateProvider, this.test.bootstrapNodeEnr, this.inactiveNodeCount, BOOT_NODE_UDP_PORT, this.test.prefilledPublicData, this.dataDir, undefined, NUM_NODES - this.inactiveNodeCount);
|
|
88
93
|
this.nodes = [
|
|
94
|
+
...this.keepInitialNode ? [
|
|
95
|
+
this.test.ctx.aztecNode
|
|
96
|
+
] : [],
|
|
89
97
|
...this.activeNodes,
|
|
90
98
|
...this.inactiveNodes
|
|
91
99
|
];
|
|
100
|
+
if (this.nodes.length !== NUM_NODES) {
|
|
101
|
+
throw new Error(`Expected ${NUM_NODES} nodes but got ${this.nodes.length}`);
|
|
102
|
+
}
|
|
92
103
|
this.offlineValidators = this.test.validators.slice(this.test.validators.length - this.inactiveNodeCount).map((a)=>a.attester);
|
|
93
104
|
this.test.logger.warn(`Setup complete. Offline validators are ${this.offlineValidators.join(', ')}.`, {
|
|
94
105
|
validators: this.test.validators,
|
|
95
106
|
offlineValidators: this.offlineValidators
|
|
96
107
|
});
|
|
108
|
+
this.test.logger.warn(`Advancing to epoch ${SETUP_EPOCH_DURATION + 1} to start slashing`);
|
|
109
|
+
await this.test.ctx.cheatCodes.rollup.advanceToEpoch(SETUP_EPOCH_DURATION + 1);
|
|
97
110
|
return this;
|
|
98
111
|
}
|
|
99
112
|
async teardown() {
|
package/dest/fixtures/utils.js
CHANGED
|
@@ -332,7 +332,7 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
332
332
|
}, telemetry);
|
|
333
333
|
await blobSink.start();
|
|
334
334
|
config.blobSinkUrl = `http://localhost:${blobSinkPort}`;
|
|
335
|
-
logger.verbose('Creating and synching an aztec node
|
|
335
|
+
logger.verbose('Creating and synching an aztec node', config);
|
|
336
336
|
const acvmConfig = await getACVMConfig(logger);
|
|
337
337
|
if (acvmConfig) {
|
|
338
338
|
config.acvmWorkingDirectory = acvmConfig.acvmWorkingDirectory;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/end-to-end",
|
|
3
|
-
"version": "3.0.0-nightly.
|
|
3
|
+
"version": "3.0.0-nightly.20250918",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": "./dest/index.js",
|
|
6
6
|
"inherits": [
|
|
@@ -25,42 +25,42 @@
|
|
|
25
25
|
"formatting": "run -T prettier --check ./src && run -T eslint ./src"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@aztec/accounts": "3.0.0-nightly.
|
|
29
|
-
"@aztec/archiver": "3.0.0-nightly.
|
|
30
|
-
"@aztec/aztec": "3.0.0-nightly.
|
|
31
|
-
"@aztec/aztec-node": "3.0.0-nightly.
|
|
32
|
-
"@aztec/aztec.js": "3.0.0-nightly.
|
|
33
|
-
"@aztec/bb-prover": "3.0.0-nightly.
|
|
34
|
-
"@aztec/blob-lib": "3.0.0-nightly.
|
|
35
|
-
"@aztec/blob-sink": "3.0.0-nightly.
|
|
36
|
-
"@aztec/bot": "3.0.0-nightly.
|
|
37
|
-
"@aztec/cli": "3.0.0-nightly.
|
|
38
|
-
"@aztec/constants": "3.0.0-nightly.
|
|
39
|
-
"@aztec/entrypoints": "3.0.0-nightly.
|
|
40
|
-
"@aztec/epoch-cache": "3.0.0-nightly.
|
|
41
|
-
"@aztec/ethereum": "3.0.0-nightly.
|
|
42
|
-
"@aztec/foundation": "3.0.0-nightly.
|
|
43
|
-
"@aztec/kv-store": "3.0.0-nightly.
|
|
44
|
-
"@aztec/l1-artifacts": "3.0.0-nightly.
|
|
45
|
-
"@aztec/merkle-tree": "3.0.0-nightly.
|
|
46
|
-
"@aztec/node-keystore": "3.0.0-nightly.
|
|
47
|
-
"@aztec/noir-contracts.js": "3.0.0-nightly.
|
|
48
|
-
"@aztec/noir-noirc_abi": "3.0.0-nightly.
|
|
49
|
-
"@aztec/noir-protocol-circuits-types": "3.0.0-nightly.
|
|
50
|
-
"@aztec/noir-test-contracts.js": "3.0.0-nightly.
|
|
51
|
-
"@aztec/p2p": "3.0.0-nightly.
|
|
52
|
-
"@aztec/protocol-contracts": "3.0.0-nightly.
|
|
53
|
-
"@aztec/prover-client": "3.0.0-nightly.
|
|
54
|
-
"@aztec/prover-node": "3.0.0-nightly.
|
|
55
|
-
"@aztec/pxe": "3.0.0-nightly.
|
|
56
|
-
"@aztec/sequencer-client": "3.0.0-nightly.
|
|
57
|
-
"@aztec/simulator": "3.0.0-nightly.
|
|
58
|
-
"@aztec/slasher": "3.0.0-nightly.
|
|
59
|
-
"@aztec/stdlib": "3.0.0-nightly.
|
|
60
|
-
"@aztec/telemetry-client": "3.0.0-nightly.
|
|
61
|
-
"@aztec/test-wallet": "3.0.0-nightly.
|
|
62
|
-
"@aztec/validator-client": "3.0.0-nightly.
|
|
63
|
-
"@aztec/world-state": "3.0.0-nightly.
|
|
28
|
+
"@aztec/accounts": "3.0.0-nightly.20250918",
|
|
29
|
+
"@aztec/archiver": "3.0.0-nightly.20250918",
|
|
30
|
+
"@aztec/aztec": "3.0.0-nightly.20250918",
|
|
31
|
+
"@aztec/aztec-node": "3.0.0-nightly.20250918",
|
|
32
|
+
"@aztec/aztec.js": "3.0.0-nightly.20250918",
|
|
33
|
+
"@aztec/bb-prover": "3.0.0-nightly.20250918",
|
|
34
|
+
"@aztec/blob-lib": "3.0.0-nightly.20250918",
|
|
35
|
+
"@aztec/blob-sink": "3.0.0-nightly.20250918",
|
|
36
|
+
"@aztec/bot": "3.0.0-nightly.20250918",
|
|
37
|
+
"@aztec/cli": "3.0.0-nightly.20250918",
|
|
38
|
+
"@aztec/constants": "3.0.0-nightly.20250918",
|
|
39
|
+
"@aztec/entrypoints": "3.0.0-nightly.20250918",
|
|
40
|
+
"@aztec/epoch-cache": "3.0.0-nightly.20250918",
|
|
41
|
+
"@aztec/ethereum": "3.0.0-nightly.20250918",
|
|
42
|
+
"@aztec/foundation": "3.0.0-nightly.20250918",
|
|
43
|
+
"@aztec/kv-store": "3.0.0-nightly.20250918",
|
|
44
|
+
"@aztec/l1-artifacts": "3.0.0-nightly.20250918",
|
|
45
|
+
"@aztec/merkle-tree": "3.0.0-nightly.20250918",
|
|
46
|
+
"@aztec/node-keystore": "3.0.0-nightly.20250918",
|
|
47
|
+
"@aztec/noir-contracts.js": "3.0.0-nightly.20250918",
|
|
48
|
+
"@aztec/noir-noirc_abi": "3.0.0-nightly.20250918",
|
|
49
|
+
"@aztec/noir-protocol-circuits-types": "3.0.0-nightly.20250918",
|
|
50
|
+
"@aztec/noir-test-contracts.js": "3.0.0-nightly.20250918",
|
|
51
|
+
"@aztec/p2p": "3.0.0-nightly.20250918",
|
|
52
|
+
"@aztec/protocol-contracts": "3.0.0-nightly.20250918",
|
|
53
|
+
"@aztec/prover-client": "3.0.0-nightly.20250918",
|
|
54
|
+
"@aztec/prover-node": "3.0.0-nightly.20250918",
|
|
55
|
+
"@aztec/pxe": "3.0.0-nightly.20250918",
|
|
56
|
+
"@aztec/sequencer-client": "3.0.0-nightly.20250918",
|
|
57
|
+
"@aztec/simulator": "3.0.0-nightly.20250918",
|
|
58
|
+
"@aztec/slasher": "3.0.0-nightly.20250918",
|
|
59
|
+
"@aztec/stdlib": "3.0.0-nightly.20250918",
|
|
60
|
+
"@aztec/telemetry-client": "3.0.0-nightly.20250918",
|
|
61
|
+
"@aztec/test-wallet": "3.0.0-nightly.20250918",
|
|
62
|
+
"@aztec/validator-client": "3.0.0-nightly.20250918",
|
|
63
|
+
"@aztec/world-state": "3.0.0-nightly.20250918",
|
|
64
64
|
"@iarna/toml": "^2.2.5",
|
|
65
65
|
"@jest/globals": "^30.0.0",
|
|
66
66
|
"@noble/curves": "=1.0.0",
|
|
@@ -2,6 +2,7 @@ import type { AztecNodeConfig } from '@aztec/aztec-node';
|
|
|
2
2
|
import { AztecAddress, type AztecNode, EthAddress, type Logger, type PXE, createLogger } from '@aztec/aztec.js';
|
|
3
3
|
import { CheatCodes } from '@aztec/aztec/testing';
|
|
4
4
|
import {
|
|
5
|
+
type DeployL1ContractsArgs,
|
|
5
6
|
type DeployL1ContractsReturnType,
|
|
6
7
|
type ExtendedViemWalletClient,
|
|
7
8
|
createExtendedL1Client,
|
|
@@ -23,6 +24,7 @@ import {
|
|
|
23
24
|
deployAccounts,
|
|
24
25
|
publicDeployAccounts,
|
|
25
26
|
} from '../fixtures/snapshot_manager.js';
|
|
27
|
+
import type { SetupOptions } from '../fixtures/utils.js';
|
|
26
28
|
import { CrossChainTestHarness } from '../shared/cross_chain_test_harness.js';
|
|
27
29
|
|
|
28
30
|
const { E2E_DATA_PATH: dataPath } = process.env;
|
|
@@ -34,6 +36,7 @@ export class CrossChainMessagingTest {
|
|
|
34
36
|
pxe!: PXE;
|
|
35
37
|
aztecNodeConfig!: AztecNodeConfig;
|
|
36
38
|
aztecNodeAdmin!: AztecNodeAdmin;
|
|
39
|
+
ctx!: SubsystemsContext;
|
|
37
40
|
|
|
38
41
|
l1Client!: ExtendedViemWalletClient | undefined;
|
|
39
42
|
|
|
@@ -52,9 +55,12 @@ export class CrossChainMessagingTest {
|
|
|
52
55
|
|
|
53
56
|
deployL1ContractsValues!: DeployL1ContractsReturnType;
|
|
54
57
|
|
|
55
|
-
constructor(testName: string) {
|
|
58
|
+
constructor(testName: string, opts: SetupOptions = {}, deployL1ContractsArgs: Partial<DeployL1ContractsArgs> = {}) {
|
|
56
59
|
this.logger = createLogger(`e2e:e2e_cross_chain_messaging:${testName}`);
|
|
57
|
-
this.snapshotManager = createSnapshotManager(`e2e_cross_chain_messaging/${testName}`, dataPath
|
|
60
|
+
this.snapshotManager = createSnapshotManager(`e2e_cross_chain_messaging/${testName}`, dataPath, opts, {
|
|
61
|
+
initialValidators: [],
|
|
62
|
+
...deployL1ContractsArgs,
|
|
63
|
+
});
|
|
58
64
|
}
|
|
59
65
|
|
|
60
66
|
async assumeProven() {
|
|
@@ -62,13 +68,13 @@ export class CrossChainMessagingTest {
|
|
|
62
68
|
}
|
|
63
69
|
|
|
64
70
|
async setup() {
|
|
65
|
-
|
|
66
|
-
this.aztecNode = aztecNode;
|
|
67
|
-
this.pxe = pxe;
|
|
68
|
-
this.aztecNodeConfig = aztecNodeConfig;
|
|
71
|
+
this.ctx = await this.snapshotManager.setup();
|
|
72
|
+
this.aztecNode = this.ctx.aztecNode;
|
|
73
|
+
this.pxe = this.ctx.pxe;
|
|
74
|
+
this.aztecNodeConfig = this.ctx.aztecNodeConfig;
|
|
69
75
|
this.cheatCodes = await CheatCodes.create(this.aztecNodeConfig.l1RpcUrls, this.pxe);
|
|
70
|
-
this.deployL1ContractsValues = deployL1ContractsValues;
|
|
71
|
-
this.aztecNodeAdmin = aztecNode;
|
|
76
|
+
this.deployL1ContractsValues = this.ctx.deployL1ContractsValues;
|
|
77
|
+
this.aztecNodeAdmin = this.ctx.aztecNode;
|
|
72
78
|
}
|
|
73
79
|
|
|
74
80
|
snapshot = <T>(
|
|
@@ -136,13 +136,14 @@ export class FeesTest {
|
|
|
136
136
|
|
|
137
137
|
async getBlockRewards() {
|
|
138
138
|
const blockReward = await this.rollupContract.getBlockReward();
|
|
139
|
+
const rewardConfig = await this.rollupContract.getRewardConfig();
|
|
139
140
|
|
|
140
141
|
const balance = await this.feeJuiceBridgeTestHarness.getL1FeeJuiceBalance(
|
|
141
|
-
|
|
142
|
+
EthAddress.fromString(rewardConfig.rewardDistributor),
|
|
142
143
|
);
|
|
143
144
|
|
|
144
145
|
const toDistribute = balance > blockReward ? blockReward : balance;
|
|
145
|
-
const sequencerBlockRewards = toDistribute /
|
|
146
|
+
const sequencerBlockRewards = (toDistribute * BigInt(rewardConfig.sequencerBps)) / 10000n;
|
|
146
147
|
const proverBlockRewards = toDistribute - sequencerBlockRewards;
|
|
147
148
|
|
|
148
149
|
return { sequencerBlockRewards, proverBlockRewards };
|
|
@@ -64,7 +64,7 @@ export async function writeJson(
|
|
|
64
64
|
},
|
|
65
65
|
totalManaUsed: block.header.totalManaUsed.toNumber(),
|
|
66
66
|
},
|
|
67
|
-
headerHash: asHex(block.
|
|
67
|
+
headerHash: asHex(block.getCheckpointHeader().hash()),
|
|
68
68
|
numTxs: block.body.txEffects.length,
|
|
69
69
|
},
|
|
70
70
|
};
|
|
@@ -22,6 +22,9 @@ const AZTEC_SLOT_DURATION = 8;
|
|
|
22
22
|
const SLASHING_UNIT = BigInt(1e18);
|
|
23
23
|
const SLASHING_AMOUNT = SLASHING_UNIT * 3n;
|
|
24
24
|
|
|
25
|
+
// How many epochs it may take to set everything up, so we dont slash during this period
|
|
26
|
+
const SETUP_EPOCH_DURATION = 5;
|
|
27
|
+
|
|
25
28
|
export class P2PInactivityTest {
|
|
26
29
|
public nodes!: AztecNodeService[];
|
|
27
30
|
public activeNodes!: AztecNodeService[];
|
|
@@ -32,18 +35,20 @@ export class P2PInactivityTest {
|
|
|
32
35
|
|
|
33
36
|
private dataDir: string;
|
|
34
37
|
private inactiveNodeCount: number;
|
|
38
|
+
private keepInitialNode: boolean;
|
|
35
39
|
|
|
36
40
|
constructor(
|
|
37
41
|
public readonly test: P2PNetworkTest,
|
|
38
|
-
opts: { inactiveNodeCount: number },
|
|
42
|
+
opts: { inactiveNodeCount: number; keepInitialNode?: boolean },
|
|
39
43
|
) {
|
|
40
44
|
this.dataDir = fs.mkdtempSync(path.join(os.tmpdir(), test.testName));
|
|
41
45
|
this.inactiveNodeCount = opts.inactiveNodeCount;
|
|
46
|
+
this.keepInitialNode = opts.keepInitialNode ?? false;
|
|
42
47
|
}
|
|
43
48
|
|
|
44
49
|
static async create(
|
|
45
50
|
testName: string,
|
|
46
|
-
opts: { slashInactivityConsecutiveEpochThreshold: number; inactiveNodeCount: number },
|
|
51
|
+
opts: { slashInactivityConsecutiveEpochThreshold: number; inactiveNodeCount: number; keepInitialNode?: boolean },
|
|
47
52
|
) {
|
|
48
53
|
const test = await P2PNetworkTest.create({
|
|
49
54
|
testName,
|
|
@@ -64,8 +69,8 @@ export class P2PInactivityTest {
|
|
|
64
69
|
sentinelEnabled: true,
|
|
65
70
|
slashingQuorum: SLASHING_QUORUM,
|
|
66
71
|
slashingRoundSizeInEpochs: SLASHING_ROUND_SIZE_IN_EPOCHS,
|
|
67
|
-
slashInactivityTargetPercentage: 0.
|
|
68
|
-
slashGracePeriodL2Slots: EPOCH_DURATION, // do not slash during
|
|
72
|
+
slashInactivityTargetPercentage: 0.8,
|
|
73
|
+
slashGracePeriodL2Slots: SETUP_EPOCH_DURATION * EPOCH_DURATION, // do not slash during setup
|
|
69
74
|
slashAmountSmall: SLASHING_UNIT,
|
|
70
75
|
slashAmountMedium: SLASHING_UNIT * 2n,
|
|
71
76
|
slashAmountLarge: SLASHING_UNIT * 3n,
|
|
@@ -91,18 +96,21 @@ export class P2PInactivityTest {
|
|
|
91
96
|
this.test.ctx.aztecNodeConfig.slashInactivityPenalty = SLASHING_AMOUNT;
|
|
92
97
|
this.rollup = rollup;
|
|
93
98
|
|
|
94
|
-
|
|
95
|
-
|
|
99
|
+
if (!this.keepInitialNode) {
|
|
100
|
+
await this.test.ctx.aztecNode.stop();
|
|
101
|
+
}
|
|
96
102
|
|
|
97
103
|
// Create all active nodes
|
|
98
104
|
this.activeNodes = await createNodes(
|
|
99
105
|
this.test.ctx.aztecNodeConfig,
|
|
100
106
|
this.test.ctx.dateProvider,
|
|
101
107
|
this.test.bootstrapNodeEnr,
|
|
102
|
-
NUM_NODES - this.inactiveNodeCount,
|
|
108
|
+
NUM_NODES - this.inactiveNodeCount - Number(this.keepInitialNode),
|
|
103
109
|
BOOT_NODE_UDP_PORT,
|
|
104
110
|
this.test.prefilledPublicData,
|
|
105
111
|
this.dataDir,
|
|
112
|
+
undefined,
|
|
113
|
+
Number(this.keepInitialNode),
|
|
106
114
|
);
|
|
107
115
|
|
|
108
116
|
// And the ones with an initially disabled sequencer
|
|
@@ -119,7 +127,15 @@ export class P2PInactivityTest {
|
|
|
119
127
|
NUM_NODES - this.inactiveNodeCount,
|
|
120
128
|
);
|
|
121
129
|
|
|
122
|
-
this.nodes = [
|
|
130
|
+
this.nodes = [
|
|
131
|
+
...(this.keepInitialNode ? [this.test.ctx.aztecNode] : []),
|
|
132
|
+
...this.activeNodes,
|
|
133
|
+
...this.inactiveNodes,
|
|
134
|
+
];
|
|
135
|
+
|
|
136
|
+
if (this.nodes.length !== NUM_NODES) {
|
|
137
|
+
throw new Error(`Expected ${NUM_NODES} nodes but got ${this.nodes.length}`);
|
|
138
|
+
}
|
|
123
139
|
|
|
124
140
|
this.offlineValidators = this.test.validators
|
|
125
141
|
.slice(this.test.validators.length - this.inactiveNodeCount)
|
|
@@ -130,6 +146,9 @@ export class P2PInactivityTest {
|
|
|
130
146
|
offlineValidators: this.offlineValidators,
|
|
131
147
|
});
|
|
132
148
|
|
|
149
|
+
this.test.logger.warn(`Advancing to epoch ${SETUP_EPOCH_DURATION + 1} to start slashing`);
|
|
150
|
+
await this.test.ctx.cheatCodes.rollup.advanceToEpoch(SETUP_EPOCH_DURATION + 1);
|
|
151
|
+
|
|
133
152
|
return this;
|
|
134
153
|
}
|
|
135
154
|
|
package/src/fixtures/utils.ts
CHANGED
|
@@ -573,7 +573,7 @@ export async function setup(
|
|
|
573
573
|
await blobSink.start();
|
|
574
574
|
config.blobSinkUrl = `http://localhost:${blobSinkPort}`;
|
|
575
575
|
|
|
576
|
-
logger.verbose('Creating and synching an aztec node
|
|
576
|
+
logger.verbose('Creating and synching an aztec node', config);
|
|
577
577
|
|
|
578
578
|
const acvmConfig = await getACVMConfig(logger);
|
|
579
579
|
if (acvmConfig) {
|