@aztec/end-to-end 2.1.0-rc.1 → 2.1.0-rc.3
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 +4 -2
- package/dest/e2e_epochs/epochs_test.d.ts.map +1 -1
- package/dest/e2e_epochs/epochs_test.js +7 -7
- package/dest/e2e_multi_validator/utils.d.ts.map +1 -1
- package/dest/e2e_multi_validator/utils.js +3 -9
- package/dest/e2e_p2p/inactivity_slash_test.d.ts +31 -0
- package/dest/e2e_p2p/inactivity_slash_test.d.ts.map +1 -0
- package/dest/e2e_p2p/inactivity_slash_test.js +132 -0
- package/dest/e2e_p2p/p2p_network.d.ts +6 -4
- package/dest/e2e_p2p/p2p_network.d.ts.map +1 -1
- package/dest/e2e_p2p/p2p_network.js +2 -0
- 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 +6 -2
- package/dest/fixtures/setup_p2p_test.d.ts.map +1 -1
- package/dest/fixtures/setup_p2p_test.js +2 -1
- package/dest/fixtures/snapshot_manager.d.ts.map +1 -1
- package/dest/fixtures/snapshot_manager.js +16 -13
- package/dest/fixtures/utils.d.ts +3 -1
- package/dest/fixtures/utils.d.ts.map +1 -1
- package/dest/fixtures/utils.js +5 -3
- package/package.json +36 -36
- package/src/e2e_epochs/epochs_test.ts +10 -8
- package/src/e2e_multi_validator/utils.ts +3 -9
- package/src/e2e_p2p/inactivity_slash_test.ts +174 -0
- package/src/e2e_p2p/p2p_network.ts +4 -4
- package/src/fixtures/e2e_prover_test.ts +1 -0
- package/src/fixtures/setup_p2p_test.ts +7 -3
- package/src/fixtures/snapshot_manager.ts +19 -11
- package/src/fixtures/utils.ts +6 -4
|
@@ -5,7 +5,7 @@ import { type ExtendedViemWalletClient } from '@aztec/ethereum';
|
|
|
5
5
|
import { RollupContract } from '@aztec/ethereum/contracts';
|
|
6
6
|
import { ChainMonitor, type Delayer } from '@aztec/ethereum/test';
|
|
7
7
|
import { SpamContract } from '@aztec/noir-test-contracts.js/Spam';
|
|
8
|
-
import { ProverNode } from '@aztec/prover-node';
|
|
8
|
+
import { ProverNode, type ProverNodeConfig } from '@aztec/prover-node';
|
|
9
9
|
import { type SequencerClient, type SequencerEvents } from '@aztec/sequencer-client';
|
|
10
10
|
import { EthAddress, type L2BlockNumber } from '@aztec/stdlib/block';
|
|
11
11
|
import { type L1RollupConstants } from '@aztec/stdlib/epoch-helpers';
|
|
@@ -53,7 +53,9 @@ export declare class EpochsTestContext {
|
|
|
53
53
|
};
|
|
54
54
|
setup(opts?: EpochsTestOpts): Promise<void>;
|
|
55
55
|
teardown(): Promise<void>;
|
|
56
|
-
createProverNode(
|
|
56
|
+
createProverNode(opts?: {
|
|
57
|
+
dontStart?: boolean;
|
|
58
|
+
} & Partial<ProverNodeConfig>): Promise<ProverNode>;
|
|
57
59
|
createNonValidatorNode(opts?: Partial<AztecNodeConfig>): Promise<AztecNodeService>;
|
|
58
60
|
createValidatorNode(privateKeys: `0x${string}`[], opts?: Partial<AztecNodeConfig> & {
|
|
59
61
|
txDelayerMaxInclusionTimeIntoSlot?: number;
|
|
@@ -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,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAChD,OAAO,EAA4B,KAAK,wBAAwB,EAA0B,MAAM,iBAAiB,CAAC;AAClH,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAkB,KAA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C,GAAG;QAAE,iCAAiC,CAAC,EAAE,MAAM,CAAC;QAAC,kBAAkB,CAAC,EAAE,OAAO,CAAA;KAAO;YAMtG,UAAU;IAsDxB,OAAO,CAAC,iBAAiB;IAKzB,0FAA0F;IAC7E,oBAAoB,CAAC,KAAK,EAAE,MAAM;IAY/C,sDAAsD;IACzC,sBAAsB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,SAAK;IAShE,iEAAiE;IACpD,4BAA4B,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,SAAK;IAUjE,kFAAkF;IACrE,wCAAwC,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM;IAUlF,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;;;;IAc3B,0EAA0E;IAC7D,mBAAmB,CAAC,WAAW,EAAE,aAAa,EAAE,eAAe,EAAE,OAAO;IAW9E,oBAAoB,CACzB,UAAU,EAAE,eAAe,EAAE,EAC7B,WAAW,GAAE,CAAC,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC,MAAM,EAAE,GAAG,CAAc;;;;CAiD/D"}
|
|
@@ -83,9 +83,6 @@ export const DEFAULT_L1_BLOCK_TIME = process.env.CI ? 12 : 8;
|
|
|
83
83
|
// using the prover's eth address if the proverId is used for something in the rollup contract
|
|
84
84
|
// Use numeric EthAddress for deterministic prover id
|
|
85
85
|
proverId: EthAddress.fromNumber(1),
|
|
86
|
-
// This must be enough so that the tx from the prover is delayed properly,
|
|
87
|
-
// but not so much to hang the sequencer and timeout the teardown
|
|
88
|
-
txPropagationMaxQueryAttempts: opts.txPropagationMaxQueryAttempts ?? 12,
|
|
89
86
|
worldStateBlockHistory: WORLD_STATE_BLOCK_HISTORY,
|
|
90
87
|
exitDelaySeconds: DefaultL1ContractsConfig.exitDelaySeconds,
|
|
91
88
|
slasherFlavor: 'none',
|
|
@@ -131,15 +128,18 @@ export const DEFAULT_L1_BLOCK_TIME = process.env.CI ? 12 : 8;
|
|
|
131
128
|
await Promise.all(this.nodes.map((node)=>tryStop(node, this.logger)));
|
|
132
129
|
await this.context.teardown();
|
|
133
130
|
}
|
|
134
|
-
async createProverNode() {
|
|
131
|
+
async createProverNode(opts = {}) {
|
|
135
132
|
this.logger.warn('Creating and syncing a simulated prover node...');
|
|
136
133
|
const proverNodePrivateKey = this.getNextPrivateKey();
|
|
137
134
|
const suffix = (this.proverNodes.length + 1).toString();
|
|
135
|
+
const proverId = EthAddress.fromNumber(parseInt(suffix, 10));
|
|
138
136
|
const proverNode = await withLogNameSuffix(suffix, ()=>createAndSyncProverNode(proverNodePrivateKey, {
|
|
139
137
|
...this.context.config,
|
|
140
|
-
proverId
|
|
138
|
+
proverId
|
|
141
139
|
}, {
|
|
142
|
-
dataDirectory: join(this.context.config.dataDirectory, randomBytes(8).toString('hex'))
|
|
140
|
+
dataDirectory: join(this.context.config.dataDirectory, randomBytes(8).toString('hex')),
|
|
141
|
+
proverId,
|
|
142
|
+
...opts
|
|
143
143
|
}, this.context.aztecNode, undefined, {
|
|
144
144
|
dateProvider: this.context.dateProvider
|
|
145
145
|
}));
|
|
@@ -323,7 +323,7 @@ export const DEFAULT_L1_BLOCK_TIME = process.env.CI ? 12 : 8;
|
|
|
323
323
|
sequencer.getSequencer().on(eventName, (args)=>{
|
|
324
324
|
const evt = makeEvent(i, eventName, args);
|
|
325
325
|
failEvents.push(evt);
|
|
326
|
-
this.logger.error(`Failed event ${eventName} from sequencer ${sequencerIndex}`, evt);
|
|
326
|
+
this.logger.error(`Failed event ${eventName} from sequencer ${sequencerIndex}`, undefined, evt);
|
|
327
327
|
});
|
|
328
328
|
});
|
|
329
329
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/e2e_multi_validator/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAW1D,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,GAAG,CAAC,MAAM,EAAE,aAAa,CAAC,EAAE,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,sGA0EpG;AAGD,wBAAsB,cAAc,CAClC,QAAQ,EAAE,MAAM,EAChB,QAAQ,EAAE,MAAM,EAChB,cAAc,EAAE,MAAM,EACtB,aAAa,EAAE,aAAa,EAC5B,aAAa,EAAE,aAAa,EAC5B,QAAQ,EAAE,UAAU,EACpB,YAAY,EAAE,YAAY,iBAmB3B;AAED,wBAAsB,cAAc,CAClC,QAAQ,EAAE,MAAM,EAChB,YAAY,EAAE,aAAa,EAC3B,iBAAiB,EAAE,MAAM,EACzB,eAAe,EAAE,MAAM,EACvB,QAAQ,EAAE,UAAU,EACpB,YAAY,EAAE,YAAY,iBAmB3B;AAED,wBAAsB,cAAc,CAClC,QAAQ,EAAE,MAAM,EAChB,gBAAgB,EAAE,UAAU,EAC5B,aAAa,EAAE,aAAa,EAC5B,aAAa,EAAE,aAAa,EAC5B,QAAQ,EAAE,UAAU,EACpB,eAAe,EAAE,MAAM,EACvB,YAAY,EAAE,YAAY,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/e2e_multi_validator/utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAEpD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAC;AAW1D,wBAAgB,mBAAmB,CAAC,SAAS,EAAE,GAAG,CA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EACpB,YAAY,EAAE,YAAY,iBAkB3B;AAED,wBAAgB,oBAAoB,CAAC,UAAU,EAAE,aAAa,GAAG,UAAU,CAE1E"}
|
|
@@ -130,9 +130,7 @@ export async function createKeyFile3(fileName, validatorAddress, publisher1Key,
|
|
|
130
130
|
schemaVersion: 1,
|
|
131
131
|
validators: [
|
|
132
132
|
{
|
|
133
|
-
attester:
|
|
134
|
-
address: validatorAddress.toChecksumString()
|
|
135
|
-
},
|
|
133
|
+
attester: validatorAddress.toChecksumString(),
|
|
136
134
|
coinbase: coinbase.toChecksumString(),
|
|
137
135
|
publisher: [
|
|
138
136
|
publisher1Key,
|
|
@@ -155,9 +153,7 @@ export async function createKeyFile4(fileName, validator1Address, validator2Addr
|
|
|
155
153
|
},
|
|
156
154
|
validators: [
|
|
157
155
|
{
|
|
158
|
-
attester:
|
|
159
|
-
address: validator1Address.toChecksumString()
|
|
160
|
-
},
|
|
156
|
+
attester: validator1Address.toChecksumString(),
|
|
161
157
|
coinbase: coinbase1.toChecksumString(),
|
|
162
158
|
publisher: {
|
|
163
159
|
mnemonic: mnemonic,
|
|
@@ -168,9 +164,7 @@ export async function createKeyFile4(fileName, validator1Address, validator2Addr
|
|
|
168
164
|
feeRecipient: feeRecipient1.toString()
|
|
169
165
|
},
|
|
170
166
|
{
|
|
171
|
-
attester:
|
|
172
|
-
address: validator2Address.toChecksumString()
|
|
173
|
-
},
|
|
167
|
+
attester: validator2Address.toChecksumString(),
|
|
174
168
|
coinbase: coinbase2.toChecksumString(),
|
|
175
169
|
publisher: [
|
|
176
170
|
publisher2Key,
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import type { AztecNodeService } from '@aztec/aztec-node';
|
|
2
|
+
import { EthAddress } from '@aztec/aztec.js';
|
|
3
|
+
import { RollupContract } from '@aztec/ethereum';
|
|
4
|
+
import 'jest-extended';
|
|
5
|
+
import { P2PNetworkTest } from './p2p_network.js';
|
|
6
|
+
export declare class P2PInactivityTest {
|
|
7
|
+
readonly test: P2PNetworkTest;
|
|
8
|
+
nodes: AztecNodeService[];
|
|
9
|
+
activeNodes: AztecNodeService[];
|
|
10
|
+
inactiveNodes: AztecNodeService[];
|
|
11
|
+
rollup: RollupContract;
|
|
12
|
+
offlineValidators: EthAddress[];
|
|
13
|
+
private dataDir;
|
|
14
|
+
private inactiveNodeCount;
|
|
15
|
+
private keepInitialNode;
|
|
16
|
+
constructor(test: P2PNetworkTest, opts: {
|
|
17
|
+
inactiveNodeCount: number;
|
|
18
|
+
keepInitialNode?: boolean;
|
|
19
|
+
});
|
|
20
|
+
static create(testName: string, opts: {
|
|
21
|
+
slashInactivityConsecutiveEpochThreshold: number;
|
|
22
|
+
inactiveNodeCount: number;
|
|
23
|
+
keepInitialNode?: boolean;
|
|
24
|
+
}): Promise<P2PInactivityTest>;
|
|
25
|
+
setup(): Promise<this>;
|
|
26
|
+
teardown(): Promise<void>;
|
|
27
|
+
get ctx(): import("../fixtures/snapshot_manager.js").SubsystemsContext;
|
|
28
|
+
get logger(): import("@aztec/aztec.js").Logger;
|
|
29
|
+
get slashingAmount(): bigint;
|
|
30
|
+
}
|
|
31
|
+
//# sourceMappingURL=inactivity_slash_test.d.ts.map
|
|
@@ -0,0 +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;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"}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import fs from 'fs';
|
|
2
|
+
import 'jest-extended';
|
|
3
|
+
import os from 'os';
|
|
4
|
+
import path from 'path';
|
|
5
|
+
import { createNodes } from '../fixtures/setup_p2p_test.js';
|
|
6
|
+
import { P2PNetworkTest } from './p2p_network.js';
|
|
7
|
+
const NUM_NODES = 6;
|
|
8
|
+
const NUM_VALIDATORS = NUM_NODES;
|
|
9
|
+
const COMMITTEE_SIZE = NUM_VALIDATORS;
|
|
10
|
+
const SLASHING_QUORUM = 3;
|
|
11
|
+
const EPOCH_DURATION = 2;
|
|
12
|
+
const SLASHING_ROUND_SIZE_IN_EPOCHS = 2;
|
|
13
|
+
const BOOT_NODE_UDP_PORT = 4500;
|
|
14
|
+
const ETHEREUM_SLOT_DURATION = 4;
|
|
15
|
+
const AZTEC_SLOT_DURATION = 8;
|
|
16
|
+
const SLASHING_UNIT = BigInt(1e18);
|
|
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;
|
|
20
|
+
export class P2PInactivityTest {
|
|
21
|
+
test;
|
|
22
|
+
nodes;
|
|
23
|
+
activeNodes;
|
|
24
|
+
inactiveNodes;
|
|
25
|
+
rollup;
|
|
26
|
+
offlineValidators;
|
|
27
|
+
dataDir;
|
|
28
|
+
inactiveNodeCount;
|
|
29
|
+
keepInitialNode;
|
|
30
|
+
constructor(test, opts){
|
|
31
|
+
this.test = test;
|
|
32
|
+
this.dataDir = fs.mkdtempSync(path.join(os.tmpdir(), test.testName));
|
|
33
|
+
this.inactiveNodeCount = opts.inactiveNodeCount;
|
|
34
|
+
this.keepInitialNode = opts.keepInitialNode ?? false;
|
|
35
|
+
}
|
|
36
|
+
static async create(testName, opts) {
|
|
37
|
+
const test = await P2PNetworkTest.create({
|
|
38
|
+
testName,
|
|
39
|
+
numberOfNodes: 0,
|
|
40
|
+
numberOfValidators: NUM_VALIDATORS,
|
|
41
|
+
basePort: BOOT_NODE_UDP_PORT,
|
|
42
|
+
startProverNode: true,
|
|
43
|
+
initialConfig: {
|
|
44
|
+
proverNodeConfig: {
|
|
45
|
+
proverNodeEpochProvingDelayMs: AZTEC_SLOT_DURATION * 1000
|
|
46
|
+
},
|
|
47
|
+
aztecTargetCommitteeSize: COMMITTEE_SIZE,
|
|
48
|
+
aztecSlotDuration: AZTEC_SLOT_DURATION,
|
|
49
|
+
ethereumSlotDuration: ETHEREUM_SLOT_DURATION,
|
|
50
|
+
aztecProofSubmissionEpochs: 1024,
|
|
51
|
+
listenAddress: '127.0.0.1',
|
|
52
|
+
minTxsPerBlock: 0,
|
|
53
|
+
aztecEpochDuration: EPOCH_DURATION,
|
|
54
|
+
validatorReexecute: false,
|
|
55
|
+
sentinelEnabled: true,
|
|
56
|
+
slashingQuorum: SLASHING_QUORUM,
|
|
57
|
+
slashingRoundSizeInEpochs: SLASHING_ROUND_SIZE_IN_EPOCHS,
|
|
58
|
+
slashInactivityTargetPercentage: 0.8,
|
|
59
|
+
slashGracePeriodL2Slots: SETUP_EPOCH_DURATION * EPOCH_DURATION,
|
|
60
|
+
slashAmountSmall: SLASHING_UNIT,
|
|
61
|
+
slashAmountMedium: SLASHING_UNIT * 2n,
|
|
62
|
+
slashAmountLarge: SLASHING_UNIT * 3n,
|
|
63
|
+
...opts
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
return new P2PInactivityTest(test, opts);
|
|
67
|
+
}
|
|
68
|
+
async setup() {
|
|
69
|
+
await this.test.applyBaseSnapshots();
|
|
70
|
+
await this.test.setup();
|
|
71
|
+
// Set slashing penalties for inactivity
|
|
72
|
+
const { rollup } = await this.test.getContracts();
|
|
73
|
+
const [activationThreshold, ejectionThreshold, localEjectionThreshold] = await Promise.all([
|
|
74
|
+
rollup.getActivationThreshold(),
|
|
75
|
+
rollup.getEjectionThreshold(),
|
|
76
|
+
rollup.getLocalEjectionThreshold()
|
|
77
|
+
]);
|
|
78
|
+
const biggestEjection = ejectionThreshold > localEjectionThreshold ? ejectionThreshold : localEjectionThreshold;
|
|
79
|
+
expect(activationThreshold - SLASHING_AMOUNT).toBeLessThan(biggestEjection);
|
|
80
|
+
this.test.ctx.aztecNodeConfig.slashInactivityPenalty = SLASHING_AMOUNT;
|
|
81
|
+
this.rollup = rollup;
|
|
82
|
+
if (!this.keepInitialNode) {
|
|
83
|
+
await this.test.ctx.aztecNode.stop();
|
|
84
|
+
}
|
|
85
|
+
// Create all active nodes
|
|
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));
|
|
87
|
+
// And the ones with an initially disabled sequencer
|
|
88
|
+
const inactiveConfig = {
|
|
89
|
+
...this.test.ctx.aztecNodeConfig,
|
|
90
|
+
dontStartSequencer: true
|
|
91
|
+
};
|
|
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);
|
|
93
|
+
this.nodes = [
|
|
94
|
+
...this.keepInitialNode ? [
|
|
95
|
+
this.test.ctx.aztecNode
|
|
96
|
+
] : [],
|
|
97
|
+
...this.activeNodes,
|
|
98
|
+
...this.inactiveNodes
|
|
99
|
+
];
|
|
100
|
+
if (this.nodes.length !== NUM_NODES) {
|
|
101
|
+
throw new Error(`Expected ${NUM_NODES} nodes but got ${this.nodes.length}`);
|
|
102
|
+
}
|
|
103
|
+
this.offlineValidators = this.test.validators.slice(this.test.validators.length - this.inactiveNodeCount).map((a)=>a.attester);
|
|
104
|
+
this.test.logger.warn(`Setup complete. Offline validators are ${this.offlineValidators.join(', ')}.`, {
|
|
105
|
+
validators: this.test.validators,
|
|
106
|
+
offlineValidators: this.offlineValidators
|
|
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);
|
|
110
|
+
return this;
|
|
111
|
+
}
|
|
112
|
+
async teardown() {
|
|
113
|
+
await this.test.stopNodes(this.nodes);
|
|
114
|
+
await this.test.teardown();
|
|
115
|
+
for(let i = 0; i < NUM_NODES; i++){
|
|
116
|
+
fs.rmSync(`${this.dataDir}-${i}`, {
|
|
117
|
+
recursive: true,
|
|
118
|
+
force: true,
|
|
119
|
+
maxRetries: 3
|
|
120
|
+
});
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
get ctx() {
|
|
124
|
+
return this.test.ctx;
|
|
125
|
+
}
|
|
126
|
+
get logger() {
|
|
127
|
+
return this.test.logger;
|
|
128
|
+
}
|
|
129
|
+
get slashingAmount() {
|
|
130
|
+
return SLASHING_AMOUNT;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { InitialAccountData } from '@aztec/accounts/testing';
|
|
2
|
-
import type {
|
|
2
|
+
import type { AztecNodeService } from '@aztec/aztec-node';
|
|
3
3
|
import { type AccountWalletWithSecretKey, AztecAddress } from '@aztec/aztec.js';
|
|
4
4
|
import { type EmpireSlashingProposerContract, type Operator, RollupContract, type TallySlashingProposerContract, type ViemClient } from '@aztec/ethereum';
|
|
5
5
|
import { ChainMonitor } from '@aztec/ethereum/test';
|
|
@@ -11,6 +11,7 @@ import { SlashFactoryContract } from '@aztec/stdlib/l1-contracts';
|
|
|
11
11
|
import type { PublicDataTreeLeaf } from '@aztec/stdlib/trees';
|
|
12
12
|
import { type GetContractReturnType } from 'viem';
|
|
13
13
|
import { type SubsystemsContext } from '../fixtures/snapshot_manager.js';
|
|
14
|
+
import { type SetupOptions } from '../fixtures/utils.js';
|
|
14
15
|
export declare const WAIT_FOR_TX_TIMEOUT: number;
|
|
15
16
|
export declare const SHORTENED_BLOCK_TIME_CONFIG_NO_PRUNES: {
|
|
16
17
|
aztecSlotDuration: number;
|
|
@@ -18,6 +19,7 @@ export declare const SHORTENED_BLOCK_TIME_CONFIG_NO_PRUNES: {
|
|
|
18
19
|
aztecProofSubmissionWindow: number;
|
|
19
20
|
};
|
|
20
21
|
export declare class P2PNetworkTest {
|
|
22
|
+
readonly testName: string;
|
|
21
23
|
bootstrapNodeEnr: string;
|
|
22
24
|
bootNodePort: number;
|
|
23
25
|
numberOfValidators: number;
|
|
@@ -56,14 +58,14 @@ export declare class P2PNetworkTest {
|
|
|
56
58
|
defaultAccountAddress?: AztecAddress;
|
|
57
59
|
spamContract?: SpamContract;
|
|
58
60
|
bootstrapNode?: BootstrapNode;
|
|
59
|
-
constructor(testName: string, bootstrapNodeEnr: string, bootNodePort: number, numberOfValidators: number, initialValidatorConfig:
|
|
61
|
+
constructor(testName: string, bootstrapNodeEnr: string, bootNodePort: number, numberOfValidators: number, initialValidatorConfig: SetupOptions, numberOfNodes?: number, metricsPort?: number | undefined, startProverNode?: boolean, mockZkPassportVerifier?: boolean);
|
|
60
62
|
static create({ testName, numberOfNodes, numberOfValidators, basePort, metricsPort, initialConfig, startProverNode, mockZkPassportVerifier, }: {
|
|
61
63
|
testName: string;
|
|
62
64
|
numberOfNodes: number;
|
|
63
65
|
numberOfValidators: number;
|
|
64
66
|
basePort?: number;
|
|
65
67
|
metricsPort?: number;
|
|
66
|
-
initialConfig?:
|
|
68
|
+
initialConfig?: SetupOptions;
|
|
67
69
|
startProverNode?: boolean;
|
|
68
70
|
mockZkPassportVerifier?: boolean;
|
|
69
71
|
}): Promise<P2PNetworkTest>;
|
|
@@ -78,7 +80,7 @@ export declare class P2PNetworkTest {
|
|
|
78
80
|
removeInitialNode(): Promise<void>;
|
|
79
81
|
sendDummyTx(): Promise<{
|
|
80
82
|
receipt: import("viem").TransactionReceipt;
|
|
81
|
-
|
|
83
|
+
state: import("@aztec/ethereum").L1TxState;
|
|
82
84
|
}>;
|
|
83
85
|
private _sendDummyTx;
|
|
84
86
|
setup(): 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,
|
|
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,EAAmB,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAC3E,OAAO,EAAE,KAAK,0BAA0B,EAAE,YAAY,EAAkB,MAAM,iBAAiB,CAAC;AA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IAMR,YAAY,IAAI,OAAO,CAAC;QAC5B,MAAM,EAAE,cAAc,CAAC;QACvB,eAAe,EAAE,qBAAqB,CAAC,OAAO,UAAU,EAAE,UAAU,CAAC,CAAC;QACtE,gBAAgB,EAAE,8BAA8B,GAAG,6BAA6B,GAAG,SAAS,CAAC;QAC7F,YAAY,EAAE,oBAAoB,CAAC;KACpC,CAAC;CA0BH"}
|
|
@@ -28,6 +28,7 @@ export const SHORTENED_BLOCK_TIME_CONFIG_NO_PRUNES = {
|
|
|
28
28
|
aztecProofSubmissionWindow: 640
|
|
29
29
|
};
|
|
30
30
|
export class P2PNetworkTest {
|
|
31
|
+
testName;
|
|
31
32
|
bootstrapNodeEnr;
|
|
32
33
|
bootNodePort;
|
|
33
34
|
numberOfValidators;
|
|
@@ -52,6 +53,7 @@ export class P2PNetworkTest {
|
|
|
52
53
|
bootstrapNode;
|
|
53
54
|
constructor(testName, bootstrapNodeEnr, bootNodePort, numberOfValidators, initialValidatorConfig, numberOfNodes = 0, // If set enable metrics collection
|
|
54
55
|
metricsPort, startProverNode, mockZkPassportVerifier){
|
|
56
|
+
this.testName = testName;
|
|
55
57
|
this.bootstrapNodeEnr = bootstrapNodeEnr;
|
|
56
58
|
this.bootNodePort = bootNodePort;
|
|
57
59
|
this.numberOfValidators = numberOfValidators;
|
|
@@ -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,sBAAsB,CAAC;AAClD,OAAO,EAEL,KAAK,6BAA6B,EAGnC,MAAM,kBAAkB,CAAC;AAE1B,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 10,
|
|
211
211
|
txGatheringMaxParallelRequestsPerNode: 100,
|
|
212
212
|
txGatheringTimeoutMs: 24_000,
|
|
213
|
-
proverNodeFailedEpochStore: undefined
|
|
213
|
+
proverNodeFailedEpochStore: undefined,
|
|
214
|
+
proverNodeEpochProvingDelayMs: undefined
|
|
214
215
|
};
|
|
215
216
|
const sponsoredFPCAddress = await getSponsoredFPCAddress();
|
|
216
217
|
const { prefilledPublicData } = await getGenesisValues(this.context.initialFundedAccounts.map((a)=>a.address).concat(sponsoredFPCAddress));
|
|
@@ -15,9 +15,13 @@ export interface NodeContext {
|
|
|
15
15
|
txs: SentTx[];
|
|
16
16
|
}
|
|
17
17
|
export declare function generatePrivateKeys(startIndex: number, numberOfKeys: number): `0x${string}`[];
|
|
18
|
-
export declare function createNodes(config: AztecNodeConfig
|
|
18
|
+
export declare function createNodes(config: AztecNodeConfig & {
|
|
19
|
+
dontStartSequencer?: boolean;
|
|
20
|
+
}, dateProvider: DateProvider, bootstrapNodeEnr: string, numNodes: number, bootNodePort: number, prefilledPublicData?: PublicDataTreeLeaf[], dataDirectory?: string, metricsPort?: number, indexOffset?: number): Promise<AztecNodeService[]>;
|
|
19
21
|
/** Creates a P2P enabled instance of Aztec Node Service with a validator */
|
|
20
|
-
export declare function createNode(config: AztecNodeConfig
|
|
22
|
+
export declare function createNode(config: AztecNodeConfig & {
|
|
23
|
+
dontStartSequencer?: boolean;
|
|
24
|
+
}, dateProvider: DateProvider, tcpPort: number, bootstrapNode: string | undefined, addressIndex: number, prefilledPublicData?: PublicDataTreeLeaf[], dataDirectory?: string, metricsPort?: number, loggerIdStorage?: AsyncLocalStorage<string>): Promise<AztecNodeService>;
|
|
21
25
|
/** Creates a P2P enabled instance of Aztec Node Service without a validator */
|
|
22
26
|
export declare function createNonValidatorNode(baseConfig: AztecNodeConfig, dateProvider: DateProvider, tcpPort: number, bootstrapNode: string | undefined, prefilledPublicData?: PublicDataTreeLeaf[], dataDirectory?: string, metricsPort?: number, loggerIdStorage?: AsyncLocalStorage<string>): Promise<AztecNodeService>;
|
|
23
27
|
export declare function createProverNode(config: AztecNodeConfig, tcpPort: number, bootstrapNode: string | undefined, addressIndex: number, proverNodeDeps: ProverNodeDeps & Required<Pick<ProverNodeDeps, 'dateProvider'>>, prefilledPublicData?: PublicDataTreeLeaf[], dataDirectory?: string, metricsPort?: number, loggerIdStorage?: AsyncLocalStorage<string>): Promise<import("@aztec/prover-node").ProverNode>;
|
|
@@ -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;AAI9C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAoB,cAAc,EAAE,MAAM,oBAAoB,CAAC;AAC3E,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;AASrD,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,
|
|
1
|
+
{"version":3,"file":"setup_p2p_test.d.ts","sourceRoot":"","sources":["../../src/fixtures/setup_p2p_test.ts"],"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|
|
@@ -51,7 +51,8 @@ export async function createNodes(config, dateProvider, bootstrapNodeEnr, numNod
|
|
|
51
51
|
telemetry,
|
|
52
52
|
dateProvider
|
|
53
53
|
}, {
|
|
54
|
-
prefilledPublicData
|
|
54
|
+
prefilledPublicData,
|
|
55
|
+
dontStartSequencer: config.dontStartSequencer
|
|
55
56
|
});
|
|
56
57
|
};
|
|
57
58
|
return loggerIdStorage ? await loggerIdStorage.run(tcpPort.toString(), createNode) : createNode();
|
|
@@ -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,EAIpB,KAAK,MAAM,EACX,KAAK,GAAG,EACR,KAAK,MAAM,EAGZ,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,yBAAyB,CAAC;AACpF,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EAIjC,MAAM,iBAAiB,CAAC;AAQzB,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,KAAK,UAAU,EAAyC,MAAM,mBAAmB,CAAC;AAC3F,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,yBAAyB,CAAC;AAK/D,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAezC,OAAO,EACL,KAAK,YAAY,EAKlB,MAAM,YAAY,CAAC;A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ACH,cAAM,eAAgB,YAAW,gBAAgB;IAQ7C,OAAO,CAAC,QAAQ;IAChB,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,qBAAqB;IAT/B,OAAO,CAAC,aAAa,CAAuB;IAC5C,OAAO,CAAC,OAAO,CAAC,CAAoB;IACpC,OAAO,CAAC,QAAQ,CAAS;IACzB,OAAO,CAAC,MAAM,CAAS;gBAGrB,QAAQ,EAAE,MAAM,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;AAoVD;;;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"}
|
|
@@ -234,17 +234,6 @@ export function createSnapshotManager(testName, dataPath, config = {}, deployL1C
|
|
|
234
234
|
aztecNodeConfig.dataDirectory = statePath;
|
|
235
235
|
}
|
|
236
236
|
aztecNodeConfig.blobSinkUrl = `http://127.0.0.1:${blobSinkPort}`;
|
|
237
|
-
// Start anvil. We go via a wrapper script to ensure if the parent dies, anvil dies.
|
|
238
|
-
logger.verbose('Starting anvil...');
|
|
239
|
-
const res = await startAnvil({
|
|
240
|
-
l1BlockTime: opts.ethereumSlotDuration
|
|
241
|
-
});
|
|
242
|
-
const anvil = res.anvil;
|
|
243
|
-
aztecNodeConfig.l1RpcUrls = [
|
|
244
|
-
res.rpcUrl
|
|
245
|
-
];
|
|
246
|
-
// Deploy our L1 contracts.
|
|
247
|
-
logger.verbose('Deploying L1 contracts...');
|
|
248
237
|
const hdAccount = mnemonicToAccount(MNEMONIC, {
|
|
249
238
|
addressIndex: 0
|
|
250
239
|
});
|
|
@@ -262,7 +251,19 @@ export function createSnapshotManager(testName, dataPath, config = {}, deployL1C
|
|
|
262
251
|
`0x${validatorPrivKey.toString('hex')}`
|
|
263
252
|
]);
|
|
264
253
|
aztecNodeConfig.coinbase = opts.coinbase ?? EthAddress.fromString(`${hdAccount.address}`);
|
|
254
|
+
logger.info(`Setting up environment with config`, aztecNodeConfig);
|
|
255
|
+
// Start anvil. We go via a wrapper script to ensure if the parent dies, anvil dies.
|
|
256
|
+
logger.verbose('Starting anvil...');
|
|
257
|
+
const res = await startAnvil({
|
|
258
|
+
l1BlockTime: opts.ethereumSlotDuration
|
|
259
|
+
});
|
|
260
|
+
const anvil = res.anvil;
|
|
261
|
+
aztecNodeConfig.l1RpcUrls = [
|
|
262
|
+
res.rpcUrl
|
|
263
|
+
];
|
|
265
264
|
const ethCheatCodes = new EthCheatCodesWithState(aztecNodeConfig.l1RpcUrls);
|
|
265
|
+
// Deploy our L1 contracts.
|
|
266
|
+
logger.verbose('Deploying L1 contracts...');
|
|
266
267
|
if (opts.l1StartTime) {
|
|
267
268
|
await ethCheatCodes.warp(opts.l1StartTime, {
|
|
268
269
|
resetBlockInterval: true
|
|
@@ -282,7 +283,6 @@ export function createSnapshotManager(testName, dataPath, config = {}, deployL1C
|
|
|
282
283
|
});
|
|
283
284
|
aztecNodeConfig.l1Contracts = deployL1ContractsValues.l1ContractAddresses;
|
|
284
285
|
aztecNodeConfig.rollupVersion = deployL1ContractsValues.rollupVersion;
|
|
285
|
-
aztecNodeConfig.l1PublishRetryIntervalMS = 100;
|
|
286
286
|
const dateProvider = new TestDateProvider();
|
|
287
287
|
const watcher = new AnvilTestWatcher(new EthCheatCodesWithState(aztecNodeConfig.l1RpcUrls), deployL1ContractsValues.l1ContractAddresses.rollupAddress, deployL1ContractsValues.l1Client, dateProvider);
|
|
288
288
|
await watcher.start();
|
|
@@ -318,6 +318,7 @@ export function createSnapshotManager(testName, dataPath, config = {}, deployL1C
|
|
|
318
318
|
if (opts.startProverNode) {
|
|
319
319
|
logger.verbose('Creating and syncing a simulated prover node with p2p disabled...');
|
|
320
320
|
proverNode = await createAndSyncProverNode(`0x${proverNodePrivateKey.toString('hex')}`, aztecNodeConfig, {
|
|
321
|
+
...aztecNodeConfig.proverNodeConfig,
|
|
321
322
|
dataDirectory: path.join(directoryToCleanup, randomBytes(8).toString('hex')),
|
|
322
323
|
p2pEnabled: false
|
|
323
324
|
}, aztecNode, prefilledPublicData);
|
|
@@ -416,7 +417,9 @@ export function createSnapshotManager(testName, dataPath, config = {}, deployL1C
|
|
|
416
417
|
const proverNodePrivateKey = getPrivateKeyFromIndex(2);
|
|
417
418
|
const proverNodePrivateKeyHex = `0x${proverNodePrivateKey.toString('hex')}`;
|
|
418
419
|
proverNode = await createAndSyncProverNode(proverNodePrivateKeyHex, aztecNodeConfig, {
|
|
419
|
-
|
|
420
|
+
...aztecNodeConfig.proverNodeConfig,
|
|
421
|
+
dataDirectory: path.join(directoryToCleanup, randomBytes(8).toString('hex')),
|
|
422
|
+
p2pEnabled: false
|
|
420
423
|
}, aztecNode, prefilledPublicData);
|
|
421
424
|
}
|
|
422
425
|
logger.verbose('Creating pxe...');
|
package/dest/fixtures/utils.d.ts
CHANGED
|
@@ -192,5 +192,7 @@ export declare function setupSponsoredFPC(pxe: PXE): Promise<ContractInstanceWit
|
|
|
192
192
|
*/
|
|
193
193
|
export declare function registerSponsoredFPC(pxe: PXE): Promise<void>;
|
|
194
194
|
export declare function waitForProvenChain(node: AztecNode, targetBlock?: number, timeoutSec?: number, intervalSec?: number): Promise<void>;
|
|
195
|
-
export declare function createAndSyncProverNode(proverNodePrivateKey: `0x${string}`, aztecNodeConfig: AztecNodeConfig, proverNodeConfig: Partial<ProverNodeConfig> & Pick<DataStoreConfig, 'dataDirectory'
|
|
195
|
+
export declare function createAndSyncProverNode(proverNodePrivateKey: `0x${string}`, aztecNodeConfig: AztecNodeConfig, proverNodeConfig: Partial<ProverNodeConfig> & Pick<DataStoreConfig, 'dataDirectory'> & {
|
|
196
|
+
dontStart?: boolean;
|
|
197
|
+
}, aztecNode: AztecNode | undefined, prefilledPublicData?: PublicDataTreeLeaf[], proverNodeDeps?: ProverNodeDeps): Promise<ProverNode>;
|
|
196
198
|
//# 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,EAEL,KAAK,0BAA0B,EAC/B,KAAK,YAAY,EACjB,KAAK,SAAS,EAEd,KAAK,cAAc,EACnB,KAAK,MAAM,EACX,KAAK,GAAG,EACR,KAAK,MAAM,EAOZ,MAAM,iBAAiB,CAAC;AAEzB,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEpE,OAAO,EAAE,KAAK,cAAc,EAAwB,MAAM,yBAAyB,CAAC;AAEpF,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,EAGhC,KAAK,QAAQ,EAOd,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAEL,aAAa,EAGb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AE,EAC9G,SAAS,EAAE,SAAS,GAAG,SAAS,EAChC,mBAAmB,GAAE,kBAAkB,EAAO,EAC9C,cAAc,GAAE,cAAmB,uBAuDpC"}
|
package/dest/fixtures/utils.js
CHANGED
|
@@ -328,7 +328,7 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
328
328
|
}, telemetry);
|
|
329
329
|
await blobSink.start();
|
|
330
330
|
config.blobSinkUrl = `http://localhost:${blobSinkPort}`;
|
|
331
|
-
logger.verbose('Creating and synching an aztec node
|
|
331
|
+
logger.verbose('Creating and synching an aztec node', config);
|
|
332
332
|
const acvmConfig = await getACVMConfig(logger);
|
|
333
333
|
if (acvmConfig) {
|
|
334
334
|
config.acvmWorkingDirectory = acvmConfig.acvmWorkingDirectory;
|
|
@@ -339,7 +339,6 @@ export const setupL1Contracts = async (l1RpcUrls, account, logger, args = {}, ch
|
|
|
339
339
|
config.bbBinaryPath = bbConfig.bbBinaryPath;
|
|
340
340
|
config.bbWorkingDirectory = bbConfig.bbWorkingDirectory;
|
|
341
341
|
}
|
|
342
|
-
config.l1PublishRetryIntervalMS = 100;
|
|
343
342
|
const blobSinkClient = createBlobSinkClient(config, {
|
|
344
343
|
logger: createLogger('node:blob-sink:client')
|
|
345
344
|
});
|
|
@@ -645,6 +644,7 @@ export function createAndSyncProverNode(proverNodePrivateKey, aztecNodeConfig, p
|
|
|
645
644
|
txGatheringTimeoutMs: 24_000,
|
|
646
645
|
proverNodeFailedEpochStore: undefined,
|
|
647
646
|
proverId: EthAddress.fromNumber(1),
|
|
647
|
+
proverNodeEpochProvingDelayMs: undefined,
|
|
648
648
|
...proverNodeConfig
|
|
649
649
|
};
|
|
650
650
|
const l1TxUtils = createDelayedL1TxUtils(aztecNodeConfig, proverNodePrivateKey, 'prover-node', proverNodeDeps.dateProvider);
|
|
@@ -659,7 +659,9 @@ export function createAndSyncProverNode(proverNodePrivateKey, aztecNodeConfig, p
|
|
|
659
659
|
getLogger().info(`Created and synced prover node`, {
|
|
660
660
|
publisherAddress: l1TxUtils.client.account.address
|
|
661
661
|
});
|
|
662
|
-
|
|
662
|
+
if (!proverNodeConfig.dontStart) {
|
|
663
|
+
await proverNode.start();
|
|
664
|
+
}
|
|
663
665
|
return proverNode;
|
|
664
666
|
});
|
|
665
667
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/end-to-end",
|
|
3
|
-
"version": "2.1.0-rc.
|
|
3
|
+
"version": "2.1.0-rc.3",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": "./dest/index.js",
|
|
6
6
|
"inherits": [
|
|
@@ -25,41 +25,41 @@
|
|
|
25
25
|
"formatting": "run -T prettier --check ./src && run -T eslint ./src"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@aztec/accounts": "2.1.0-rc.
|
|
29
|
-
"@aztec/archiver": "2.1.0-rc.
|
|
30
|
-
"@aztec/aztec": "2.1.0-rc.
|
|
31
|
-
"@aztec/aztec-node": "2.1.0-rc.
|
|
32
|
-
"@aztec/aztec.js": "2.1.0-rc.
|
|
33
|
-
"@aztec/bb-prover": "2.1.0-rc.
|
|
34
|
-
"@aztec/blob-lib": "2.1.0-rc.
|
|
35
|
-
"@aztec/blob-sink": "2.1.0-rc.
|
|
36
|
-
"@aztec/bot": "2.1.0-rc.
|
|
37
|
-
"@aztec/cli": "2.1.0-rc.
|
|
38
|
-
"@aztec/constants": "2.1.0-rc.
|
|
39
|
-
"@aztec/entrypoints": "2.1.0-rc.
|
|
40
|
-
"@aztec/epoch-cache": "2.1.0-rc.
|
|
41
|
-
"@aztec/ethereum": "2.1.0-rc.
|
|
42
|
-
"@aztec/foundation": "2.1.0-rc.
|
|
43
|
-
"@aztec/kv-store": "2.1.0-rc.
|
|
44
|
-
"@aztec/l1-artifacts": "2.1.0-rc.
|
|
45
|
-
"@aztec/merkle-tree": "2.1.0-rc.
|
|
46
|
-
"@aztec/node-keystore": "2.1.0-rc.
|
|
47
|
-
"@aztec/noir-contracts.js": "2.1.0-rc.
|
|
48
|
-
"@aztec/noir-noirc_abi": "2.1.0-rc.
|
|
49
|
-
"@aztec/noir-protocol-circuits-types": "2.1.0-rc.
|
|
50
|
-
"@aztec/noir-test-contracts.js": "2.1.0-rc.
|
|
51
|
-
"@aztec/p2p": "2.1.0-rc.
|
|
52
|
-
"@aztec/protocol-contracts": "2.1.0-rc.
|
|
53
|
-
"@aztec/prover-client": "2.1.0-rc.
|
|
54
|
-
"@aztec/prover-node": "2.1.0-rc.
|
|
55
|
-
"@aztec/pxe": "2.1.0-rc.
|
|
56
|
-
"@aztec/sequencer-client": "2.1.0-rc.
|
|
57
|
-
"@aztec/simulator": "2.1.0-rc.
|
|
58
|
-
"@aztec/slasher": "2.1.0-rc.
|
|
59
|
-
"@aztec/stdlib": "2.1.0-rc.
|
|
60
|
-
"@aztec/telemetry-client": "2.1.0-rc.
|
|
61
|
-
"@aztec/validator-client": "2.1.0-rc.
|
|
62
|
-
"@aztec/world-state": "2.1.0-rc.
|
|
28
|
+
"@aztec/accounts": "2.1.0-rc.3",
|
|
29
|
+
"@aztec/archiver": "2.1.0-rc.3",
|
|
30
|
+
"@aztec/aztec": "2.1.0-rc.3",
|
|
31
|
+
"@aztec/aztec-node": "2.1.0-rc.3",
|
|
32
|
+
"@aztec/aztec.js": "2.1.0-rc.3",
|
|
33
|
+
"@aztec/bb-prover": "2.1.0-rc.3",
|
|
34
|
+
"@aztec/blob-lib": "2.1.0-rc.3",
|
|
35
|
+
"@aztec/blob-sink": "2.1.0-rc.3",
|
|
36
|
+
"@aztec/bot": "2.1.0-rc.3",
|
|
37
|
+
"@aztec/cli": "2.1.0-rc.3",
|
|
38
|
+
"@aztec/constants": "2.1.0-rc.3",
|
|
39
|
+
"@aztec/entrypoints": "2.1.0-rc.3",
|
|
40
|
+
"@aztec/epoch-cache": "2.1.0-rc.3",
|
|
41
|
+
"@aztec/ethereum": "2.1.0-rc.3",
|
|
42
|
+
"@aztec/foundation": "2.1.0-rc.3",
|
|
43
|
+
"@aztec/kv-store": "2.1.0-rc.3",
|
|
44
|
+
"@aztec/l1-artifacts": "2.1.0-rc.3",
|
|
45
|
+
"@aztec/merkle-tree": "2.1.0-rc.3",
|
|
46
|
+
"@aztec/node-keystore": "2.1.0-rc.3",
|
|
47
|
+
"@aztec/noir-contracts.js": "2.1.0-rc.3",
|
|
48
|
+
"@aztec/noir-noirc_abi": "2.1.0-rc.3",
|
|
49
|
+
"@aztec/noir-protocol-circuits-types": "2.1.0-rc.3",
|
|
50
|
+
"@aztec/noir-test-contracts.js": "2.1.0-rc.3",
|
|
51
|
+
"@aztec/p2p": "2.1.0-rc.3",
|
|
52
|
+
"@aztec/protocol-contracts": "2.1.0-rc.3",
|
|
53
|
+
"@aztec/prover-client": "2.1.0-rc.3",
|
|
54
|
+
"@aztec/prover-node": "2.1.0-rc.3",
|
|
55
|
+
"@aztec/pxe": "2.1.0-rc.3",
|
|
56
|
+
"@aztec/sequencer-client": "2.1.0-rc.3",
|
|
57
|
+
"@aztec/simulator": "2.1.0-rc.3",
|
|
58
|
+
"@aztec/slasher": "2.1.0-rc.3",
|
|
59
|
+
"@aztec/stdlib": "2.1.0-rc.3",
|
|
60
|
+
"@aztec/telemetry-client": "2.1.0-rc.3",
|
|
61
|
+
"@aztec/validator-client": "2.1.0-rc.3",
|
|
62
|
+
"@aztec/world-state": "2.1.0-rc.3",
|
|
63
63
|
"@iarna/toml": "^2.2.5",
|
|
64
64
|
"@jest/globals": "^30.0.0",
|
|
65
65
|
"@noble/curves": "=1.0.0",
|
|
@@ -18,7 +18,7 @@ import { randomBytes } from '@aztec/foundation/crypto';
|
|
|
18
18
|
import { withLogNameSuffix } from '@aztec/foundation/log';
|
|
19
19
|
import { SpamContract } from '@aztec/noir-test-contracts.js/Spam';
|
|
20
20
|
import { getMockPubSubP2PServiceFactory } from '@aztec/p2p/test-helpers';
|
|
21
|
-
import { ProverNode, ProverNodePublisher } from '@aztec/prover-node';
|
|
21
|
+
import { ProverNode, type ProverNodeConfig, ProverNodePublisher } from '@aztec/prover-node';
|
|
22
22
|
import type { TestProverNode } from '@aztec/prover-node/test';
|
|
23
23
|
import {
|
|
24
24
|
type SequencerClient,
|
|
@@ -128,9 +128,6 @@ export class EpochsTestContext {
|
|
|
128
128
|
// using the prover's eth address if the proverId is used for something in the rollup contract
|
|
129
129
|
// Use numeric EthAddress for deterministic prover id
|
|
130
130
|
proverId: EthAddress.fromNumber(1),
|
|
131
|
-
// This must be enough so that the tx from the prover is delayed properly,
|
|
132
|
-
// but not so much to hang the sequencer and timeout the teardown
|
|
133
|
-
txPropagationMaxQueryAttempts: opts.txPropagationMaxQueryAttempts ?? 12,
|
|
134
131
|
worldStateBlockHistory: WORLD_STATE_BLOCK_HISTORY,
|
|
135
132
|
exitDelaySeconds: DefaultL1ContractsConfig.exitDelaySeconds,
|
|
136
133
|
slasherFlavor: 'none',
|
|
@@ -187,15 +184,20 @@ export class EpochsTestContext {
|
|
|
187
184
|
await this.context.teardown();
|
|
188
185
|
}
|
|
189
186
|
|
|
190
|
-
public async createProverNode() {
|
|
187
|
+
public async createProverNode(opts: { dontStart?: boolean } & Partial<ProverNodeConfig> = {}) {
|
|
191
188
|
this.logger.warn('Creating and syncing a simulated prover node...');
|
|
192
189
|
const proverNodePrivateKey = this.getNextPrivateKey();
|
|
193
190
|
const suffix = (this.proverNodes.length + 1).toString();
|
|
191
|
+
const proverId = EthAddress.fromNumber(parseInt(suffix, 10));
|
|
194
192
|
const proverNode = await withLogNameSuffix(suffix, () =>
|
|
195
193
|
createAndSyncProverNode(
|
|
196
194
|
proverNodePrivateKey,
|
|
197
|
-
{ ...this.context.config, proverId
|
|
198
|
-
{
|
|
195
|
+
{ ...this.context.config, proverId },
|
|
196
|
+
{
|
|
197
|
+
dataDirectory: join(this.context.config.dataDirectory!, randomBytes(8).toString('hex')),
|
|
198
|
+
proverId,
|
|
199
|
+
...opts,
|
|
200
|
+
},
|
|
199
201
|
this.context.aztecNode,
|
|
200
202
|
undefined,
|
|
201
203
|
{ dateProvider: this.context.dateProvider },
|
|
@@ -427,7 +429,7 @@ export class EpochsTestContext {
|
|
|
427
429
|
sequencer.getSequencer().on(eventName, (args: Parameters<SequencerEvents[typeof eventName]>[0]) => {
|
|
428
430
|
const evt = makeEvent(i, eventName, args);
|
|
429
431
|
failEvents.push(evt);
|
|
430
|
-
this.logger.error(`Failed event ${eventName} from sequencer ${sequencerIndex}`, evt);
|
|
432
|
+
this.logger.error(`Failed event ${eventName} from sequencer ${sequencerIndex}`, undefined, evt);
|
|
431
433
|
});
|
|
432
434
|
});
|
|
433
435
|
});
|
|
@@ -157,9 +157,7 @@ export async function createKeyFile3(
|
|
|
157
157
|
schemaVersion: 1,
|
|
158
158
|
validators: [
|
|
159
159
|
{
|
|
160
|
-
attester:
|
|
161
|
-
address: validatorAddress.toChecksumString(),
|
|
162
|
-
},
|
|
160
|
+
attester: validatorAddress.toChecksumString(),
|
|
163
161
|
coinbase: coinbase.toChecksumString(),
|
|
164
162
|
publisher: [publisher1Key, publisher2Key],
|
|
165
163
|
feeRecipient: feeRecipient.toString(),
|
|
@@ -193,9 +191,7 @@ export async function createKeyFile4(
|
|
|
193
191
|
},
|
|
194
192
|
validators: [
|
|
195
193
|
{
|
|
196
|
-
attester:
|
|
197
|
-
address: validator1Address.toChecksumString(),
|
|
198
|
-
},
|
|
194
|
+
attester: validator1Address.toChecksumString(),
|
|
199
195
|
coinbase: coinbase1.toChecksumString(),
|
|
200
196
|
publisher: {
|
|
201
197
|
mnemonic: mnemonic,
|
|
@@ -206,9 +202,7 @@ export async function createKeyFile4(
|
|
|
206
202
|
feeRecipient: feeRecipient1.toString(),
|
|
207
203
|
},
|
|
208
204
|
{
|
|
209
|
-
attester:
|
|
210
|
-
address: validator2Address.toChecksumString(),
|
|
211
|
-
},
|
|
205
|
+
attester: validator2Address.toChecksumString(),
|
|
212
206
|
coinbase: coinbase2.toChecksumString(),
|
|
213
207
|
publisher: [publisher2Key, publisher3Key],
|
|
214
208
|
feeRecipient: feeRecipient2.toString(),
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import type { AztecNodeService } from '@aztec/aztec-node';
|
|
2
|
+
import { EthAddress } from '@aztec/aztec.js';
|
|
3
|
+
import { RollupContract } from '@aztec/ethereum';
|
|
4
|
+
|
|
5
|
+
import fs from 'fs';
|
|
6
|
+
import 'jest-extended';
|
|
7
|
+
import os from 'os';
|
|
8
|
+
import path from 'path';
|
|
9
|
+
|
|
10
|
+
import { createNodes } from '../fixtures/setup_p2p_test.js';
|
|
11
|
+
import { P2PNetworkTest } from './p2p_network.js';
|
|
12
|
+
|
|
13
|
+
const NUM_NODES = 6;
|
|
14
|
+
const NUM_VALIDATORS = NUM_NODES;
|
|
15
|
+
const COMMITTEE_SIZE = NUM_VALIDATORS;
|
|
16
|
+
const SLASHING_QUORUM = 3;
|
|
17
|
+
const EPOCH_DURATION = 2;
|
|
18
|
+
const SLASHING_ROUND_SIZE_IN_EPOCHS = 2;
|
|
19
|
+
const BOOT_NODE_UDP_PORT = 4500;
|
|
20
|
+
const ETHEREUM_SLOT_DURATION = 4;
|
|
21
|
+
const AZTEC_SLOT_DURATION = 8;
|
|
22
|
+
const SLASHING_UNIT = BigInt(1e18);
|
|
23
|
+
const SLASHING_AMOUNT = SLASHING_UNIT * 3n;
|
|
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
|
+
|
|
28
|
+
export class P2PInactivityTest {
|
|
29
|
+
public nodes!: AztecNodeService[];
|
|
30
|
+
public activeNodes!: AztecNodeService[];
|
|
31
|
+
public inactiveNodes!: AztecNodeService[];
|
|
32
|
+
|
|
33
|
+
public rollup!: RollupContract;
|
|
34
|
+
public offlineValidators!: EthAddress[];
|
|
35
|
+
|
|
36
|
+
private dataDir: string;
|
|
37
|
+
private inactiveNodeCount: number;
|
|
38
|
+
private keepInitialNode: boolean;
|
|
39
|
+
|
|
40
|
+
constructor(
|
|
41
|
+
public readonly test: P2PNetworkTest,
|
|
42
|
+
opts: { inactiveNodeCount: number; keepInitialNode?: boolean },
|
|
43
|
+
) {
|
|
44
|
+
this.dataDir = fs.mkdtempSync(path.join(os.tmpdir(), test.testName));
|
|
45
|
+
this.inactiveNodeCount = opts.inactiveNodeCount;
|
|
46
|
+
this.keepInitialNode = opts.keepInitialNode ?? false;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
static async create(
|
|
50
|
+
testName: string,
|
|
51
|
+
opts: { slashInactivityConsecutiveEpochThreshold: number; inactiveNodeCount: number; keepInitialNode?: boolean },
|
|
52
|
+
) {
|
|
53
|
+
const test = await P2PNetworkTest.create({
|
|
54
|
+
testName,
|
|
55
|
+
numberOfNodes: 0,
|
|
56
|
+
numberOfValidators: NUM_VALIDATORS,
|
|
57
|
+
basePort: BOOT_NODE_UDP_PORT,
|
|
58
|
+
startProverNode: true,
|
|
59
|
+
initialConfig: {
|
|
60
|
+
proverNodeConfig: { proverNodeEpochProvingDelayMs: AZTEC_SLOT_DURATION * 1000 },
|
|
61
|
+
aztecTargetCommitteeSize: COMMITTEE_SIZE,
|
|
62
|
+
aztecSlotDuration: AZTEC_SLOT_DURATION,
|
|
63
|
+
ethereumSlotDuration: ETHEREUM_SLOT_DURATION,
|
|
64
|
+
aztecProofSubmissionEpochs: 1024, // effectively do not reorg
|
|
65
|
+
listenAddress: '127.0.0.1',
|
|
66
|
+
minTxsPerBlock: 0,
|
|
67
|
+
aztecEpochDuration: EPOCH_DURATION,
|
|
68
|
+
validatorReexecute: false,
|
|
69
|
+
sentinelEnabled: true,
|
|
70
|
+
slashingQuorum: SLASHING_QUORUM,
|
|
71
|
+
slashingRoundSizeInEpochs: SLASHING_ROUND_SIZE_IN_EPOCHS,
|
|
72
|
+
slashInactivityTargetPercentage: 0.8,
|
|
73
|
+
slashGracePeriodL2Slots: SETUP_EPOCH_DURATION * EPOCH_DURATION, // do not slash during setup
|
|
74
|
+
slashAmountSmall: SLASHING_UNIT,
|
|
75
|
+
slashAmountMedium: SLASHING_UNIT * 2n,
|
|
76
|
+
slashAmountLarge: SLASHING_UNIT * 3n,
|
|
77
|
+
...opts,
|
|
78
|
+
},
|
|
79
|
+
});
|
|
80
|
+
return new P2PInactivityTest(test, opts);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
public async setup() {
|
|
84
|
+
await this.test.applyBaseSnapshots();
|
|
85
|
+
await this.test.setup();
|
|
86
|
+
|
|
87
|
+
// Set slashing penalties for inactivity
|
|
88
|
+
const { rollup } = await this.test.getContracts();
|
|
89
|
+
const [activationThreshold, ejectionThreshold, localEjectionThreshold] = await Promise.all([
|
|
90
|
+
rollup.getActivationThreshold(),
|
|
91
|
+
rollup.getEjectionThreshold(),
|
|
92
|
+
rollup.getLocalEjectionThreshold(),
|
|
93
|
+
]);
|
|
94
|
+
const biggestEjection = ejectionThreshold > localEjectionThreshold ? ejectionThreshold : localEjectionThreshold;
|
|
95
|
+
expect(activationThreshold - SLASHING_AMOUNT).toBeLessThan(biggestEjection);
|
|
96
|
+
this.test.ctx.aztecNodeConfig.slashInactivityPenalty = SLASHING_AMOUNT;
|
|
97
|
+
this.rollup = rollup;
|
|
98
|
+
|
|
99
|
+
if (!this.keepInitialNode) {
|
|
100
|
+
await this.test.ctx.aztecNode.stop();
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// Create all active nodes
|
|
104
|
+
this.activeNodes = await createNodes(
|
|
105
|
+
this.test.ctx.aztecNodeConfig,
|
|
106
|
+
this.test.ctx.dateProvider,
|
|
107
|
+
this.test.bootstrapNodeEnr,
|
|
108
|
+
NUM_NODES - this.inactiveNodeCount - Number(this.keepInitialNode),
|
|
109
|
+
BOOT_NODE_UDP_PORT,
|
|
110
|
+
this.test.prefilledPublicData,
|
|
111
|
+
this.dataDir,
|
|
112
|
+
undefined,
|
|
113
|
+
Number(this.keepInitialNode),
|
|
114
|
+
);
|
|
115
|
+
|
|
116
|
+
// And the ones with an initially disabled sequencer
|
|
117
|
+
const inactiveConfig = { ...this.test.ctx.aztecNodeConfig, dontStartSequencer: true };
|
|
118
|
+
this.inactiveNodes = await createNodes(
|
|
119
|
+
inactiveConfig,
|
|
120
|
+
this.test.ctx.dateProvider,
|
|
121
|
+
this.test.bootstrapNodeEnr,
|
|
122
|
+
this.inactiveNodeCount,
|
|
123
|
+
BOOT_NODE_UDP_PORT,
|
|
124
|
+
this.test.prefilledPublicData,
|
|
125
|
+
this.dataDir,
|
|
126
|
+
undefined,
|
|
127
|
+
NUM_NODES - this.inactiveNodeCount,
|
|
128
|
+
);
|
|
129
|
+
|
|
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
|
+
}
|
|
139
|
+
|
|
140
|
+
this.offlineValidators = this.test.validators
|
|
141
|
+
.slice(this.test.validators.length - this.inactiveNodeCount)
|
|
142
|
+
.map(a => a.attester);
|
|
143
|
+
|
|
144
|
+
this.test.logger.warn(`Setup complete. Offline validators are ${this.offlineValidators.join(', ')}.`, {
|
|
145
|
+
validators: this.test.validators,
|
|
146
|
+
offlineValidators: this.offlineValidators,
|
|
147
|
+
});
|
|
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
|
+
|
|
152
|
+
return this;
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
public async teardown() {
|
|
156
|
+
await this.test.stopNodes(this.nodes);
|
|
157
|
+
await this.test.teardown();
|
|
158
|
+
for (let i = 0; i < NUM_NODES; i++) {
|
|
159
|
+
fs.rmSync(`${this.dataDir}-${i}`, { recursive: true, force: true, maxRetries: 3 });
|
|
160
|
+
}
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
public get ctx() {
|
|
164
|
+
return this.test.ctx;
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
public get logger() {
|
|
168
|
+
return this.test.logger;
|
|
169
|
+
}
|
|
170
|
+
|
|
171
|
+
public get slashingAmount() {
|
|
172
|
+
return SLASHING_AMOUNT;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
@@ -43,7 +43,7 @@ import {
|
|
|
43
43
|
createSnapshotManager,
|
|
44
44
|
deployAccounts,
|
|
45
45
|
} from '../fixtures/snapshot_manager.js';
|
|
46
|
-
import { getPrivateKeyFromIndex, getSponsoredFPCAddress } from '../fixtures/utils.js';
|
|
46
|
+
import { type SetupOptions, getPrivateKeyFromIndex, getSponsoredFPCAddress } from '../fixtures/utils.js';
|
|
47
47
|
import { getEndToEndTestTelemetryClient } from '../fixtures/with_telemetry_utils.js';
|
|
48
48
|
|
|
49
49
|
// Use a fixed bootstrap node private key so that we can re-use the same snapshot and the nodes can find each other
|
|
@@ -82,11 +82,11 @@ export class P2PNetworkTest {
|
|
|
82
82
|
public bootstrapNode?: BootstrapNode;
|
|
83
83
|
|
|
84
84
|
constructor(
|
|
85
|
-
testName: string,
|
|
85
|
+
public readonly testName: string,
|
|
86
86
|
public bootstrapNodeEnr: string,
|
|
87
87
|
public bootNodePort: number,
|
|
88
88
|
public numberOfValidators: number,
|
|
89
|
-
initialValidatorConfig:
|
|
89
|
+
initialValidatorConfig: SetupOptions,
|
|
90
90
|
public numberOfNodes = 0,
|
|
91
91
|
// If set enable metrics collection
|
|
92
92
|
private metricsPort?: number,
|
|
@@ -162,7 +162,7 @@ export class P2PNetworkTest {
|
|
|
162
162
|
numberOfValidators: number;
|
|
163
163
|
basePort?: number;
|
|
164
164
|
metricsPort?: number;
|
|
165
|
-
initialConfig?:
|
|
165
|
+
initialConfig?: SetupOptions;
|
|
166
166
|
startProverNode?: boolean;
|
|
167
167
|
mockZkPassportVerifier?: boolean;
|
|
168
168
|
}) {
|
|
@@ -308,6 +308,7 @@ export class FullProverTest {
|
|
|
308
308
|
txGatheringMaxParallelRequestsPerNode: 100,
|
|
309
309
|
txGatheringTimeoutMs: 24_000,
|
|
310
310
|
proverNodeFailedEpochStore: undefined,
|
|
311
|
+
proverNodeEpochProvingDelayMs: undefined,
|
|
311
312
|
};
|
|
312
313
|
const sponsoredFPCAddress = await getSponsoredFPCAddress();
|
|
313
314
|
const { prefilledPublicData } = await getGenesisValues(
|
|
@@ -39,7 +39,7 @@ export function generatePrivateKeys(startIndex: number, numberOfKeys: number): `
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
export async function createNodes(
|
|
42
|
-
config: AztecNodeConfig,
|
|
42
|
+
config: AztecNodeConfig & { dontStartSequencer?: boolean },
|
|
43
43
|
dateProvider: DateProvider,
|
|
44
44
|
bootstrapNodeEnr: string,
|
|
45
45
|
numNodes: number,
|
|
@@ -88,7 +88,7 @@ export async function createNodes(
|
|
|
88
88
|
|
|
89
89
|
/** Creates a P2P enabled instance of Aztec Node Service with a validator */
|
|
90
90
|
export async function createNode(
|
|
91
|
-
config: AztecNodeConfig,
|
|
91
|
+
config: AztecNodeConfig & { dontStartSequencer?: boolean },
|
|
92
92
|
dateProvider: DateProvider,
|
|
93
93
|
tcpPort: number,
|
|
94
94
|
bootstrapNode: string | undefined,
|
|
@@ -101,7 +101,11 @@ export async function createNode(
|
|
|
101
101
|
const createNode = async () => {
|
|
102
102
|
const validatorConfig = await createValidatorConfig(config, bootstrapNode, tcpPort, addressIndex, dataDirectory);
|
|
103
103
|
const telemetry = getEndToEndTestTelemetryClient(metricsPort);
|
|
104
|
-
return await AztecNodeService.createAndSync(
|
|
104
|
+
return await AztecNodeService.createAndSync(
|
|
105
|
+
validatorConfig,
|
|
106
|
+
{ telemetry, dateProvider },
|
|
107
|
+
{ prefilledPublicData, dontStartSequencer: config.dontStartSequencer },
|
|
108
|
+
);
|
|
105
109
|
};
|
|
106
110
|
return loggerIdStorage ? await loggerIdStorage.run(tcpPort.toString(), createNode) : createNode();
|
|
107
111
|
}
|
|
@@ -333,14 +333,6 @@ async function setupFromFresh(
|
|
|
333
333
|
}
|
|
334
334
|
aztecNodeConfig.blobSinkUrl = `http://127.0.0.1:${blobSinkPort}`;
|
|
335
335
|
|
|
336
|
-
// Start anvil. We go via a wrapper script to ensure if the parent dies, anvil dies.
|
|
337
|
-
logger.verbose('Starting anvil...');
|
|
338
|
-
const res = await startAnvil({ l1BlockTime: opts.ethereumSlotDuration });
|
|
339
|
-
const anvil = res.anvil;
|
|
340
|
-
aztecNodeConfig.l1RpcUrls = [res.rpcUrl];
|
|
341
|
-
|
|
342
|
-
// Deploy our L1 contracts.
|
|
343
|
-
logger.verbose('Deploying L1 contracts...');
|
|
344
336
|
const hdAccount = mnemonicToAccount(MNEMONIC, { addressIndex: 0 });
|
|
345
337
|
const publisherPrivKeyRaw = hdAccount.getHdKey().privateKey;
|
|
346
338
|
const publisherPrivKey = publisherPrivKeyRaw === null ? null : Buffer.from(publisherPrivKeyRaw);
|
|
@@ -354,8 +346,17 @@ async function setupFromFresh(
|
|
|
354
346
|
aztecNodeConfig.validatorPrivateKeys = new SecretValue([`0x${validatorPrivKey!.toString('hex')}`]);
|
|
355
347
|
aztecNodeConfig.coinbase = opts.coinbase ?? EthAddress.fromString(`${hdAccount.address}`);
|
|
356
348
|
|
|
349
|
+
logger.info(`Setting up environment with config`, aztecNodeConfig);
|
|
350
|
+
|
|
351
|
+
// Start anvil. We go via a wrapper script to ensure if the parent dies, anvil dies.
|
|
352
|
+
logger.verbose('Starting anvil...');
|
|
353
|
+
const res = await startAnvil({ l1BlockTime: opts.ethereumSlotDuration });
|
|
354
|
+
const anvil = res.anvil;
|
|
355
|
+
aztecNodeConfig.l1RpcUrls = [res.rpcUrl];
|
|
357
356
|
const ethCheatCodes = new EthCheatCodesWithState(aztecNodeConfig.l1RpcUrls);
|
|
358
357
|
|
|
358
|
+
// Deploy our L1 contracts.
|
|
359
|
+
logger.verbose('Deploying L1 contracts...');
|
|
359
360
|
if (opts.l1StartTime) {
|
|
360
361
|
await ethCheatCodes.warp(opts.l1StartTime, { resetBlockInterval: true });
|
|
361
362
|
}
|
|
@@ -379,7 +380,6 @@ async function setupFromFresh(
|
|
|
379
380
|
});
|
|
380
381
|
aztecNodeConfig.l1Contracts = deployL1ContractsValues.l1ContractAddresses;
|
|
381
382
|
aztecNodeConfig.rollupVersion = deployL1ContractsValues.rollupVersion;
|
|
382
|
-
aztecNodeConfig.l1PublishRetryIntervalMS = 100;
|
|
383
383
|
|
|
384
384
|
const dateProvider = new TestDateProvider();
|
|
385
385
|
|
|
@@ -432,7 +432,11 @@ async function setupFromFresh(
|
|
|
432
432
|
proverNode = await createAndSyncProverNode(
|
|
433
433
|
`0x${proverNodePrivateKey!.toString('hex')}`,
|
|
434
434
|
aztecNodeConfig,
|
|
435
|
-
{
|
|
435
|
+
{
|
|
436
|
+
...aztecNodeConfig.proverNodeConfig,
|
|
437
|
+
dataDirectory: path.join(directoryToCleanup, randomBytes(8).toString('hex')),
|
|
438
|
+
p2pEnabled: false,
|
|
439
|
+
},
|
|
436
440
|
aztecNode,
|
|
437
441
|
prefilledPublicData,
|
|
438
442
|
);
|
|
@@ -558,7 +562,11 @@ async function setupFromState(statePath: string, logger: Logger): Promise<Subsys
|
|
|
558
562
|
proverNode = await createAndSyncProverNode(
|
|
559
563
|
proverNodePrivateKeyHex,
|
|
560
564
|
aztecNodeConfig,
|
|
561
|
-
{
|
|
565
|
+
{
|
|
566
|
+
...aztecNodeConfig.proverNodeConfig,
|
|
567
|
+
dataDirectory: path.join(directoryToCleanup, randomBytes(8).toString('hex')),
|
|
568
|
+
p2pEnabled: false,
|
|
569
|
+
},
|
|
562
570
|
aztecNode,
|
|
563
571
|
prefilledPublicData,
|
|
564
572
|
);
|
package/src/fixtures/utils.ts
CHANGED
|
@@ -576,7 +576,7 @@ export async function setup(
|
|
|
576
576
|
await blobSink.start();
|
|
577
577
|
config.blobSinkUrl = `http://localhost:${blobSinkPort}`;
|
|
578
578
|
|
|
579
|
-
logger.verbose('Creating and synching an aztec node
|
|
579
|
+
logger.verbose('Creating and synching an aztec node', config);
|
|
580
580
|
|
|
581
581
|
const acvmConfig = await getACVMConfig(logger);
|
|
582
582
|
if (acvmConfig) {
|
|
@@ -589,7 +589,6 @@ export async function setup(
|
|
|
589
589
|
config.bbBinaryPath = bbConfig.bbBinaryPath;
|
|
590
590
|
config.bbWorkingDirectory = bbConfig.bbWorkingDirectory;
|
|
591
591
|
}
|
|
592
|
-
config.l1PublishRetryIntervalMS = 100;
|
|
593
592
|
|
|
594
593
|
const blobSinkClient = createBlobSinkClient(config, { logger: createLogger('node:blob-sink:client') });
|
|
595
594
|
|
|
@@ -927,7 +926,7 @@ export async function waitForProvenChain(node: AztecNode, targetBlock?: number,
|
|
|
927
926
|
export function createAndSyncProverNode(
|
|
928
927
|
proverNodePrivateKey: `0x${string}`,
|
|
929
928
|
aztecNodeConfig: AztecNodeConfig,
|
|
930
|
-
proverNodeConfig: Partial<ProverNodeConfig> & Pick<DataStoreConfig, 'dataDirectory'
|
|
929
|
+
proverNodeConfig: Partial<ProverNodeConfig> & Pick<DataStoreConfig, 'dataDirectory'> & { dontStart?: boolean },
|
|
931
930
|
aztecNode: AztecNode | undefined,
|
|
932
931
|
prefilledPublicData: PublicDataTreeLeaf[] = [],
|
|
933
932
|
proverNodeDeps: ProverNodeDeps = {},
|
|
@@ -963,6 +962,7 @@ export function createAndSyncProverNode(
|
|
|
963
962
|
txGatheringTimeoutMs: 24_000,
|
|
964
963
|
proverNodeFailedEpochStore: undefined,
|
|
965
964
|
proverId: EthAddress.fromNumber(1),
|
|
965
|
+
proverNodeEpochProvingDelayMs: undefined,
|
|
966
966
|
...proverNodeConfig,
|
|
967
967
|
};
|
|
968
968
|
|
|
@@ -979,7 +979,9 @@ export function createAndSyncProverNode(
|
|
|
979
979
|
{ prefilledPublicData },
|
|
980
980
|
);
|
|
981
981
|
getLogger().info(`Created and synced prover node`, { publisherAddress: l1TxUtils.client.account!.address });
|
|
982
|
-
|
|
982
|
+
if (!proverNodeConfig.dontStart) {
|
|
983
|
+
await proverNode.start();
|
|
984
|
+
}
|
|
983
985
|
return proverNode;
|
|
984
986
|
});
|
|
985
987
|
}
|