@aztec/end-to-end 0.86.0-nightly.20250509 → 0.86.0-nightly.20250510
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,13 +7,10 @@ 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;
|
|
13
10
|
export declare const WORLD_STATE_BLOCK_HISTORY = 2;
|
|
14
11
|
export declare const WORLD_STATE_BLOCK_CHECK_INTERVAL = 50;
|
|
15
12
|
export declare const ARCHIVER_POLL_INTERVAL = 50;
|
|
16
|
-
export type EpochsTestOpts = Partial<Pick<SetupOptions, 'startProverNode' | 'aztecProofSubmissionWindow' | 'aztecEpochDuration' | 'proverTestDelayMs' | 'l1PublishRetryIntervalMS' | 'txPropagationMaxQueryAttempts' | 'proverNodeConfig'>>;
|
|
13
|
+
export type EpochsTestOpts = Partial<Pick<SetupOptions, 'startProverNode' | 'aztecProofSubmissionWindow' | 'aztecEpochDuration' | 'proverTestDelayMs' | 'l1PublishRetryIntervalMS' | 'txPropagationMaxQueryAttempts' | 'proverNodeConfig' | 'ethereumSlotDuration' | 'aztecSlotDuration'>>;
|
|
17
14
|
/**
|
|
18
15
|
* Tests building of epochs using fast block times and short epochs.
|
|
19
16
|
* Spawns an aztec node and a prover node with fake proofs.
|
|
@@ -31,7 +28,15 @@ export declare class EpochsTestContext {
|
|
|
31
28
|
proverNodes: ProverNode[];
|
|
32
29
|
nodes: AztecNodeService[];
|
|
33
30
|
epochDuration: number;
|
|
31
|
+
L1_BLOCK_TIME_IN_S: number;
|
|
32
|
+
L2_SLOT_DURATION_IN_S: number;
|
|
34
33
|
static setup(opts?: EpochsTestOpts): Promise<EpochsTestContext>;
|
|
34
|
+
static getSlotDurations(opts?: EpochsTestOpts): {
|
|
35
|
+
ethereumSlotDuration: number;
|
|
36
|
+
aztecSlotDuration: number;
|
|
37
|
+
aztecEpochDuration: number;
|
|
38
|
+
aztecProofSubmissionWindow: number;
|
|
39
|
+
};
|
|
35
40
|
setup(opts?: EpochsTestOpts): Promise<void>;
|
|
36
41
|
teardown(): Promise<void>;
|
|
37
42
|
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;AAE9B,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,GAClB,sBAAsB,GACtB,mBAAmB,CACtB,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;IAEvB,kBAAkB,EAAG,MAAM,CAAC;IAC5B,qBAAqB,EAAG,MAAM,CAAC;WAElB,KAAK,CAAC,IAAI,GAAE,cAAmB;WAMrC,gBAAgB,CAAC,IAAI,GAAE,cAAmB;;;;;;IAS3C,KAAK,CAAC,IAAI,GAAE,cAAmB;IAwE/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,10 +7,6 @@ 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;
|
|
14
10
|
export const WORLD_STATE_BLOCK_HISTORY = 2;
|
|
15
11
|
export const WORLD_STATE_BLOCK_CHECK_INTERVAL = 50;
|
|
16
12
|
export const ARCHIVER_POLL_INTERVAL = 50;
|
|
@@ -30,16 +26,32 @@ export const ARCHIVER_POLL_INTERVAL = 50;
|
|
|
30
26
|
proverNodes = [];
|
|
31
27
|
nodes = [];
|
|
32
28
|
epochDuration;
|
|
29
|
+
L1_BLOCK_TIME_IN_S;
|
|
30
|
+
L2_SLOT_DURATION_IN_S;
|
|
33
31
|
static async setup(opts = {}) {
|
|
34
32
|
const test = new EpochsTestContext();
|
|
35
33
|
await test.setup(opts);
|
|
36
34
|
return test;
|
|
37
35
|
}
|
|
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
|
+
}
|
|
38
49
|
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;
|
|
39
53
|
// Set up system without any account nor protocol contracts
|
|
40
54
|
// and with faster block times and shorter epochs.
|
|
41
|
-
const aztecEpochDuration = opts.aztecEpochDuration ?? 4;
|
|
42
|
-
const proofSubmissionWindow = opts.aztecProofSubmissionWindow ?? aztecEpochDuration * 2 - 1;
|
|
43
55
|
const context = await setup(0, {
|
|
44
56
|
checkIntervalMs: 50,
|
|
45
57
|
archiverPollingIntervalMS: ARCHIVER_POLL_INTERVAL,
|
|
@@ -47,9 +59,9 @@ export const ARCHIVER_POLL_INTERVAL = 50;
|
|
|
47
59
|
skipProtocolContracts: true,
|
|
48
60
|
salt: 1,
|
|
49
61
|
aztecEpochDuration,
|
|
50
|
-
aztecSlotDuration
|
|
51
|
-
ethereumSlotDuration
|
|
52
|
-
aztecProofSubmissionWindow
|
|
62
|
+
aztecSlotDuration,
|
|
63
|
+
ethereumSlotDuration,
|
|
64
|
+
aztecProofSubmissionWindow,
|
|
53
65
|
minTxsPerBlock: 0,
|
|
54
66
|
realProofs: false,
|
|
55
67
|
startProverNode: true,
|
|
@@ -86,11 +98,11 @@ export const ARCHIVER_POLL_INTERVAL = 50;
|
|
|
86
98
|
this.epochDuration = aztecEpochDuration;
|
|
87
99
|
this.constants = {
|
|
88
100
|
epochDuration: aztecEpochDuration,
|
|
89
|
-
slotDuration:
|
|
101
|
+
slotDuration: aztecSlotDuration,
|
|
90
102
|
l1StartBlock: await this.rollup.getL1StartBlock(),
|
|
91
103
|
l1GenesisTime: await this.rollup.getL1GenesisTime(),
|
|
92
|
-
ethereumSlotDuration
|
|
93
|
-
proofSubmissionWindow
|
|
104
|
+
ethereumSlotDuration,
|
|
105
|
+
proofSubmissionWindow: aztecProofSubmissionWindow
|
|
94
106
|
};
|
|
95
107
|
this.logger.info(`L2 genesis at L1 block ${this.constants.l1StartBlock} (timestamp ${this.constants.l1GenesisTime})`);
|
|
96
108
|
}
|
|
@@ -131,7 +143,7 @@ export const ARCHIVER_POLL_INTERVAL = 50;
|
|
|
131
143
|
/** Waits until the epoch begins (ie until the immediately previous L1 block is mined). */ async waitUntilEpochStarts(epoch) {
|
|
132
144
|
const [start] = getTimestampRangeForEpoch(BigInt(epoch), this.constants);
|
|
133
145
|
this.logger.info(`Waiting until L1 timestamp ${start} is reached as the start of epoch ${epoch}`);
|
|
134
|
-
await waitUntilL1Timestamp(this.l1Client, start - BigInt(L1_BLOCK_TIME_IN_S));
|
|
146
|
+
await waitUntilL1Timestamp(this.l1Client, start - BigInt(this.L1_BLOCK_TIME_IN_S));
|
|
135
147
|
return start;
|
|
136
148
|
}
|
|
137
149
|
/** 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-nightly.
|
|
3
|
+
"version": "0.86.0-nightly.20250510",
|
|
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-nightly.
|
|
29
|
-
"@aztec/archiver": "0.86.0-nightly.
|
|
30
|
-
"@aztec/aztec": "0.86.0-nightly.
|
|
31
|
-
"@aztec/aztec-node": "0.86.0-nightly.
|
|
32
|
-
"@aztec/aztec.js": "0.86.0-nightly.
|
|
33
|
-
"@aztec/bb-prover": "0.86.0-nightly.
|
|
34
|
-
"@aztec/blob-lib": "0.86.0-nightly.
|
|
35
|
-
"@aztec/blob-sink": "0.86.0-nightly.
|
|
36
|
-
"@aztec/bot": "0.86.0-nightly.
|
|
37
|
-
"@aztec/cli": "0.86.0-nightly.
|
|
38
|
-
"@aztec/constants": "0.86.0-nightly.
|
|
39
|
-
"@aztec/entrypoints": "0.86.0-nightly.
|
|
40
|
-
"@aztec/epoch-cache": "0.86.0-nightly.
|
|
41
|
-
"@aztec/ethereum": "0.86.0-nightly.
|
|
42
|
-
"@aztec/foundation": "0.86.0-nightly.
|
|
43
|
-
"@aztec/kv-store": "0.86.0-nightly.
|
|
44
|
-
"@aztec/l1-artifacts": "0.86.0-nightly.
|
|
45
|
-
"@aztec/merkle-tree": "0.86.0-nightly.
|
|
46
|
-
"@aztec/noir-contracts.js": "0.86.0-nightly.
|
|
47
|
-
"@aztec/noir-noirc_abi": "0.86.0-nightly.
|
|
48
|
-
"@aztec/noir-protocol-circuits-types": "0.86.0-nightly.
|
|
49
|
-
"@aztec/noir-test-contracts.js": "0.86.0-nightly.
|
|
50
|
-
"@aztec/p2p": "0.86.0-nightly.
|
|
51
|
-
"@aztec/protocol-contracts": "0.86.0-nightly.
|
|
52
|
-
"@aztec/prover-client": "0.86.0-nightly.
|
|
53
|
-
"@aztec/prover-node": "0.86.0-nightly.
|
|
54
|
-
"@aztec/pxe": "0.86.0-nightly.
|
|
55
|
-
"@aztec/sequencer-client": "0.86.0-nightly.
|
|
56
|
-
"@aztec/simulator": "0.86.0-nightly.
|
|
57
|
-
"@aztec/stdlib": "0.86.0-nightly.
|
|
58
|
-
"@aztec/telemetry-client": "0.86.0-nightly.
|
|
59
|
-
"@aztec/validator-client": "0.86.0-nightly.
|
|
60
|
-
"@aztec/world-state": "0.86.0-nightly.
|
|
28
|
+
"@aztec/accounts": "0.86.0-nightly.20250510",
|
|
29
|
+
"@aztec/archiver": "0.86.0-nightly.20250510",
|
|
30
|
+
"@aztec/aztec": "0.86.0-nightly.20250510",
|
|
31
|
+
"@aztec/aztec-node": "0.86.0-nightly.20250510",
|
|
32
|
+
"@aztec/aztec.js": "0.86.0-nightly.20250510",
|
|
33
|
+
"@aztec/bb-prover": "0.86.0-nightly.20250510",
|
|
34
|
+
"@aztec/blob-lib": "0.86.0-nightly.20250510",
|
|
35
|
+
"@aztec/blob-sink": "0.86.0-nightly.20250510",
|
|
36
|
+
"@aztec/bot": "0.86.0-nightly.20250510",
|
|
37
|
+
"@aztec/cli": "0.86.0-nightly.20250510",
|
|
38
|
+
"@aztec/constants": "0.86.0-nightly.20250510",
|
|
39
|
+
"@aztec/entrypoints": "0.86.0-nightly.20250510",
|
|
40
|
+
"@aztec/epoch-cache": "0.86.0-nightly.20250510",
|
|
41
|
+
"@aztec/ethereum": "0.86.0-nightly.20250510",
|
|
42
|
+
"@aztec/foundation": "0.86.0-nightly.20250510",
|
|
43
|
+
"@aztec/kv-store": "0.86.0-nightly.20250510",
|
|
44
|
+
"@aztec/l1-artifacts": "0.86.0-nightly.20250510",
|
|
45
|
+
"@aztec/merkle-tree": "0.86.0-nightly.20250510",
|
|
46
|
+
"@aztec/noir-contracts.js": "0.86.0-nightly.20250510",
|
|
47
|
+
"@aztec/noir-noirc_abi": "0.86.0-nightly.20250510",
|
|
48
|
+
"@aztec/noir-protocol-circuits-types": "0.86.0-nightly.20250510",
|
|
49
|
+
"@aztec/noir-test-contracts.js": "0.86.0-nightly.20250510",
|
|
50
|
+
"@aztec/p2p": "0.86.0-nightly.20250510",
|
|
51
|
+
"@aztec/protocol-contracts": "0.86.0-nightly.20250510",
|
|
52
|
+
"@aztec/prover-client": "0.86.0-nightly.20250510",
|
|
53
|
+
"@aztec/prover-node": "0.86.0-nightly.20250510",
|
|
54
|
+
"@aztec/pxe": "0.86.0-nightly.20250510",
|
|
55
|
+
"@aztec/sequencer-client": "0.86.0-nightly.20250510",
|
|
56
|
+
"@aztec/simulator": "0.86.0-nightly.20250510",
|
|
57
|
+
"@aztec/stdlib": "0.86.0-nightly.20250510",
|
|
58
|
+
"@aztec/telemetry-client": "0.86.0-nightly.20250510",
|
|
59
|
+
"@aztec/validator-client": "0.86.0-nightly.20250510",
|
|
60
|
+
"@aztec/world-state": "0.86.0-nightly.20250510",
|
|
61
61
|
"@iarna/toml": "^2.2.5",
|
|
62
62
|
"@jest/globals": "^29.5.0",
|
|
63
63
|
"@noble/curves": "^1.0.0",
|
|
@@ -23,11 +23,6 @@ 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
|
-
|
|
31
26
|
export const WORLD_STATE_BLOCK_HISTORY = 2;
|
|
32
27
|
export const WORLD_STATE_BLOCK_CHECK_INTERVAL = 50;
|
|
33
28
|
export const ARCHIVER_POLL_INTERVAL = 50;
|
|
@@ -42,6 +37,8 @@ export type EpochsTestOpts = Partial<
|
|
|
42
37
|
| 'l1PublishRetryIntervalMS'
|
|
43
38
|
| 'txPropagationMaxQueryAttempts'
|
|
44
39
|
| 'proverNodeConfig'
|
|
40
|
+
| 'ethereumSlotDuration'
|
|
41
|
+
| 'aztecSlotDuration'
|
|
45
42
|
>
|
|
46
43
|
>;
|
|
47
44
|
|
|
@@ -65,17 +62,33 @@ export class EpochsTestContext {
|
|
|
65
62
|
|
|
66
63
|
public epochDuration!: number;
|
|
67
64
|
|
|
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
|
+
|
|
74
83
|
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
|
+
|
|
75
90
|
// Set up system without any account nor protocol contracts
|
|
76
91
|
// and with faster block times and shorter epochs.
|
|
77
|
-
const aztecEpochDuration = opts.aztecEpochDuration ?? 4;
|
|
78
|
-
const proofSubmissionWindow = opts.aztecProofSubmissionWindow ?? aztecEpochDuration * 2 - 1;
|
|
79
92
|
const context = await setup(0, {
|
|
80
93
|
checkIntervalMs: 50,
|
|
81
94
|
archiverPollingIntervalMS: ARCHIVER_POLL_INTERVAL,
|
|
@@ -83,9 +96,9 @@ export class EpochsTestContext {
|
|
|
83
96
|
skipProtocolContracts: true,
|
|
84
97
|
salt: 1,
|
|
85
98
|
aztecEpochDuration,
|
|
86
|
-
aztecSlotDuration
|
|
87
|
-
ethereumSlotDuration
|
|
88
|
-
aztecProofSubmissionWindow
|
|
99
|
+
aztecSlotDuration,
|
|
100
|
+
ethereumSlotDuration,
|
|
101
|
+
aztecProofSubmissionWindow,
|
|
89
102
|
minTxsPerBlock: 0,
|
|
90
103
|
realProofs: false,
|
|
91
104
|
startProverNode: true,
|
|
@@ -127,11 +140,11 @@ export class EpochsTestContext {
|
|
|
127
140
|
this.epochDuration = aztecEpochDuration;
|
|
128
141
|
this.constants = {
|
|
129
142
|
epochDuration: aztecEpochDuration,
|
|
130
|
-
slotDuration:
|
|
143
|
+
slotDuration: aztecSlotDuration,
|
|
131
144
|
l1StartBlock: await this.rollup.getL1StartBlock(),
|
|
132
145
|
l1GenesisTime: await this.rollup.getL1GenesisTime(),
|
|
133
|
-
ethereumSlotDuration
|
|
134
|
-
proofSubmissionWindow,
|
|
146
|
+
ethereumSlotDuration,
|
|
147
|
+
proofSubmissionWindow: aztecProofSubmissionWindow,
|
|
135
148
|
};
|
|
136
149
|
|
|
137
150
|
this.logger.info(
|
|
@@ -185,7 +198,7 @@ export class EpochsTestContext {
|
|
|
185
198
|
public async waitUntilEpochStarts(epoch: number) {
|
|
186
199
|
const [start] = getTimestampRangeForEpoch(BigInt(epoch), this.constants);
|
|
187
200
|
this.logger.info(`Waiting until L1 timestamp ${start} is reached as the start of epoch ${epoch}`);
|
|
188
|
-
await waitUntilL1Timestamp(this.l1Client, start - BigInt(L1_BLOCK_TIME_IN_S));
|
|
201
|
+
await waitUntilL1Timestamp(this.l1Client, start - BigInt(this.L1_BLOCK_TIME_IN_S));
|
|
189
202
|
return start;
|
|
190
203
|
}
|
|
191
204
|
|