@aztec/end-to-end 0.86.0-nightly.20250512 → 0.86.0-starknet.1
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.
|
@@ -7,10 +7,13 @@ import { ProverNode } from '@aztec/prover-node';
|
|
|
7
7
|
import type { L2BlockNumber } from '@aztec/stdlib/block';
|
|
8
8
|
import { type L1RollupConstants } from '@aztec/stdlib/epoch-helpers';
|
|
9
9
|
import { type EndToEndContext, type SetupOptions } from '../fixtures/utils.js';
|
|
10
|
+
export declare const L1_BLOCK_TIME_IN_S: number;
|
|
11
|
+
export declare const L2_SLOT_DURATION_IN_L1_SLOTS = 2;
|
|
12
|
+
export declare const L2_SLOT_DURATION_IN_S: number;
|
|
10
13
|
export declare const WORLD_STATE_BLOCK_HISTORY = 2;
|
|
11
14
|
export declare const WORLD_STATE_BLOCK_CHECK_INTERVAL = 50;
|
|
12
15
|
export declare const ARCHIVER_POLL_INTERVAL = 50;
|
|
13
|
-
export type EpochsTestOpts = Partial<Pick<SetupOptions, 'startProverNode' | 'aztecProofSubmissionWindow' | 'aztecEpochDuration' | 'proverTestDelayMs' | 'l1PublishRetryIntervalMS' | 'txPropagationMaxQueryAttempts' | 'proverNodeConfig'
|
|
16
|
+
export type EpochsTestOpts = Partial<Pick<SetupOptions, 'startProverNode' | 'aztecProofSubmissionWindow' | 'aztecEpochDuration' | 'proverTestDelayMs' | 'l1PublishRetryIntervalMS' | 'txPropagationMaxQueryAttempts' | 'proverNodeConfig'>>;
|
|
14
17
|
/**
|
|
15
18
|
* Tests building of epochs using fast block times and short epochs.
|
|
16
19
|
* Spawns an aztec node and a prover node with fake proofs.
|
|
@@ -28,15 +31,7 @@ export declare class EpochsTestContext {
|
|
|
28
31
|
proverNodes: ProverNode[];
|
|
29
32
|
nodes: AztecNodeService[];
|
|
30
33
|
epochDuration: number;
|
|
31
|
-
L1_BLOCK_TIME_IN_S: number;
|
|
32
|
-
L2_SLOT_DURATION_IN_S: number;
|
|
33
34
|
static setup(opts?: EpochsTestOpts): Promise<EpochsTestContext>;
|
|
34
|
-
static getSlotDurations(opts?: EpochsTestOpts): {
|
|
35
|
-
ethereumSlotDuration: number;
|
|
36
|
-
aztecSlotDuration: number;
|
|
37
|
-
aztecEpochDuration: number;
|
|
38
|
-
aztecProofSubmissionWindow: number;
|
|
39
|
-
};
|
|
40
35
|
setup(opts?: EpochsTestOpts): Promise<void>;
|
|
41
36
|
teardown(): Promise<void>;
|
|
42
37
|
createProverNode(): Promise<ProverNode>;
|
|
@@ -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,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,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,EAAE,KAAK,iBAAiB,EAAuC,MAAM,6BAA6B,CAAC;AAK1G,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,YAAY,EAIlB,MAAM,sBAAsB,CAAC;
|
|
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,KAAK,EAAE,UAAU,EAAE,MAAM,iBAAiB,CAAC;AAClD,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,EAAE,KAAK,iBAAiB,EAAuC,MAAM,6BAA6B,CAAC;AAK1G,OAAO,EACL,KAAK,eAAe,EACpB,KAAK,YAAY,EAIlB,MAAM,sBAAsB,CAAC;AAG9B,eAAO,MAAM,kBAAkB,QAAsE,CAAC;AACtG,eAAO,MAAM,4BAA4B,IAAI,CAAC;AAC9C,eAAO,MAAM,qBAAqB,QAAoD,CAAC;AAEvF,eAAO,MAAM,yBAAyB,IAAI,CAAC;AAC3C,eAAO,MAAM,gCAAgC,KAAK,CAAC;AACnD,eAAO,MAAM,sBAAsB,KAAK,CAAC;AAEzC,MAAM,MAAM,cAAc,GAAG,OAAO,CAClC,IAAI,CACF,YAAY,EACV,iBAAiB,GACjB,4BAA4B,GAC5B,oBAAoB,GACpB,mBAAmB,GACnB,0BAA0B,GAC1B,+BAA+B,GAC/B,kBAAkB,CACrB,CACF,CAAC;AAEF;;;;GAIG;AACH,qBAAa,iBAAiB;IACrB,OAAO,EAAG,eAAe,CAAC;IAC1B,QAAQ,EAAG,UAAU,CAAC;IACtB,MAAM,EAAG,cAAc,CAAC;IACxB,SAAS,EAAG,iBAAiB,CAAC;IAC9B,MAAM,EAAG,MAAM,CAAC;IAChB,OAAO,EAAG,YAAY,CAAC;IACvB,aAAa,EAAG,OAAO,CAAC;IACxB,gBAAgB,EAAG,OAAO,CAAC;IAE3B,WAAW,EAAE,UAAU,EAAE,CAAM;IAC/B,KAAK,EAAE,gBAAgB,EAAE,CAAM;IAE/B,aAAa,EAAG,MAAM,CAAC;WAEV,KAAK,CAAC,IAAI,GAAE,cAAmB;IAMtC,KAAK,CAAC,IAAI,GAAE,cAAmB;IAoE/B,QAAQ;IAOR,gBAAgB;IAgBhB,sBAAsB;IAcnC,OAAO,CAAC,iBAAiB;IAKzB,0FAA0F;IAC7E,oBAAoB,CAAC,KAAK,EAAE,MAAM;IAO/C,sDAAsD;IACzC,sBAAsB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,SAAK;IAShE,iEAAiE;IACpD,4BAA4B,CAAC,CAAC,EAAE,MAAM,EAAE,OAAO,SAAK;IAUjE,4EAA4E;IAC/D,mCAAmC,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM;IAO7E,mEAAmE;IACtD,iBAAiB,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,GAAG,UAAU;IAclF,0EAA0E;IAC7D,mBAAmB,CAAC,WAAW,EAAE,aAAa,EAAE,eAAe,EAAE,OAAO;CAUtF"}
|
|
@@ -7,6 +7,10 @@ import { withLogNameSuffix } from '@aztec/foundation/log';
|
|
|
7
7
|
import { getProofSubmissionDeadlineTimestamp } from '@aztec/stdlib/epoch-helpers';
|
|
8
8
|
import { join } from 'path';
|
|
9
9
|
import { createAndSyncProverNode, getPrivateKeyFromIndex, setup } from '../fixtures/utils.js';
|
|
10
|
+
// This can be lowered to as much as 2s in non-CI
|
|
11
|
+
export const L1_BLOCK_TIME_IN_S = process.env.L1_BLOCK_TIME ? parseInt(process.env.L1_BLOCK_TIME) : 8;
|
|
12
|
+
export const L2_SLOT_DURATION_IN_L1_SLOTS = 2;
|
|
13
|
+
export const L2_SLOT_DURATION_IN_S = L2_SLOT_DURATION_IN_L1_SLOTS * L1_BLOCK_TIME_IN_S;
|
|
10
14
|
export const WORLD_STATE_BLOCK_HISTORY = 2;
|
|
11
15
|
export const WORLD_STATE_BLOCK_CHECK_INTERVAL = 50;
|
|
12
16
|
export const ARCHIVER_POLL_INTERVAL = 50;
|
|
@@ -26,32 +30,16 @@ export const ARCHIVER_POLL_INTERVAL = 50;
|
|
|
26
30
|
proverNodes = [];
|
|
27
31
|
nodes = [];
|
|
28
32
|
epochDuration;
|
|
29
|
-
L1_BLOCK_TIME_IN_S;
|
|
30
|
-
L2_SLOT_DURATION_IN_S;
|
|
31
33
|
static async setup(opts = {}) {
|
|
32
34
|
const test = new EpochsTestContext();
|
|
33
35
|
await test.setup(opts);
|
|
34
36
|
return test;
|
|
35
37
|
}
|
|
36
|
-
static getSlotDurations(opts = {}) {
|
|
37
|
-
const envEthereumSlotDuration = process.env.L1_BLOCK_TIME ? parseInt(process.env.L1_BLOCK_TIME) : 8;
|
|
38
|
-
const ethereumSlotDuration = opts.ethereumSlotDuration ?? envEthereumSlotDuration;
|
|
39
|
-
const aztecSlotDuration = opts.aztecSlotDuration ?? ethereumSlotDuration * 2;
|
|
40
|
-
const aztecEpochDuration = opts.aztecEpochDuration ?? 4;
|
|
41
|
-
const aztecProofSubmissionWindow = opts.aztecProofSubmissionWindow ?? aztecEpochDuration * 2 - 1;
|
|
42
|
-
return {
|
|
43
|
-
ethereumSlotDuration,
|
|
44
|
-
aztecSlotDuration,
|
|
45
|
-
aztecEpochDuration,
|
|
46
|
-
aztecProofSubmissionWindow
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
38
|
async setup(opts = {}) {
|
|
50
|
-
const { ethereumSlotDuration, aztecSlotDuration, aztecEpochDuration, aztecProofSubmissionWindow } = EpochsTestContext.getSlotDurations(opts);
|
|
51
|
-
this.L1_BLOCK_TIME_IN_S = ethereumSlotDuration;
|
|
52
|
-
this.L2_SLOT_DURATION_IN_S = aztecSlotDuration;
|
|
53
39
|
// Set up system without any account nor protocol contracts
|
|
54
40
|
// and with faster block times and shorter epochs.
|
|
41
|
+
const aztecEpochDuration = opts.aztecEpochDuration ?? 4;
|
|
42
|
+
const proofSubmissionWindow = opts.aztecProofSubmissionWindow ?? aztecEpochDuration * 2 - 1;
|
|
55
43
|
const context = await setup(0, {
|
|
56
44
|
checkIntervalMs: 50,
|
|
57
45
|
archiverPollingIntervalMS: ARCHIVER_POLL_INTERVAL,
|
|
@@ -59,9 +47,9 @@ export const ARCHIVER_POLL_INTERVAL = 50;
|
|
|
59
47
|
skipProtocolContracts: true,
|
|
60
48
|
salt: 1,
|
|
61
49
|
aztecEpochDuration,
|
|
62
|
-
aztecSlotDuration,
|
|
63
|
-
ethereumSlotDuration,
|
|
64
|
-
aztecProofSubmissionWindow,
|
|
50
|
+
aztecSlotDuration: L1_BLOCK_TIME_IN_S * L2_SLOT_DURATION_IN_L1_SLOTS,
|
|
51
|
+
ethereumSlotDuration: L1_BLOCK_TIME_IN_S,
|
|
52
|
+
aztecProofSubmissionWindow: proofSubmissionWindow,
|
|
65
53
|
minTxsPerBlock: 0,
|
|
66
54
|
realProofs: false,
|
|
67
55
|
startProverNode: true,
|
|
@@ -71,7 +59,7 @@ export const ARCHIVER_POLL_INTERVAL = 50;
|
|
|
71
59
|
proverId: Fr.fromString('1'),
|
|
72
60
|
// This must be enough so that the tx from the prover is delayed properly,
|
|
73
61
|
// but not so much to hang the sequencer and timeout the teardown
|
|
74
|
-
txPropagationMaxQueryAttempts:
|
|
62
|
+
txPropagationMaxQueryAttempts: 12,
|
|
75
63
|
worldStateBlockHistory: WORLD_STATE_BLOCK_HISTORY,
|
|
76
64
|
...opts
|
|
77
65
|
});
|
|
@@ -98,11 +86,11 @@ export const ARCHIVER_POLL_INTERVAL = 50;
|
|
|
98
86
|
this.epochDuration = aztecEpochDuration;
|
|
99
87
|
this.constants = {
|
|
100
88
|
epochDuration: aztecEpochDuration,
|
|
101
|
-
slotDuration:
|
|
89
|
+
slotDuration: L1_BLOCK_TIME_IN_S * L2_SLOT_DURATION_IN_L1_SLOTS,
|
|
102
90
|
l1StartBlock: await this.rollup.getL1StartBlock(),
|
|
103
91
|
l1GenesisTime: await this.rollup.getL1GenesisTime(),
|
|
104
|
-
ethereumSlotDuration,
|
|
105
|
-
proofSubmissionWindow
|
|
92
|
+
ethereumSlotDuration: L1_BLOCK_TIME_IN_S,
|
|
93
|
+
proofSubmissionWindow
|
|
106
94
|
};
|
|
107
95
|
this.logger.info(`L2 genesis at L1 block ${this.constants.l1StartBlock} (timestamp ${this.constants.l1GenesisTime})`);
|
|
108
96
|
}
|
|
@@ -143,7 +131,7 @@ export const ARCHIVER_POLL_INTERVAL = 50;
|
|
|
143
131
|
/** Waits until the epoch begins (ie until the immediately previous L1 block is mined). */ async waitUntilEpochStarts(epoch) {
|
|
144
132
|
const [start] = getTimestampRangeForEpoch(BigInt(epoch), this.constants);
|
|
145
133
|
this.logger.info(`Waiting until L1 timestamp ${start} is reached as the start of epoch ${epoch}`);
|
|
146
|
-
await waitUntilL1Timestamp(this.l1Client, start - BigInt(
|
|
134
|
+
await waitUntilL1Timestamp(this.l1Client, start - BigInt(L1_BLOCK_TIME_IN_S));
|
|
147
135
|
return start;
|
|
148
136
|
}
|
|
149
137
|
/** Waits until the given L2 block number is mined. */ async waitUntilL2BlockNumber(target, timeout = 60) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/end-to-end",
|
|
3
|
-
"version": "0.86.0-
|
|
3
|
+
"version": "0.86.0-starknet.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": "./dest/index.js",
|
|
6
6
|
"inherits": [
|
|
@@ -25,39 +25,39 @@
|
|
|
25
25
|
"formatting": "run -T prettier --check ./src && run -T eslint ./src"
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
|
-
"@aztec/accounts": "0.86.0-
|
|
29
|
-
"@aztec/archiver": "0.86.0-
|
|
30
|
-
"@aztec/aztec": "0.86.0-
|
|
31
|
-
"@aztec/aztec-node": "0.86.0-
|
|
32
|
-
"@aztec/aztec.js": "0.86.0-
|
|
33
|
-
"@aztec/bb-prover": "0.86.0-
|
|
34
|
-
"@aztec/blob-lib": "0.86.0-
|
|
35
|
-
"@aztec/blob-sink": "0.86.0-
|
|
36
|
-
"@aztec/bot": "0.86.0-
|
|
37
|
-
"@aztec/cli": "0.86.0-
|
|
38
|
-
"@aztec/constants": "0.86.0-
|
|
39
|
-
"@aztec/entrypoints": "0.86.0-
|
|
40
|
-
"@aztec/epoch-cache": "0.86.0-
|
|
41
|
-
"@aztec/ethereum": "0.86.0-
|
|
42
|
-
"@aztec/foundation": "0.86.0-
|
|
43
|
-
"@aztec/kv-store": "0.86.0-
|
|
44
|
-
"@aztec/l1-artifacts": "0.86.0-
|
|
45
|
-
"@aztec/merkle-tree": "0.86.0-
|
|
46
|
-
"@aztec/noir-contracts.js": "0.86.0-
|
|
47
|
-
"@aztec/noir-noirc_abi": "0.86.0-
|
|
48
|
-
"@aztec/noir-protocol-circuits-types": "0.86.0-
|
|
49
|
-
"@aztec/noir-test-contracts.js": "0.86.0-
|
|
50
|
-
"@aztec/p2p": "0.86.0-
|
|
51
|
-
"@aztec/protocol-contracts": "0.86.0-
|
|
52
|
-
"@aztec/prover-client": "0.86.0-
|
|
53
|
-
"@aztec/prover-node": "0.86.0-
|
|
54
|
-
"@aztec/pxe": "0.86.0-
|
|
55
|
-
"@aztec/sequencer-client": "0.86.0-
|
|
56
|
-
"@aztec/simulator": "0.86.0-
|
|
57
|
-
"@aztec/stdlib": "0.86.0-
|
|
58
|
-
"@aztec/telemetry-client": "0.86.0-
|
|
59
|
-
"@aztec/validator-client": "0.86.0-
|
|
60
|
-
"@aztec/world-state": "0.86.0-
|
|
28
|
+
"@aztec/accounts": "0.86.0-starknet.1",
|
|
29
|
+
"@aztec/archiver": "0.86.0-starknet.1",
|
|
30
|
+
"@aztec/aztec": "0.86.0-starknet.1",
|
|
31
|
+
"@aztec/aztec-node": "0.86.0-starknet.1",
|
|
32
|
+
"@aztec/aztec.js": "0.86.0-starknet.1",
|
|
33
|
+
"@aztec/bb-prover": "0.86.0-starknet.1",
|
|
34
|
+
"@aztec/blob-lib": "0.86.0-starknet.1",
|
|
35
|
+
"@aztec/blob-sink": "0.86.0-starknet.1",
|
|
36
|
+
"@aztec/bot": "0.86.0-starknet.1",
|
|
37
|
+
"@aztec/cli": "0.86.0-starknet.1",
|
|
38
|
+
"@aztec/constants": "0.86.0-starknet.1",
|
|
39
|
+
"@aztec/entrypoints": "0.86.0-starknet.1",
|
|
40
|
+
"@aztec/epoch-cache": "0.86.0-starknet.1",
|
|
41
|
+
"@aztec/ethereum": "0.86.0-starknet.1",
|
|
42
|
+
"@aztec/foundation": "0.86.0-starknet.1",
|
|
43
|
+
"@aztec/kv-store": "0.86.0-starknet.1",
|
|
44
|
+
"@aztec/l1-artifacts": "0.86.0-starknet.1",
|
|
45
|
+
"@aztec/merkle-tree": "0.86.0-starknet.1",
|
|
46
|
+
"@aztec/noir-contracts.js": "0.86.0-starknet.1",
|
|
47
|
+
"@aztec/noir-noirc_abi": "0.86.0-starknet.1",
|
|
48
|
+
"@aztec/noir-protocol-circuits-types": "0.86.0-starknet.1",
|
|
49
|
+
"@aztec/noir-test-contracts.js": "0.86.0-starknet.1",
|
|
50
|
+
"@aztec/p2p": "0.86.0-starknet.1",
|
|
51
|
+
"@aztec/protocol-contracts": "0.86.0-starknet.1",
|
|
52
|
+
"@aztec/prover-client": "0.86.0-starknet.1",
|
|
53
|
+
"@aztec/prover-node": "0.86.0-starknet.1",
|
|
54
|
+
"@aztec/pxe": "0.86.0-starknet.1",
|
|
55
|
+
"@aztec/sequencer-client": "0.86.0-starknet.1",
|
|
56
|
+
"@aztec/simulator": "0.86.0-starknet.1",
|
|
57
|
+
"@aztec/stdlib": "0.86.0-starknet.1",
|
|
58
|
+
"@aztec/telemetry-client": "0.86.0-starknet.1",
|
|
59
|
+
"@aztec/validator-client": "0.86.0-starknet.1",
|
|
60
|
+
"@aztec/world-state": "0.86.0-starknet.1",
|
|
61
61
|
"@iarna/toml": "^2.2.5",
|
|
62
62
|
"@jest/globals": "^29.5.0",
|
|
63
63
|
"@noble/curves": "^1.0.0",
|
|
@@ -23,6 +23,11 @@ import {
|
|
|
23
23
|
setup,
|
|
24
24
|
} from '../fixtures/utils.js';
|
|
25
25
|
|
|
26
|
+
// This can be lowered to as much as 2s in non-CI
|
|
27
|
+
export const L1_BLOCK_TIME_IN_S = process.env.L1_BLOCK_TIME ? parseInt(process.env.L1_BLOCK_TIME) : 8;
|
|
28
|
+
export const L2_SLOT_DURATION_IN_L1_SLOTS = 2;
|
|
29
|
+
export const L2_SLOT_DURATION_IN_S = L2_SLOT_DURATION_IN_L1_SLOTS * L1_BLOCK_TIME_IN_S;
|
|
30
|
+
|
|
26
31
|
export const WORLD_STATE_BLOCK_HISTORY = 2;
|
|
27
32
|
export const WORLD_STATE_BLOCK_CHECK_INTERVAL = 50;
|
|
28
33
|
export const ARCHIVER_POLL_INTERVAL = 50;
|
|
@@ -37,8 +42,6 @@ export type EpochsTestOpts = Partial<
|
|
|
37
42
|
| 'l1PublishRetryIntervalMS'
|
|
38
43
|
| 'txPropagationMaxQueryAttempts'
|
|
39
44
|
| 'proverNodeConfig'
|
|
40
|
-
| 'ethereumSlotDuration'
|
|
41
|
-
| 'aztecSlotDuration'
|
|
42
45
|
>
|
|
43
46
|
>;
|
|
44
47
|
|
|
@@ -62,33 +65,17 @@ export class EpochsTestContext {
|
|
|
62
65
|
|
|
63
66
|
public epochDuration!: number;
|
|
64
67
|
|
|
65
|
-
public L1_BLOCK_TIME_IN_S!: number;
|
|
66
|
-
public L2_SLOT_DURATION_IN_S!: number;
|
|
67
|
-
|
|
68
68
|
public static async setup(opts: EpochsTestOpts = {}) {
|
|
69
69
|
const test = new EpochsTestContext();
|
|
70
70
|
await test.setup(opts);
|
|
71
71
|
return test;
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
public static getSlotDurations(opts: EpochsTestOpts = {}) {
|
|
75
|
-
const envEthereumSlotDuration = process.env.L1_BLOCK_TIME ? parseInt(process.env.L1_BLOCK_TIME) : 8;
|
|
76
|
-
const ethereumSlotDuration = opts.ethereumSlotDuration ?? envEthereumSlotDuration;
|
|
77
|
-
const aztecSlotDuration = opts.aztecSlotDuration ?? ethereumSlotDuration * 2;
|
|
78
|
-
const aztecEpochDuration = opts.aztecEpochDuration ?? 4;
|
|
79
|
-
const aztecProofSubmissionWindow = opts.aztecProofSubmissionWindow ?? aztecEpochDuration * 2 - 1;
|
|
80
|
-
return { ethereumSlotDuration, aztecSlotDuration, aztecEpochDuration, aztecProofSubmissionWindow };
|
|
81
|
-
}
|
|
82
|
-
|
|
83
74
|
public async setup(opts: EpochsTestOpts = {}) {
|
|
84
|
-
const { ethereumSlotDuration, aztecSlotDuration, aztecEpochDuration, aztecProofSubmissionWindow } =
|
|
85
|
-
EpochsTestContext.getSlotDurations(opts);
|
|
86
|
-
|
|
87
|
-
this.L1_BLOCK_TIME_IN_S = ethereumSlotDuration;
|
|
88
|
-
this.L2_SLOT_DURATION_IN_S = aztecSlotDuration;
|
|
89
|
-
|
|
90
75
|
// Set up system without any account nor protocol contracts
|
|
91
76
|
// and with faster block times and shorter epochs.
|
|
77
|
+
const aztecEpochDuration = opts.aztecEpochDuration ?? 4;
|
|
78
|
+
const proofSubmissionWindow = opts.aztecProofSubmissionWindow ?? aztecEpochDuration * 2 - 1;
|
|
92
79
|
const context = await setup(0, {
|
|
93
80
|
checkIntervalMs: 50,
|
|
94
81
|
archiverPollingIntervalMS: ARCHIVER_POLL_INTERVAL,
|
|
@@ -96,9 +83,9 @@ export class EpochsTestContext {
|
|
|
96
83
|
skipProtocolContracts: true,
|
|
97
84
|
salt: 1,
|
|
98
85
|
aztecEpochDuration,
|
|
99
|
-
aztecSlotDuration,
|
|
100
|
-
ethereumSlotDuration,
|
|
101
|
-
aztecProofSubmissionWindow,
|
|
86
|
+
aztecSlotDuration: L1_BLOCK_TIME_IN_S * L2_SLOT_DURATION_IN_L1_SLOTS,
|
|
87
|
+
ethereumSlotDuration: L1_BLOCK_TIME_IN_S,
|
|
88
|
+
aztecProofSubmissionWindow: proofSubmissionWindow,
|
|
102
89
|
minTxsPerBlock: 0,
|
|
103
90
|
realProofs: false,
|
|
104
91
|
startProverNode: true,
|
|
@@ -108,7 +95,7 @@ export class EpochsTestContext {
|
|
|
108
95
|
proverId: Fr.fromString('1'),
|
|
109
96
|
// This must be enough so that the tx from the prover is delayed properly,
|
|
110
97
|
// but not so much to hang the sequencer and timeout the teardown
|
|
111
|
-
txPropagationMaxQueryAttempts:
|
|
98
|
+
txPropagationMaxQueryAttempts: 12,
|
|
112
99
|
worldStateBlockHistory: WORLD_STATE_BLOCK_HISTORY,
|
|
113
100
|
...opts,
|
|
114
101
|
});
|
|
@@ -140,11 +127,11 @@ export class EpochsTestContext {
|
|
|
140
127
|
this.epochDuration = aztecEpochDuration;
|
|
141
128
|
this.constants = {
|
|
142
129
|
epochDuration: aztecEpochDuration,
|
|
143
|
-
slotDuration:
|
|
130
|
+
slotDuration: L1_BLOCK_TIME_IN_S * L2_SLOT_DURATION_IN_L1_SLOTS,
|
|
144
131
|
l1StartBlock: await this.rollup.getL1StartBlock(),
|
|
145
132
|
l1GenesisTime: await this.rollup.getL1GenesisTime(),
|
|
146
|
-
ethereumSlotDuration,
|
|
147
|
-
proofSubmissionWindow
|
|
133
|
+
ethereumSlotDuration: L1_BLOCK_TIME_IN_S,
|
|
134
|
+
proofSubmissionWindow,
|
|
148
135
|
};
|
|
149
136
|
|
|
150
137
|
this.logger.info(
|
|
@@ -198,7 +185,7 @@ export class EpochsTestContext {
|
|
|
198
185
|
public async waitUntilEpochStarts(epoch: number) {
|
|
199
186
|
const [start] = getTimestampRangeForEpoch(BigInt(epoch), this.constants);
|
|
200
187
|
this.logger.info(`Waiting until L1 timestamp ${start} is reached as the start of epoch ${epoch}`);
|
|
201
|
-
await waitUntilL1Timestamp(this.l1Client, start - BigInt(
|
|
188
|
+
await waitUntilL1Timestamp(this.l1Client, start - BigInt(L1_BLOCK_TIME_IN_S));
|
|
202
189
|
return start;
|
|
203
190
|
}
|
|
204
191
|
|