@aztec/sequencer-client 0.0.1-fake-ceab37513c → 0.0.1-private.d0bedffd
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/client/index.d.ts +1 -1
- package/dest/client/sequencer-client.d.ts +32 -16
- package/dest/client/sequencer-client.d.ts.map +1 -1
- package/dest/client/sequencer-client.js +118 -27
- package/dest/config.d.ts +33 -8
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +109 -41
- package/dest/global_variable_builder/global_builder.d.ts +20 -16
- package/dest/global_variable_builder/global_builder.d.ts.map +1 -1
- package/dest/global_variable_builder/global_builder.js +52 -39
- package/dest/global_variable_builder/index.d.ts +1 -1
- package/dest/index.d.ts +2 -3
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +1 -2
- package/dest/publisher/config.d.ts +43 -20
- package/dest/publisher/config.d.ts.map +1 -1
- package/dest/publisher/config.js +109 -34
- package/dest/publisher/index.d.ts +2 -1
- package/dest/publisher/index.d.ts.map +1 -1
- package/dest/publisher/l1_tx_failed_store/factory.d.ts +11 -0
- package/dest/publisher/l1_tx_failed_store/factory.d.ts.map +1 -0
- package/dest/publisher/l1_tx_failed_store/factory.js +22 -0
- package/dest/publisher/l1_tx_failed_store/failed_tx_store.d.ts +59 -0
- package/dest/publisher/l1_tx_failed_store/failed_tx_store.d.ts.map +1 -0
- package/dest/publisher/l1_tx_failed_store/failed_tx_store.js +1 -0
- package/dest/publisher/l1_tx_failed_store/file_store_failed_tx_store.d.ts +15 -0
- package/dest/publisher/l1_tx_failed_store/file_store_failed_tx_store.d.ts.map +1 -0
- package/dest/publisher/l1_tx_failed_store/file_store_failed_tx_store.js +34 -0
- package/dest/publisher/l1_tx_failed_store/index.d.ts +4 -0
- package/dest/publisher/l1_tx_failed_store/index.d.ts.map +1 -0
- package/dest/publisher/l1_tx_failed_store/index.js +2 -0
- package/dest/publisher/sequencer-publisher-factory.d.ts +17 -7
- package/dest/publisher/sequencer-publisher-factory.d.ts.map +1 -1
- package/dest/publisher/sequencer-publisher-factory.js +29 -4
- package/dest/publisher/sequencer-publisher-metrics.d.ts +4 -4
- package/dest/publisher/sequencer-publisher-metrics.d.ts.map +1 -1
- package/dest/publisher/sequencer-publisher-metrics.js +24 -87
- package/dest/publisher/sequencer-publisher.d.ts +101 -69
- package/dest/publisher/sequencer-publisher.d.ts.map +1 -1
- package/dest/publisher/sequencer-publisher.js +981 -186
- package/dest/sequencer/checkpoint_proposal_job.d.ts +100 -0
- package/dest/sequencer/checkpoint_proposal_job.d.ts.map +1 -0
- package/dest/sequencer/checkpoint_proposal_job.js +1244 -0
- package/dest/sequencer/checkpoint_voter.d.ts +35 -0
- package/dest/sequencer/checkpoint_voter.d.ts.map +1 -0
- package/dest/sequencer/checkpoint_voter.js +109 -0
- package/dest/sequencer/config.d.ts +3 -2
- package/dest/sequencer/config.d.ts.map +1 -1
- package/dest/sequencer/errors.d.ts +1 -1
- package/dest/sequencer/errors.d.ts.map +1 -1
- package/dest/sequencer/events.d.ts +46 -0
- package/dest/sequencer/events.d.ts.map +1 -0
- package/dest/sequencer/events.js +1 -0
- package/dest/sequencer/index.d.ts +4 -2
- package/dest/sequencer/index.d.ts.map +1 -1
- package/dest/sequencer/index.js +3 -1
- package/dest/sequencer/metrics.d.ts +45 -4
- package/dest/sequencer/metrics.d.ts.map +1 -1
- package/dest/sequencer/metrics.js +232 -50
- package/dest/sequencer/sequencer.d.ts +126 -145
- package/dest/sequencer/sequencer.d.ts.map +1 -1
- package/dest/sequencer/sequencer.js +736 -520
- package/dest/sequencer/timetable.d.ts +56 -18
- package/dest/sequencer/timetable.d.ts.map +1 -1
- package/dest/sequencer/timetable.js +147 -62
- package/dest/sequencer/types.d.ts +6 -0
- package/dest/sequencer/types.d.ts.map +1 -0
- package/dest/sequencer/types.js +1 -0
- package/dest/sequencer/utils.d.ts +14 -8
- package/dest/sequencer/utils.d.ts.map +1 -1
- package/dest/sequencer/utils.js +7 -4
- package/dest/test/index.d.ts +6 -7
- package/dest/test/index.d.ts.map +1 -1
- package/dest/test/mock_checkpoint_builder.d.ts +95 -0
- package/dest/test/mock_checkpoint_builder.d.ts.map +1 -0
- package/dest/test/mock_checkpoint_builder.js +231 -0
- package/dest/test/utils.d.ts +53 -0
- package/dest/test/utils.d.ts.map +1 -0
- package/dest/test/utils.js +104 -0
- package/package.json +33 -30
- package/src/client/sequencer-client.ts +158 -52
- package/src/config.ts +125 -51
- package/src/global_variable_builder/global_builder.ts +67 -59
- package/src/index.ts +1 -7
- package/src/publisher/config.ts +139 -50
- package/src/publisher/index.ts +3 -0
- package/src/publisher/l1_tx_failed_store/factory.ts +32 -0
- package/src/publisher/l1_tx_failed_store/failed_tx_store.ts +55 -0
- package/src/publisher/l1_tx_failed_store/file_store_failed_tx_store.ts +46 -0
- package/src/publisher/l1_tx_failed_store/index.ts +3 -0
- package/src/publisher/sequencer-publisher-factory.ts +47 -12
- package/src/publisher/sequencer-publisher-metrics.ts +20 -72
- package/src/publisher/sequencer-publisher.ts +702 -248
- package/src/sequencer/README.md +531 -0
- package/src/sequencer/checkpoint_proposal_job.ts +960 -0
- package/src/sequencer/checkpoint_voter.ts +130 -0
- package/src/sequencer/config.ts +2 -1
- package/src/sequencer/events.ts +27 -0
- package/src/sequencer/index.ts +3 -1
- package/src/sequencer/metrics.ts +297 -62
- package/src/sequencer/sequencer.ts +488 -704
- package/src/sequencer/timetable.ts +180 -91
- package/src/sequencer/types.ts +9 -0
- package/src/sequencer/utils.ts +18 -9
- package/src/test/index.ts +5 -6
- package/src/test/mock_checkpoint_builder.ts +323 -0
- package/src/test/utils.ts +167 -0
- package/dest/sequencer/block_builder.d.ts +0 -27
- package/dest/sequencer/block_builder.d.ts.map +0 -1
- package/dest/sequencer/block_builder.js +0 -126
- package/dest/tx_validator/nullifier_cache.d.ts +0 -14
- package/dest/tx_validator/nullifier_cache.d.ts.map +0 -1
- package/dest/tx_validator/nullifier_cache.js +0 -24
- package/dest/tx_validator/tx_validator_factory.d.ts +0 -17
- package/dest/tx_validator/tx_validator_factory.d.ts.map +0 -1
- package/dest/tx_validator/tx_validator_factory.js +0 -50
- package/src/sequencer/block_builder.ts +0 -216
- package/src/tx_validator/nullifier_cache.ts +0 -30
- package/src/tx_validator/tx_validator_factory.ts +0 -127
package/dest/client/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export * from './sequencer-client.js';
|
|
2
|
-
//# sourceMappingURL=
|
|
2
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jbGllbnQvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyx1QkFBdUIsQ0FBQyJ9
|
|
@@ -1,30 +1,32 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { BlobClientInterface } from '@aztec/blob-client/client';
|
|
2
2
|
import { EpochCache } from '@aztec/epoch-cache';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { type Delayer, L1TxUtils } from '@aztec/ethereum/l1-tx-utils';
|
|
4
|
+
import { PublisherManager } from '@aztec/ethereum/publisher-manager';
|
|
5
5
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
6
|
+
import { createLogger } from '@aztec/foundation/log';
|
|
6
7
|
import type { DateProvider } from '@aztec/foundation/timer';
|
|
7
8
|
import type { KeystoreManager } from '@aztec/node-keystore';
|
|
8
9
|
import type { P2P } from '@aztec/p2p';
|
|
9
10
|
import type { SlasherClientInterface } from '@aztec/slasher';
|
|
10
|
-
import type { L2BlockSource } from '@aztec/stdlib/block';
|
|
11
|
-
import type {
|
|
11
|
+
import type { L2BlockSink, L2BlockSource } from '@aztec/stdlib/block';
|
|
12
|
+
import type { ValidatorClientFullConfig, WorldStateSynchronizer } from '@aztec/stdlib/interfaces/server';
|
|
12
13
|
import type { L1ToL2MessageSource } from '@aztec/stdlib/messaging';
|
|
13
14
|
import { L1Metrics, type TelemetryClient } from '@aztec/telemetry-client';
|
|
14
|
-
import { type ValidatorClient } from '@aztec/validator-client';
|
|
15
|
-
import type
|
|
15
|
+
import { FullNodeCheckpointsBuilder, NodeKeystoreAdapter, type ValidatorClient } from '@aztec/validator-client';
|
|
16
|
+
import { type SequencerClientConfig } from '../config.js';
|
|
16
17
|
import { SequencerPublisherFactory } from '../publisher/sequencer-publisher-factory.js';
|
|
17
18
|
import { Sequencer, type SequencerConfig } from '../sequencer/index.js';
|
|
18
19
|
/**
|
|
19
20
|
* Encapsulates the full sequencer and publisher.
|
|
20
21
|
*/
|
|
21
22
|
export declare class SequencerClient {
|
|
22
|
-
protected publisherManager: PublisherManager<
|
|
23
|
+
protected publisherManager: PublisherManager<L1TxUtils>;
|
|
23
24
|
protected sequencer: Sequencer;
|
|
24
|
-
protected
|
|
25
|
+
protected checkpointsBuilder: FullNodeCheckpointsBuilder;
|
|
25
26
|
protected validatorClient?: ValidatorClient | undefined;
|
|
26
27
|
private l1Metrics?;
|
|
27
|
-
|
|
28
|
+
private delayer_?;
|
|
29
|
+
constructor(publisherManager: PublisherManager<L1TxUtils>, sequencer: Sequencer, checkpointsBuilder: FullNodeCheckpointsBuilder, validatorClient?: ValidatorClient | undefined, l1Metrics?: L1Metrics | undefined, delayer_?: Delayer | undefined);
|
|
28
30
|
/**
|
|
29
31
|
* Initializes a new instance.
|
|
30
32
|
* @param config - Configuration for the sequencer, publisher, and L1 tx sender.
|
|
@@ -38,19 +40,19 @@ export declare class SequencerClient {
|
|
|
38
40
|
* @returns A new running instance.
|
|
39
41
|
*/
|
|
40
42
|
static new(config: SequencerClientConfig, deps: {
|
|
41
|
-
validatorClient: ValidatorClient
|
|
43
|
+
validatorClient: ValidatorClient;
|
|
42
44
|
p2pClient: P2P;
|
|
43
45
|
worldStateSynchronizer: WorldStateSynchronizer;
|
|
44
46
|
slasherClient: SlasherClientInterface | undefined;
|
|
45
|
-
|
|
46
|
-
l2BlockSource: L2BlockSource;
|
|
47
|
+
checkpointsBuilder: FullNodeCheckpointsBuilder;
|
|
48
|
+
l2BlockSource: L2BlockSource & L2BlockSink;
|
|
47
49
|
l1ToL2MessageSource: L1ToL2MessageSource;
|
|
48
50
|
telemetry: TelemetryClient;
|
|
49
51
|
publisherFactory?: SequencerPublisherFactory;
|
|
50
|
-
|
|
52
|
+
blobClient: BlobClientInterface;
|
|
51
53
|
dateProvider: DateProvider;
|
|
52
54
|
epochCache?: EpochCache;
|
|
53
|
-
l1TxUtils:
|
|
55
|
+
l1TxUtils: L1TxUtils[];
|
|
54
56
|
nodeKeyStore: KeystoreManager;
|
|
55
57
|
}): Promise<SequencerClient>;
|
|
56
58
|
/**
|
|
@@ -65,7 +67,21 @@ export declare class SequencerClient {
|
|
|
65
67
|
*/
|
|
66
68
|
stop(): Promise<void>;
|
|
67
69
|
getSequencer(): Sequencer;
|
|
70
|
+
/** Updates the publisher factory's node keystore adapter after a keystore reload. */
|
|
71
|
+
updatePublisherNodeKeyStore(adapter: NodeKeystoreAdapter): void;
|
|
72
|
+
/** Returns the shared tx delayer for sequencer L1 txs, if enabled. Test-only. */
|
|
73
|
+
getDelayer(): Delayer | undefined;
|
|
68
74
|
get validatorAddresses(): EthAddress[] | undefined;
|
|
69
75
|
get maxL2BlockGas(): number | undefined;
|
|
70
76
|
}
|
|
71
|
-
|
|
77
|
+
/**
|
|
78
|
+
* Computes per-block L2 gas, DA gas, and TX count budgets based on the L1 rollup limits and the timetable.
|
|
79
|
+
* If the user explicitly set a limit, it is capped at the corresponding checkpoint limit.
|
|
80
|
+
* Otherwise, derives it as (checkpointLimit / maxBlocks) * multiplier, capped at the checkpoint limit.
|
|
81
|
+
*/
|
|
82
|
+
export declare function computeBlockLimits(config: SequencerClientConfig, rollupManaLimit: number, l1PublishingTime: number, log: ReturnType<typeof createLogger>): {
|
|
83
|
+
maxL2BlockGas: number;
|
|
84
|
+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BSSxNQUFNLEdBQUcsU0FBUyxDQUV0QztDQUNGO0FBRUQ7Ozs7R0FJRztBQUNILHdCQUFnQixrQkFBa0IsQ0FDaEMsTUFBTSxFQUFFLHFCQUFxQixFQUM3QixlQUFlLEVBQUUsTUFBTSxFQUN2QixnQkFBZ0IsRUFBRSxNQUFNLEVBQ3hCLEdBQUcsRUFBRSxVQUFVLENBQUMsT0FBTyxZQUFZLENBQUMsR0FDbkM7SUFBRSxhQUFhLEVBQUUsTUFBTSxDQUFDO0lBQUMsYUFBYSxFQUFFLE1BQU0sQ0FBQztJQUFDLGNBQWMsRUFBRSxNQUFNLENBQUE7Q0FBRSxDQTJFMUUifQ==
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sequencer-client.d.ts","sourceRoot":"","sources":["../../src/client/sequencer-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"sequencer-client.d.ts","sourceRoot":"","sources":["../../src/client/sequencer-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAErE,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAIhD,OAAO,EAAE,KAAK,OAAO,EAAE,SAAS,EAAE,MAAM,6BAA6B,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,MAAM,mCAAmC,CAAC;AACrE,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,KAAK,EAAE,W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AC/C,aAAa,EAAE,aAAa,GAAG,WAAW,CAAC;QAC3C,mBAAmB,EAAE,mBAAmB,CAAC;QACzC,SAAS,EAAE,eAAe,CAAC;QAC3B,gBAAgB,CAAC,EAAE,yBAAyB,CAAC;QAC7C,UAAU,EAAE,mBAAmB,CAAC;QAChC,YAAY,EAAE,YAAY,CAAC;QAC3B,UAAU,CAAC,EAAE,UAAU,CAAC;QACxB,SAAS,EAAE,SAAS,EAAE,CAAC;QACvB,YAAY,EAAE,eAAe,CAAC;KAC/B,4BA2HF;IAED;;;OAGG;IACI,YAAY,CAAC,MAAM,EAAE,eAAe,GAAG,OAAO,CAAC,yBAAyB,CAAC,QAI/E;IAED,4BAA4B;IACf,KAAK,kBAKjB;IAED;;OAEG;IACU,IAAI,kBAKhB;IAEM,YAAY,IAAI,SAAS,CAE/B;IAED,qFAAqF;IAC9E,2BAA2B,CAAC,OAAO,EAAE,mBAAmB,GAAG,IAAI,CAErE;IAED,iFAAiF;IACjF,UAAU,IAAI,OAAO,GAAG,SAAS,CAEhC;IAED,IAAI,kBAAkB,IAAI,UAAU,EAAE,GAAG,SAAS,CAEjD;IAED,IAAI,aAAa,IAAI,MAAM,GAAG,SAAS,CAEtC;CACF;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,qBAAqB,EAC7B,eAAe,EAAE,MAAM,EACvB,gBAAgB,EAAE,MAAM,EACxB,GAAG,EAAE,UAAU,CAAC,OAAO,YAAY,CAAC,GACnC;IAAE,aAAa,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,MAAM,CAAA;CAAE,CA2E1E"}
|
|
@@ -1,27 +1,35 @@
|
|
|
1
|
+
import { MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT } from '@aztec/constants';
|
|
1
2
|
import { EpochCache } from '@aztec/epoch-cache';
|
|
2
|
-
import {
|
|
3
|
+
import { isAnvilTestChain } from '@aztec/ethereum/chain';
|
|
4
|
+
import { getPublicClient } from '@aztec/ethereum/client';
|
|
5
|
+
import { GovernanceProposerContract, RollupContract } from '@aztec/ethereum/contracts';
|
|
6
|
+
import { PublisherManager } from '@aztec/ethereum/publisher-manager';
|
|
3
7
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
4
8
|
import { createLogger } from '@aztec/foundation/log';
|
|
5
9
|
import { SlashFactoryContract } from '@aztec/stdlib/l1-contracts';
|
|
6
10
|
import { L1Metrics } from '@aztec/telemetry-client';
|
|
7
11
|
import { NodeKeystoreAdapter } from '@aztec/validator-client';
|
|
12
|
+
import { DefaultSequencerConfig, getPublisherConfigFromSequencerConfig } from '../config.js';
|
|
8
13
|
import { GlobalVariableBuilder } from '../global_variable_builder/index.js';
|
|
9
14
|
import { SequencerPublisherFactory } from '../publisher/sequencer-publisher-factory.js';
|
|
10
15
|
import { Sequencer } from '../sequencer/index.js';
|
|
16
|
+
import { SequencerTimetable } from '../sequencer/timetable.js';
|
|
11
17
|
/**
|
|
12
18
|
* Encapsulates the full sequencer and publisher.
|
|
13
19
|
*/ export class SequencerClient {
|
|
14
20
|
publisherManager;
|
|
15
21
|
sequencer;
|
|
16
|
-
|
|
22
|
+
checkpointsBuilder;
|
|
17
23
|
validatorClient;
|
|
18
24
|
l1Metrics;
|
|
19
|
-
|
|
25
|
+
delayer_;
|
|
26
|
+
constructor(publisherManager, sequencer, checkpointsBuilder, validatorClient, l1Metrics, delayer_){
|
|
20
27
|
this.publisherManager = publisherManager;
|
|
21
28
|
this.sequencer = sequencer;
|
|
22
|
-
this.
|
|
29
|
+
this.checkpointsBuilder = checkpointsBuilder;
|
|
23
30
|
this.validatorClient = validatorClient;
|
|
24
31
|
this.l1Metrics = l1Metrics;
|
|
32
|
+
this.delayer_ = delayer_;
|
|
25
33
|
}
|
|
26
34
|
/**
|
|
27
35
|
* Initializes a new instance.
|
|
@@ -35,17 +43,19 @@ import { Sequencer } from '../sequencer/index.js';
|
|
|
35
43
|
* @param prover - An instance of a block prover
|
|
36
44
|
* @returns A new running instance.
|
|
37
45
|
*/ static async new(config, deps) {
|
|
38
|
-
const { validatorClient, p2pClient, worldStateSynchronizer, slasherClient,
|
|
46
|
+
const { validatorClient, p2pClient, worldStateSynchronizer, slasherClient, checkpointsBuilder, l2BlockSource, l1ToL2MessageSource, telemetry: telemetryClient } = deps;
|
|
39
47
|
const { l1RpcUrls: rpcUrls, l1ChainId: chainId } = config;
|
|
40
48
|
const log = createLogger('sequencer');
|
|
41
49
|
const publicClient = getPublicClient(config);
|
|
42
50
|
const l1TxUtils = deps.l1TxUtils;
|
|
43
51
|
const l1Metrics = new L1Metrics(telemetryClient.getMeter('L1PublisherMetrics'), publicClient, l1TxUtils.map((x)=>x.getSenderAddress()));
|
|
44
|
-
const publisherManager = new PublisherManager(l1TxUtils, config);
|
|
52
|
+
const publisherManager = new PublisherManager(l1TxUtils, getPublisherConfigFromSequencerConfig(config), log.getBindings());
|
|
45
53
|
const rollupContract = new RollupContract(publicClient, config.l1Contracts.rollupAddress.toString());
|
|
46
|
-
const [l1GenesisTime, slotDuration] = await Promise.all([
|
|
54
|
+
const [l1GenesisTime, slotDuration, rollupVersion, rollupManaLimit] = await Promise.all([
|
|
47
55
|
rollupContract.getL1GenesisTime(),
|
|
48
|
-
rollupContract.getSlotDuration()
|
|
56
|
+
rollupContract.getSlotDuration(),
|
|
57
|
+
rollupContract.getVersion(),
|
|
58
|
+
rollupContract.getManaLimit().then(Number)
|
|
49
59
|
]);
|
|
50
60
|
const governanceProposerContract = new GovernanceProposerContract(publicClient, config.l1Contracts.governanceProposerAddress.toString());
|
|
51
61
|
const epochCache = deps.epochCache ?? await EpochCache.create(config.l1Contracts.rollupAddress, {
|
|
@@ -59,7 +69,7 @@ import { Sequencer } from '../sequencer/index.js';
|
|
|
59
69
|
const slashFactoryContract = new SlashFactoryContract(publicClient, config.l1Contracts.slashFactoryAddress?.toString() ?? EthAddress.ZERO.toString());
|
|
60
70
|
const publisherFactory = deps.publisherFactory ?? new SequencerPublisherFactory(config, {
|
|
61
71
|
telemetry: telemetryClient,
|
|
62
|
-
|
|
72
|
+
blobClient: deps.blobClient,
|
|
63
73
|
epochCache,
|
|
64
74
|
governanceProposerContract,
|
|
65
75
|
slashFactoryContract,
|
|
@@ -69,40 +79,46 @@ import { Sequencer } from '../sequencer/index.js';
|
|
|
69
79
|
nodeKeyStore: NodeKeystoreAdapter.fromKeyStoreManager(deps.nodeKeyStore),
|
|
70
80
|
logger: log
|
|
71
81
|
});
|
|
72
|
-
const globalsBuilder = new GlobalVariableBuilder(config);
|
|
73
82
|
const ethereumSlotDuration = config.ethereumSlotDuration;
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
83
|
+
const globalsBuilder = new GlobalVariableBuilder({
|
|
84
|
+
...config,
|
|
85
|
+
l1GenesisTime,
|
|
86
|
+
slotDuration: Number(slotDuration),
|
|
87
|
+
ethereumSlotDuration,
|
|
88
|
+
rollupVersion
|
|
89
|
+
});
|
|
80
90
|
// When running in anvil, assume we can post a tx up until one second before the end of an L1 slot.
|
|
81
|
-
// Otherwise,
|
|
82
|
-
// maxL1TxInclusionTimeIntoSlot of zero) to get the tx into that L1 slot.
|
|
91
|
+
// Otherwise, we need the full L1 slot duration for publishing to ensure inclusion.
|
|
83
92
|
// In theory, the L1 slot has an initial 4s phase where the block is propagated, so we could
|
|
84
|
-
//
|
|
93
|
+
// reduce the publishing time allowance. However, we prefer being conservative.
|
|
85
94
|
// See https://www.blocknative.com/blog/anatomy-of-a-slot#7 for more info.
|
|
86
|
-
const
|
|
95
|
+
const l1PublishingTimeBasedOnChain = isAnvilTestChain(config.l1ChainId) ? 1 : ethereumSlotDuration;
|
|
96
|
+
const l1PublishingTime = config.l1PublishingTime ?? l1PublishingTimeBasedOnChain;
|
|
97
|
+
const { maxL2BlockGas, maxDABlockGas, maxTxsPerBlock } = computeBlockLimits(config, rollupManaLimit, l1PublishingTime, log);
|
|
87
98
|
const l1Constants = {
|
|
88
99
|
l1GenesisTime,
|
|
89
100
|
slotDuration: Number(slotDuration),
|
|
90
|
-
ethereumSlotDuration
|
|
101
|
+
ethereumSlotDuration,
|
|
102
|
+
rollupManaLimit
|
|
91
103
|
};
|
|
92
|
-
const sequencer = new Sequencer(publisherFactory, validatorClient, globalsBuilder, p2pClient, worldStateSynchronizer, slasherClient, l2BlockSource, l1ToL2MessageSource,
|
|
104
|
+
const sequencer = new Sequencer(publisherFactory, validatorClient, globalsBuilder, p2pClient, worldStateSynchronizer, slasherClient, l2BlockSource, l1ToL2MessageSource, checkpointsBuilder, l1Constants, deps.dateProvider, epochCache, rollupContract, {
|
|
93
105
|
...config,
|
|
94
|
-
|
|
95
|
-
maxL2BlockGas
|
|
106
|
+
l1PublishingTime,
|
|
107
|
+
maxL2BlockGas,
|
|
108
|
+
maxDABlockGas,
|
|
109
|
+
maxTxsPerBlock
|
|
96
110
|
}, telemetryClient, log);
|
|
97
|
-
|
|
98
|
-
|
|
111
|
+
sequencer.init();
|
|
112
|
+
// Extract the shared delayer from the first L1TxUtils instance (all instances share the same delayer)
|
|
113
|
+
const delayer = l1TxUtils[0]?.delayer;
|
|
114
|
+
return new SequencerClient(publisherManager, sequencer, checkpointsBuilder, validatorClient, l1Metrics, delayer);
|
|
99
115
|
}
|
|
100
116
|
/**
|
|
101
117
|
* Updates sequencer and validator client config.
|
|
102
118
|
* @param config - New parameters.
|
|
103
119
|
*/ updateConfig(config) {
|
|
104
120
|
this.sequencer.updateConfig(config);
|
|
105
|
-
this.
|
|
121
|
+
this.checkpointsBuilder.updateConfig(config);
|
|
106
122
|
this.validatorClient?.updateConfig(config);
|
|
107
123
|
}
|
|
108
124
|
/** Starts the sequencer. */ async start() {
|
|
@@ -122,6 +138,12 @@ import { Sequencer } from '../sequencer/index.js';
|
|
|
122
138
|
getSequencer() {
|
|
123
139
|
return this.sequencer;
|
|
124
140
|
}
|
|
141
|
+
/** Updates the publisher factory's node keystore adapter after a keystore reload. */ updatePublisherNodeKeyStore(adapter) {
|
|
142
|
+
this.sequencer.updatePublisherNodeKeyStore(adapter);
|
|
143
|
+
}
|
|
144
|
+
/** Returns the shared tx delayer for sequencer L1 txs, if enabled. Test-only. */ getDelayer() {
|
|
145
|
+
return this.delayer_;
|
|
146
|
+
}
|
|
125
147
|
get validatorAddresses() {
|
|
126
148
|
return this.sequencer.getValidatorAddresses();
|
|
127
149
|
}
|
|
@@ -129,3 +151,72 @@ import { Sequencer } from '../sequencer/index.js';
|
|
|
129
151
|
return this.sequencer.maxL2BlockGas;
|
|
130
152
|
}
|
|
131
153
|
}
|
|
154
|
+
/**
|
|
155
|
+
* Computes per-block L2 gas, DA gas, and TX count budgets based on the L1 rollup limits and the timetable.
|
|
156
|
+
* If the user explicitly set a limit, it is capped at the corresponding checkpoint limit.
|
|
157
|
+
* Otherwise, derives it as (checkpointLimit / maxBlocks) * multiplier, capped at the checkpoint limit.
|
|
158
|
+
*/ export function computeBlockLimits(config, rollupManaLimit, l1PublishingTime, log) {
|
|
159
|
+
const maxNumberOfBlocks = new SequencerTimetable({
|
|
160
|
+
ethereumSlotDuration: config.ethereumSlotDuration,
|
|
161
|
+
aztecSlotDuration: config.aztecSlotDuration,
|
|
162
|
+
l1PublishingTime,
|
|
163
|
+
p2pPropagationTime: config.attestationPropagationTime,
|
|
164
|
+
blockDurationMs: config.blockDurationMs,
|
|
165
|
+
enforce: config.enforceTimeTable ?? DefaultSequencerConfig.enforceTimeTable
|
|
166
|
+
}).maxNumberOfBlocks;
|
|
167
|
+
const multiplier = config.perBlockAllocationMultiplier ?? DefaultSequencerConfig.perBlockAllocationMultiplier;
|
|
168
|
+
// Compute maxL2BlockGas
|
|
169
|
+
let maxL2BlockGas;
|
|
170
|
+
if (config.maxL2BlockGas !== undefined) {
|
|
171
|
+
if (config.maxL2BlockGas > rollupManaLimit) {
|
|
172
|
+
log.warn(`Provided MAX_L2_BLOCK_GAS ${config.maxL2BlockGas} exceeds L1 rollup mana limit ${rollupManaLimit} (capping)`);
|
|
173
|
+
maxL2BlockGas = rollupManaLimit;
|
|
174
|
+
} else {
|
|
175
|
+
maxL2BlockGas = config.maxL2BlockGas;
|
|
176
|
+
}
|
|
177
|
+
} else {
|
|
178
|
+
maxL2BlockGas = Math.min(rollupManaLimit, Math.ceil(rollupManaLimit / maxNumberOfBlocks * multiplier));
|
|
179
|
+
}
|
|
180
|
+
// Compute maxDABlockGas
|
|
181
|
+
const daCheckpointLimit = MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT;
|
|
182
|
+
let maxDABlockGas;
|
|
183
|
+
if (config.maxDABlockGas !== undefined) {
|
|
184
|
+
if (config.maxDABlockGas > daCheckpointLimit) {
|
|
185
|
+
log.warn(`Provided MAX_DA_BLOCK_GAS ${config.maxDABlockGas} exceeds DA checkpoint limit ${daCheckpointLimit} (capping)`);
|
|
186
|
+
maxDABlockGas = daCheckpointLimit;
|
|
187
|
+
} else {
|
|
188
|
+
maxDABlockGas = config.maxDABlockGas;
|
|
189
|
+
}
|
|
190
|
+
} else {
|
|
191
|
+
maxDABlockGas = Math.min(daCheckpointLimit, Math.ceil(daCheckpointLimit / maxNumberOfBlocks * multiplier));
|
|
192
|
+
}
|
|
193
|
+
// Compute maxTxsPerBlock
|
|
194
|
+
const defaultMaxTxsPerBlock = 32;
|
|
195
|
+
let maxTxsPerBlock;
|
|
196
|
+
if (config.maxTxsPerBlock !== undefined) {
|
|
197
|
+
if (config.maxTxsPerCheckpoint !== undefined && config.maxTxsPerBlock > config.maxTxsPerCheckpoint) {
|
|
198
|
+
log.warn(`Provided MAX_TX_PER_BLOCK ${config.maxTxsPerBlock} exceeds MAX_TX_PER_CHECKPOINT ${config.maxTxsPerCheckpoint} (capping)`);
|
|
199
|
+
maxTxsPerBlock = config.maxTxsPerCheckpoint;
|
|
200
|
+
} else {
|
|
201
|
+
maxTxsPerBlock = config.maxTxsPerBlock;
|
|
202
|
+
}
|
|
203
|
+
} else if (config.maxTxsPerCheckpoint !== undefined) {
|
|
204
|
+
maxTxsPerBlock = Math.min(config.maxTxsPerCheckpoint, Math.ceil(config.maxTxsPerCheckpoint / maxNumberOfBlocks * multiplier));
|
|
205
|
+
} else {
|
|
206
|
+
maxTxsPerBlock = defaultMaxTxsPerBlock;
|
|
207
|
+
}
|
|
208
|
+
log.info(`Computed block limits L2=${maxL2BlockGas} DA=${maxDABlockGas} maxTxs=${maxTxsPerBlock}`, {
|
|
209
|
+
maxL2BlockGas,
|
|
210
|
+
maxDABlockGas,
|
|
211
|
+
maxTxsPerBlock,
|
|
212
|
+
rollupManaLimit,
|
|
213
|
+
daCheckpointLimit,
|
|
214
|
+
maxNumberOfBlocks,
|
|
215
|
+
multiplier
|
|
216
|
+
});
|
|
217
|
+
return {
|
|
218
|
+
maxL2BlockGas,
|
|
219
|
+
maxDABlockGas,
|
|
220
|
+
maxTxsPerBlock
|
|
221
|
+
};
|
|
222
|
+
}
|
package/dest/config.d.ts
CHANGED
|
@@ -1,21 +1,46 @@
|
|
|
1
|
-
import { type L1ContractsConfig
|
|
1
|
+
import { type L1ContractsConfig } from '@aztec/ethereum/config';
|
|
2
|
+
import { type L1ReaderConfig } from '@aztec/ethereum/l1-reader';
|
|
2
3
|
import { type ConfigMappingsType } from '@aztec/foundation/config';
|
|
3
|
-
import { type KeyStoreConfig } from '@aztec/node-keystore';
|
|
4
|
-
import { type P2PConfig } from '@aztec/p2p';
|
|
4
|
+
import { type KeyStoreConfig } from '@aztec/node-keystore/config';
|
|
5
|
+
import { type P2PConfig } from '@aztec/p2p/config';
|
|
5
6
|
import { type ChainConfig, type SequencerConfig } from '@aztec/stdlib/config';
|
|
6
|
-
import { type ValidatorClientConfig } from '@aztec/validator-client';
|
|
7
|
-
import { type
|
|
7
|
+
import { type ValidatorClientConfig } from '@aztec/validator-client/config';
|
|
8
|
+
import { type SequencerPublisherConfig, type SequencerTxSenderConfig } from './publisher/config.js';
|
|
8
9
|
export * from './publisher/config.js';
|
|
9
10
|
export type { SequencerConfig };
|
|
10
|
-
|
|
11
|
+
/**
|
|
12
|
+
* Default values for SequencerConfig.
|
|
13
|
+
* Centralized location for all sequencer configuration defaults.
|
|
14
|
+
*/
|
|
15
|
+
export declare const DefaultSequencerConfig: {
|
|
16
|
+
sequencerPollingIntervalMS: number;
|
|
17
|
+
minTxsPerBlock: number;
|
|
18
|
+
buildCheckpointIfEmpty: false;
|
|
19
|
+
publishTxsWithProposals: false;
|
|
20
|
+
perBlockAllocationMultiplier: number;
|
|
21
|
+
enforceTimeTable: true;
|
|
22
|
+
attestationPropagationTime: number;
|
|
23
|
+
secondsBeforeInvalidatingBlockAsCommitteeMember: number;
|
|
24
|
+
secondsBeforeInvalidatingBlockAsNonCommitteeMember: number;
|
|
25
|
+
skipCollectingAttestations: false;
|
|
26
|
+
skipInvalidateBlockAsProposer: false;
|
|
27
|
+
broadcastInvalidBlockProposal: false;
|
|
28
|
+
injectFakeAttestation: false;
|
|
29
|
+
injectHighSValueAttestation: false;
|
|
30
|
+
injectUnrecoverableSignatureAttestation: false;
|
|
31
|
+
fishermanMode: false;
|
|
32
|
+
shuffleAttestationOrdering: false;
|
|
33
|
+
skipPushProposedBlocksToArchiver: false;
|
|
34
|
+
skipPublishingCheckpointsPercent: number;
|
|
35
|
+
};
|
|
11
36
|
/**
|
|
12
37
|
* Configuration settings for the SequencerClient.
|
|
13
38
|
*/
|
|
14
|
-
export type SequencerClientConfig =
|
|
39
|
+
export type SequencerClientConfig = SequencerPublisherConfig & KeyStoreConfig & ValidatorClientConfig & SequencerTxSenderConfig & SequencerConfig & L1ReaderConfig & ChainConfig & Pick<P2PConfig, 'txPublicSetupAllowListExtend'> & Pick<L1ContractsConfig, 'ethereumSlotDuration' | 'aztecSlotDuration' | 'aztecEpochDuration'>;
|
|
15
40
|
export declare const sequencerConfigMappings: ConfigMappingsType<SequencerConfig>;
|
|
16
41
|
export declare const sequencerClientConfigMappings: ConfigMappingsType<SequencerClientConfig>;
|
|
17
42
|
/**
|
|
18
43
|
* Creates an instance of SequencerClientConfig out of environment variables using sensible defaults for integration testing if not set.
|
|
19
44
|
*/
|
|
20
45
|
export declare function getConfigEnvVars(): SequencerClientConfig;
|
|
21
|
-
//# sourceMappingURL=
|
|
46
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlnLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvY29uZmlnLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxLQUFLLGlCQUFpQixFQUE2QixNQUFNLHdCQUF3QixDQUFDO0FBQzNGLE9BQU8sRUFBRSxLQUFLLGNBQWMsRUFBMEIsTUFBTSwyQkFBMkIsQ0FBQztBQUN4RixPQUFPLEVBQ0wsS0FBSyxrQkFBa0IsRUFLeEIsTUFBTSwwQkFBMEIsQ0FBQztBQUVsQyxPQUFPLEVBQUUsS0FBSyxjQUFjLEVBQTBCLE1BQU0sNkJBQTZCLENBQUM7QUFDMUYsT0FBTyxFQUFFLEtBQUssU0FBUyxFQUFxQixNQUFNLG1CQUFtQixDQUFDO0FBRXRFLE9BQU8sRUFDTCxLQUFLLFdBQVcsRUFDaEIsS0FBSyxlQUFlLEVBR3JCLE1BQU0sc0JBQXNCLENBQUM7QUFHOUIsT0FBTyxFQUFFLEtBQUsscUJBQXFCLEVBQWlDLE1BQU0sZ0NBQWdDLENBQUM7QUFFM0csT0FBTyxFQUNMLEtBQUssd0JBQXdCLEVBQzdCLEtBQUssdUJBQXVCLEVBRzdCLE1BQU0sdUJBQXVCLENBQUM7QUFFL0IsY0FBYyx1QkFBdUIsQ0FBQztBQUN0QyxZQUFZLEVBQUUsZUFBZSxFQUFFLENBQUM7QUFFaEM7OztHQUdHO0FBQ0gsZUFBTyxNQUFNLHNCQUFzQjs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Q0FvQkEsQ0FBQztBQUVwQzs7R0FFRztBQUNILE1BQU0sTUFBTSxxQkFBcUIsR0FBRyx3QkFBd0IsR0FDMUQsY0FBYyxHQUNkLHFCQUFxQixHQUNyQix1QkFBdUIsR0FDdkIsZUFBZSxHQUNmLGNBQWMsR0FDZCxXQUFXLEdBQ1gsSUFBSSxDQUFDLFNBQVMsRUFBRSw4QkFBOEIsQ0FBQyxHQUMvQyxJQUFJLENBQUMsaUJBQWlCLEVBQUUsc0JBQXNCLEdBQUcsbUJBQW1CLEdBQUcsb0JBQW9CLENBQUMsQ0FBQztBQUUvRixlQUFPLE1BQU0sdUJBQXVCLEVBQUUsa0JBQWtCLENBQUMsZUFBZSxDQTBKdkUsQ0FBQztBQUVGLGVBQU8sTUFBTSw2QkFBNkIsRUFBRSxrQkFBa0IsQ0FBQyxxQkFBcUIsQ0FTbkYsQ0FBQztBQUVGOztHQUVHO0FBQ0gsd0JBQWdCLGdCQUFnQixJQUFJLHFCQUFxQixDQUV4RCJ9
|
package/dest/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,iBAAiB,EAA6B,MAAM,wBAAwB,CAAC;AAC3F,OAAO,EAAE,KAAK,cAAc,EAA0B,MAAM,2BAA2B,CAAC;AACxF,OAAO,EACL,KAAK,kBAAkB,EAKxB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,KAAK,cAAc,EAA0B,MAAM,6BAA6B,CAAC;AAC1F,OAAO,EAAE,KAAK,SAAS,EAAqB,MAAM,mBAAmB,CAAC;AAEtE,OAAO,EACL,KAAK,WAAW,EAChB,KAAK,eAAe,EAGrB,MAAM,sBAAsB,CAAC;AAG9B,OAAO,EAAE,KAAK,qBAAqB,EAAiC,MAAM,gCAAgC,CAAC;AAE3G,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,uBAAuB,EAG7B,MAAM,uBAAuB,CAAC;AAE/B,cAAc,uBAAuB,CAAC;AACtC,YAAY,EAAE,eAAe,EAAE,CAAC;AAEhC;;;GAGG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;CAoBA,CAAC;AAEpC;;GAEG;AACH,MAAM,MAAM,qBAAqB,GAAG,wBAAwB,GAC1D,cAAc,GACd,qBAAqB,GACrB,uBAAuB,GACvB,eAAe,GACf,cAAc,GACd,WAAW,GACX,IAAI,CAAC,SAAS,EAAE,8BAA8B,CAAC,GAC/C,IAAI,CAAC,iBAAiB,EAAE,sBAAsB,GAAG,mBAAmB,GAAG,oBAAoB,CAAC,CAAC;AAE/F,eAAO,MAAM,uBAAuB,EAAE,kBAAkB,CAAC,eAAe,CA0JvE,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,kBAAkB,CAAC,qBAAqB,CASnF,CAAC;AAEF;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,qBAAqB,CAExD"}
|
package/dest/config.js
CHANGED
|
@@ -1,44 +1,77 @@
|
|
|
1
|
-
import { l1ContractsConfigMappings
|
|
1
|
+
import { l1ContractsConfigMappings } from '@aztec/ethereum/config';
|
|
2
|
+
import { l1ReaderConfigMappings } from '@aztec/ethereum/l1-reader';
|
|
2
3
|
import { booleanConfigHelper, getConfigFromMappings, numberConfigHelper, pickConfigMappings } from '@aztec/foundation/config';
|
|
3
4
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
4
|
-
import { keyStoreConfigMappings } from '@aztec/node-keystore';
|
|
5
|
-
import { p2pConfigMappings } from '@aztec/p2p';
|
|
5
|
+
import { keyStoreConfigMappings } from '@aztec/node-keystore/config';
|
|
6
|
+
import { p2pConfigMappings } from '@aztec/p2p/config';
|
|
6
7
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
7
|
-
import { chainConfigMappings } from '@aztec/stdlib/config';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { chainConfigMappings, sharedSequencerConfigMappings } from '@aztec/stdlib/config';
|
|
9
|
+
import { DEFAULT_P2P_PROPAGATION_TIME } from '@aztec/stdlib/timetable';
|
|
10
|
+
import { validatorClientConfigMappings } from '@aztec/validator-client/config';
|
|
11
|
+
import { sequencerPublisherConfigMappings, sequencerTxSenderConfigMappings } from './publisher/config.js';
|
|
10
12
|
export * from './publisher/config.js';
|
|
11
|
-
|
|
13
|
+
/**
|
|
14
|
+
* Default values for SequencerConfig.
|
|
15
|
+
* Centralized location for all sequencer configuration defaults.
|
|
16
|
+
*/ export const DefaultSequencerConfig = {
|
|
17
|
+
sequencerPollingIntervalMS: 500,
|
|
18
|
+
minTxsPerBlock: 1,
|
|
19
|
+
buildCheckpointIfEmpty: false,
|
|
20
|
+
publishTxsWithProposals: false,
|
|
21
|
+
perBlockAllocationMultiplier: 2,
|
|
22
|
+
enforceTimeTable: true,
|
|
23
|
+
attestationPropagationTime: DEFAULT_P2P_PROPAGATION_TIME,
|
|
24
|
+
secondsBeforeInvalidatingBlockAsCommitteeMember: 144,
|
|
25
|
+
secondsBeforeInvalidatingBlockAsNonCommitteeMember: 432,
|
|
26
|
+
skipCollectingAttestations: false,
|
|
27
|
+
skipInvalidateBlockAsProposer: false,
|
|
28
|
+
broadcastInvalidBlockProposal: false,
|
|
29
|
+
injectFakeAttestation: false,
|
|
30
|
+
injectHighSValueAttestation: false,
|
|
31
|
+
injectUnrecoverableSignatureAttestation: false,
|
|
32
|
+
fishermanMode: false,
|
|
33
|
+
shuffleAttestationOrdering: false,
|
|
34
|
+
skipPushProposedBlocksToArchiver: false,
|
|
35
|
+
skipPublishingCheckpointsPercent: 0
|
|
36
|
+
};
|
|
12
37
|
export const sequencerConfigMappings = {
|
|
13
|
-
|
|
14
|
-
env: '
|
|
15
|
-
description: 'The number of ms to wait between polling for
|
|
16
|
-
...numberConfigHelper(
|
|
17
|
-
},
|
|
18
|
-
|
|
19
|
-
env: '
|
|
20
|
-
description: 'The maximum number of txs
|
|
21
|
-
|
|
38
|
+
sequencerPollingIntervalMS: {
|
|
39
|
+
env: 'SEQ_POLLING_INTERVAL_MS',
|
|
40
|
+
description: 'The number of ms to wait between polling for checking to build on the next slot.',
|
|
41
|
+
...numberConfigHelper(DefaultSequencerConfig.sequencerPollingIntervalMS)
|
|
42
|
+
},
|
|
43
|
+
maxTxsPerCheckpoint: {
|
|
44
|
+
env: 'SEQ_MAX_TX_PER_CHECKPOINT',
|
|
45
|
+
description: 'The maximum number of txs across all blocks in a checkpoint.',
|
|
46
|
+
parseEnv: (val)=>val ? parseInt(val, 10) : undefined
|
|
22
47
|
},
|
|
23
48
|
minTxsPerBlock: {
|
|
24
49
|
env: 'SEQ_MIN_TX_PER_BLOCK',
|
|
25
50
|
description: 'The minimum number of txs to include in a block.',
|
|
26
|
-
...numberConfigHelper(
|
|
51
|
+
...numberConfigHelper(DefaultSequencerConfig.minTxsPerBlock)
|
|
52
|
+
},
|
|
53
|
+
minValidTxsPerBlock: {
|
|
54
|
+
description: 'The minimum number of valid txs (after execution) to include in a block. If not set, falls back to minTxsPerBlock.'
|
|
27
55
|
},
|
|
28
56
|
publishTxsWithProposals: {
|
|
29
57
|
env: 'SEQ_PUBLISH_TXS_WITH_PROPOSALS',
|
|
30
58
|
description: 'Whether to publish txs with proposals.',
|
|
31
|
-
...booleanConfigHelper(
|
|
59
|
+
...booleanConfigHelper(DefaultSequencerConfig.publishTxsWithProposals)
|
|
32
60
|
},
|
|
33
61
|
maxL2BlockGas: {
|
|
34
62
|
env: 'SEQ_MAX_L2_BLOCK_GAS',
|
|
35
63
|
description: 'The maximum L2 block gas.',
|
|
36
|
-
|
|
64
|
+
parseEnv: (val)=>val ? parseInt(val, 10) : undefined
|
|
37
65
|
},
|
|
38
66
|
maxDABlockGas: {
|
|
39
67
|
env: 'SEQ_MAX_DA_BLOCK_GAS',
|
|
40
68
|
description: 'The maximum DA block gas.',
|
|
41
|
-
|
|
69
|
+
parseEnv: (val)=>val ? parseInt(val, 10) : undefined
|
|
70
|
+
},
|
|
71
|
+
perBlockAllocationMultiplier: {
|
|
72
|
+
env: 'SEQ_PER_BLOCK_ALLOCATION_MULTIPLIER',
|
|
73
|
+
description: 'Per-block gas budget multiplier for both L2 and DA gas. Budget per block is (checkpointLimit / maxBlocks) * multiplier.' + ' Values greater than one allow early blocks to use more than their even share, relying on checkpoint-level capping for later blocks.',
|
|
74
|
+
...numberConfigHelper(DefaultSequencerConfig.perBlockAllocationMultiplier)
|
|
42
75
|
},
|
|
43
76
|
coinbase: {
|
|
44
77
|
env: 'COINBASE',
|
|
@@ -58,60 +91,95 @@ export const sequencerConfigMappings = {
|
|
|
58
91
|
env: 'ACVM_BINARY_PATH',
|
|
59
92
|
description: 'The path to the ACVM binary'
|
|
60
93
|
},
|
|
61
|
-
maxBlockSizeInBytes: {
|
|
62
|
-
env: 'SEQ_MAX_BLOCK_SIZE_IN_BYTES',
|
|
63
|
-
description: 'Max block size',
|
|
64
|
-
...numberConfigHelper(1024 * 1024)
|
|
65
|
-
},
|
|
66
94
|
enforceTimeTable: {
|
|
67
95
|
env: 'SEQ_ENFORCE_TIME_TABLE',
|
|
68
96
|
description: 'Whether to enforce the time table when building blocks',
|
|
69
|
-
...booleanConfigHelper()
|
|
70
|
-
defaultValue: true
|
|
97
|
+
...booleanConfigHelper(DefaultSequencerConfig.enforceTimeTable)
|
|
71
98
|
},
|
|
72
99
|
governanceProposerPayload: {
|
|
73
100
|
env: 'GOVERNANCE_PROPOSER_PAYLOAD_ADDRESS',
|
|
74
101
|
description: 'The address of the payload for the governanceProposer',
|
|
75
|
-
parseEnv: (val)=>EthAddress.fromString(val)
|
|
76
|
-
defaultValue: EthAddress.ZERO
|
|
102
|
+
parseEnv: (val)=>EthAddress.fromString(val)
|
|
77
103
|
},
|
|
78
|
-
|
|
79
|
-
env: '
|
|
80
|
-
description: 'How
|
|
104
|
+
l1PublishingTime: {
|
|
105
|
+
env: 'SEQ_L1_PUBLISHING_TIME_ALLOWANCE_IN_SLOT',
|
|
106
|
+
description: 'How much time (in seconds) we allow in the slot for publishing the L1 tx (defaults to 1 L1 slot).',
|
|
81
107
|
parseEnv: (val)=>val ? parseInt(val, 10) : undefined
|
|
82
108
|
},
|
|
83
109
|
attestationPropagationTime: {
|
|
84
110
|
env: 'SEQ_ATTESTATION_PROPAGATION_TIME',
|
|
85
111
|
description: 'How many seconds it takes for proposals and attestations to travel across the p2p layer (one-way)',
|
|
86
|
-
...numberConfigHelper(
|
|
112
|
+
...numberConfigHelper(DefaultSequencerConfig.attestationPropagationTime)
|
|
87
113
|
},
|
|
88
114
|
fakeProcessingDelayPerTxMs: {
|
|
89
115
|
description: 'Used for testing to introduce a fake delay after processing each tx'
|
|
90
116
|
},
|
|
117
|
+
fakeThrowAfterProcessingTxCount: {
|
|
118
|
+
description: 'Used for testing to throw an error after processing N txs'
|
|
119
|
+
},
|
|
91
120
|
secondsBeforeInvalidatingBlockAsCommitteeMember: {
|
|
92
121
|
env: 'SEQ_SECONDS_BEFORE_INVALIDATING_BLOCK_AS_COMMITTEE_MEMBER',
|
|
93
122
|
description: 'How many seconds to wait before trying to invalidate a block from the pending chain as a committee member (zero to never invalidate).' + ' The next proposer is expected to invalidate, so the committee acts as a fallback.',
|
|
94
|
-
...numberConfigHelper(
|
|
123
|
+
...numberConfigHelper(DefaultSequencerConfig.secondsBeforeInvalidatingBlockAsCommitteeMember)
|
|
95
124
|
},
|
|
96
125
|
secondsBeforeInvalidatingBlockAsNonCommitteeMember: {
|
|
97
126
|
env: 'SEQ_SECONDS_BEFORE_INVALIDATING_BLOCK_AS_NON_COMMITTEE_MEMBER',
|
|
98
127
|
description: 'How many seconds to wait before trying to invalidate a block from the pending chain as a non-committee member (zero to never invalidate).' + ' The next proposer is expected to invalidate, then the committee, so other sequencers act as a fallback.',
|
|
99
|
-
...numberConfigHelper(
|
|
128
|
+
...numberConfigHelper(DefaultSequencerConfig.secondsBeforeInvalidatingBlockAsNonCommitteeMember)
|
|
100
129
|
},
|
|
101
130
|
skipCollectingAttestations: {
|
|
102
131
|
description: 'Whether to skip collecting attestations from validators and only use self-attestations (for testing only)',
|
|
103
|
-
...booleanConfigHelper(
|
|
132
|
+
...booleanConfigHelper(DefaultSequencerConfig.skipCollectingAttestations)
|
|
104
133
|
},
|
|
105
134
|
skipInvalidateBlockAsProposer: {
|
|
106
135
|
description: 'Do not invalidate the previous block if invalid when we are the proposer (for testing only)',
|
|
107
|
-
...booleanConfigHelper(
|
|
136
|
+
...booleanConfigHelper(DefaultSequencerConfig.skipInvalidateBlockAsProposer)
|
|
137
|
+
},
|
|
138
|
+
broadcastInvalidBlockProposal: {
|
|
139
|
+
description: 'Broadcast invalid block proposals with corrupted state (for testing only)',
|
|
140
|
+
...booleanConfigHelper(DefaultSequencerConfig.broadcastInvalidBlockProposal)
|
|
108
141
|
},
|
|
109
142
|
injectFakeAttestation: {
|
|
110
143
|
description: 'Inject a fake attestation (for testing only)',
|
|
111
|
-
...booleanConfigHelper(
|
|
144
|
+
...booleanConfigHelper(DefaultSequencerConfig.injectFakeAttestation)
|
|
145
|
+
},
|
|
146
|
+
injectHighSValueAttestation: {
|
|
147
|
+
description: 'Inject a malleable attestation with a high-s value (for testing only)',
|
|
148
|
+
...booleanConfigHelper(DefaultSequencerConfig.injectHighSValueAttestation)
|
|
149
|
+
},
|
|
150
|
+
injectUnrecoverableSignatureAttestation: {
|
|
151
|
+
description: 'Inject an attestation with an unrecoverable signature (for testing only)',
|
|
152
|
+
...booleanConfigHelper(DefaultSequencerConfig.injectUnrecoverableSignatureAttestation)
|
|
153
|
+
},
|
|
154
|
+
fishermanMode: {
|
|
155
|
+
env: 'FISHERMAN_MODE',
|
|
156
|
+
description: 'Whether to run in fisherman mode: builds blocks on every slot for validation without publishing to L1',
|
|
157
|
+
...booleanConfigHelper(DefaultSequencerConfig.fishermanMode)
|
|
158
|
+
},
|
|
159
|
+
shuffleAttestationOrdering: {
|
|
160
|
+
description: 'Shuffle attestation ordering to create invalid ordering (for testing only)',
|
|
161
|
+
...booleanConfigHelper(DefaultSequencerConfig.shuffleAttestationOrdering)
|
|
162
|
+
},
|
|
163
|
+
...sharedSequencerConfigMappings,
|
|
164
|
+
buildCheckpointIfEmpty: {
|
|
165
|
+
env: 'SEQ_BUILD_CHECKPOINT_IF_EMPTY',
|
|
166
|
+
description: 'Have sequencer build and publish an empty checkpoint if there are no txs',
|
|
167
|
+
...booleanConfigHelper(DefaultSequencerConfig.buildCheckpointIfEmpty)
|
|
168
|
+
},
|
|
169
|
+
skipPushProposedBlocksToArchiver: {
|
|
170
|
+
description: 'Skip pushing proposed blocks to archiver (default: true)',
|
|
171
|
+
...booleanConfigHelper(DefaultSequencerConfig.skipPushProposedBlocksToArchiver)
|
|
172
|
+
},
|
|
173
|
+
minBlocksForCheckpoint: {
|
|
174
|
+
description: 'Minimum number of blocks required for a checkpoint proposal (test only)'
|
|
175
|
+
},
|
|
176
|
+
skipPublishingCheckpointsPercent: {
|
|
177
|
+
env: 'SEQ_SKIP_CHECKPOINT_PUBLISH_PERCENT',
|
|
178
|
+
description: 'Percent probability (0 - 100) of sequencer skipping checkpoint publishing (testing only)',
|
|
179
|
+
...numberConfigHelper(DefaultSequencerConfig.skipPublishingCheckpointsPercent)
|
|
112
180
|
},
|
|
113
181
|
...pickConfigMappings(p2pConfigMappings, [
|
|
114
|
-
'
|
|
182
|
+
'txPublicSetupAllowListExtend'
|
|
115
183
|
])
|
|
116
184
|
};
|
|
117
185
|
export const sequencerClientConfigMappings = {
|
|
@@ -119,8 +187,8 @@ export const sequencerClientConfigMappings = {
|
|
|
119
187
|
...sequencerConfigMappings,
|
|
120
188
|
...keyStoreConfigMappings,
|
|
121
189
|
...l1ReaderConfigMappings,
|
|
122
|
-
...
|
|
123
|
-
...
|
|
190
|
+
...sequencerTxSenderConfigMappings,
|
|
191
|
+
...sequencerPublisherConfigMappings,
|
|
124
192
|
...chainConfigMappings,
|
|
125
193
|
...pickConfigMappings(l1ContractsConfigMappings, [
|
|
126
194
|
'ethereumSlotDuration',
|