@aztec/sequencer-client 3.0.3 → 3.9.9-nightly.20260312
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/sequencer-client.d.ts +32 -15
- package/dest/client/sequencer-client.d.ts.map +1 -1
- package/dest/client/sequencer-client.js +116 -27
- package/dest/config.d.ts +29 -4
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +103 -40
- package/dest/global_variable_builder/global_builder.d.ts +17 -11
- package/dest/global_variable_builder/global_builder.d.ts.map +1 -1
- package/dest/global_variable_builder/global_builder.js +48 -39
- 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 +33 -19
- package/dest/publisher/config.d.ts.map +1 -1
- package/dest/publisher/config.js +102 -43
- package/dest/publisher/sequencer-publisher-factory.d.ts +13 -5
- package/dest/publisher/sequencer-publisher-factory.d.ts.map +1 -1
- package/dest/publisher/sequencer-publisher-factory.js +14 -3
- package/dest/publisher/sequencer-publisher-metrics.d.ts +3 -3
- package/dest/publisher/sequencer-publisher-metrics.d.ts.map +1 -1
- package/dest/publisher/sequencer-publisher-metrics.js +23 -86
- package/dest/publisher/sequencer-publisher.d.ts +58 -45
- package/dest/publisher/sequencer-publisher.d.ts.map +1 -1
- package/dest/publisher/sequencer-publisher.js +628 -139
- 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 +1234 -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/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 +37 -5
- package/dest/sequencer/metrics.d.ts.map +1 -1
- package/dest/sequencer/metrics.js +216 -72
- package/dest/sequencer/sequencer.d.ts +122 -131
- package/dest/sequencer/sequencer.d.ts.map +1 -1
- package/dest/sequencer/sequencer.js +705 -635
- package/dest/sequencer/timetable.d.ts +54 -16
- package/dest/sequencer/timetable.d.ts.map +1 -1
- package/dest/sequencer/timetable.js +147 -62
- package/dest/sequencer/types.d.ts +3 -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 +5 -6
- 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 +233 -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 +30 -28
- package/src/client/sequencer-client.ts +154 -45
- package/src/config.ts +119 -45
- package/src/global_variable_builder/global_builder.ts +57 -51
- package/src/index.ts +1 -7
- package/src/publisher/config.ts +115 -46
- package/src/publisher/sequencer-publisher-factory.ts +26 -9
- package/src/publisher/sequencer-publisher-metrics.ts +19 -71
- package/src/publisher/sequencer-publisher.ts +334 -176
- package/src/sequencer/README.md +531 -0
- package/src/sequencer/checkpoint_proposal_job.ts +950 -0
- package/src/sequencer/checkpoint_voter.ts +130 -0
- package/src/sequencer/events.ts +27 -0
- package/src/sequencer/index.ts +3 -1
- package/src/sequencer/metrics.ts +267 -81
- package/src/sequencer/sequencer.ts +444 -834
- package/src/sequencer/timetable.ts +178 -83
- package/src/sequencer/types.ts +6 -0
- package/src/sequencer/utils.ts +18 -9
- package/src/test/index.ts +4 -5
- package/src/test/mock_checkpoint_builder.ts +325 -0
- package/src/test/utils.ts +167 -0
- package/dest/sequencer/block_builder.d.ts +0 -28
- package/dest/sequencer/block_builder.d.ts.map +0 -1
- package/dest/sequencer/block_builder.js +0 -127
- 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 -18
- package/dest/tx_validator/tx_validator_factory.d.ts.map +0 -1
- package/dest/tx_validator/tx_validator_factory.js +0 -53
- package/src/sequencer/block_builder.ts +0 -214
- package/src/tx_validator/nullifier_cache.ts +0 -30
- package/src/tx_validator/tx_validator_factory.ts +0 -133
|
@@ -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 {
|
|
3
|
+
import { type Delayer, L1TxUtils } from '@aztec/ethereum/l1-tx-utils';
|
|
4
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,22 @@ 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
|
+
maxDABlockGas: number;
|
|
85
|
+
maxTxsPerBlock: number;
|
|
86
|
+
maxBlocksPerCheckpoint: number;
|
|
87
|
+
};
|
|
88
|
+
//# sourceMappingURL=data:application/json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a0IsQ0FDaEMsTUFBTSxFQUFFLHFCQUFxQixFQUM3QixlQUFlLEVBQUUsTUFBTSxFQUN2QixnQkFBZ0IsRUFBRSxNQUFNLEVBQ3hCLEdBQUcsRUFBRSxVQUFVLENBQUMsT0FBTyxZQUFZLENBQUMsR0FDbkM7SUFBRSxhQUFhLEVBQUUsTUFBTSxDQUFDO0lBQUMsYUFBYSxFQUFFLE1BQU0sQ0FBQztJQUFDLGNBQWMsRUFBRSxNQUFNLENBQUM7SUFBQyxzQkFBc0IsRUFBRSxNQUFNLENBQUE7Q0FBRSxDQTJFMUcifQ==
|
|
@@ -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,WAAW,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACtE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,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,CAAC;IAAC,sBAAsB,EAAE,MAAM,CAAA;CAAE,CA2E1G"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT } from '@aztec/constants';
|
|
1
2
|
import { EpochCache } from '@aztec/epoch-cache';
|
|
2
3
|
import { isAnvilTestChain } from '@aztec/ethereum/chain';
|
|
3
4
|
import { getPublicClient } from '@aztec/ethereum/client';
|
|
@@ -8,23 +9,27 @@ import { createLogger } from '@aztec/foundation/log';
|
|
|
8
9
|
import { SlashFactoryContract } from '@aztec/stdlib/l1-contracts';
|
|
9
10
|
import { L1Metrics } from '@aztec/telemetry-client';
|
|
10
11
|
import { NodeKeystoreAdapter } from '@aztec/validator-client';
|
|
12
|
+
import { DefaultSequencerConfig, getPublisherConfigFromSequencerConfig } from '../config.js';
|
|
11
13
|
import { GlobalVariableBuilder } from '../global_variable_builder/index.js';
|
|
12
14
|
import { SequencerPublisherFactory } from '../publisher/sequencer-publisher-factory.js';
|
|
13
15
|
import { Sequencer } from '../sequencer/index.js';
|
|
16
|
+
import { SequencerTimetable } from '../sequencer/timetable.js';
|
|
14
17
|
/**
|
|
15
18
|
* Encapsulates the full sequencer and publisher.
|
|
16
19
|
*/ export class SequencerClient {
|
|
17
20
|
publisherManager;
|
|
18
21
|
sequencer;
|
|
19
|
-
|
|
22
|
+
checkpointsBuilder;
|
|
20
23
|
validatorClient;
|
|
21
24
|
l1Metrics;
|
|
22
|
-
|
|
25
|
+
delayer_;
|
|
26
|
+
constructor(publisherManager, sequencer, checkpointsBuilder, validatorClient, l1Metrics, delayer_){
|
|
23
27
|
this.publisherManager = publisherManager;
|
|
24
28
|
this.sequencer = sequencer;
|
|
25
|
-
this.
|
|
29
|
+
this.checkpointsBuilder = checkpointsBuilder;
|
|
26
30
|
this.validatorClient = validatorClient;
|
|
27
31
|
this.l1Metrics = l1Metrics;
|
|
32
|
+
this.delayer_ = delayer_;
|
|
28
33
|
}
|
|
29
34
|
/**
|
|
30
35
|
* Initializes a new instance.
|
|
@@ -38,17 +43,19 @@ import { Sequencer } from '../sequencer/index.js';
|
|
|
38
43
|
* @param prover - An instance of a block prover
|
|
39
44
|
* @returns A new running instance.
|
|
40
45
|
*/ static async new(config, deps) {
|
|
41
|
-
const { validatorClient, p2pClient, worldStateSynchronizer, slasherClient,
|
|
46
|
+
const { validatorClient, p2pClient, worldStateSynchronizer, slasherClient, checkpointsBuilder, l2BlockSource, l1ToL2MessageSource, telemetry: telemetryClient } = deps;
|
|
42
47
|
const { l1RpcUrls: rpcUrls, l1ChainId: chainId } = config;
|
|
43
48
|
const log = createLogger('sequencer');
|
|
44
49
|
const publicClient = getPublicClient(config);
|
|
45
50
|
const l1TxUtils = deps.l1TxUtils;
|
|
46
51
|
const l1Metrics = new L1Metrics(telemetryClient.getMeter('L1PublisherMetrics'), publicClient, l1TxUtils.map((x)=>x.getSenderAddress()));
|
|
47
|
-
const publisherManager = new PublisherManager(l1TxUtils, config);
|
|
52
|
+
const publisherManager = new PublisherManager(l1TxUtils, getPublisherConfigFromSequencerConfig(config), log.getBindings());
|
|
48
53
|
const rollupContract = new RollupContract(publicClient, config.l1Contracts.rollupAddress.toString());
|
|
49
|
-
const [l1GenesisTime, slotDuration] = await Promise.all([
|
|
54
|
+
const [l1GenesisTime, slotDuration, rollupVersion, rollupManaLimit] = await Promise.all([
|
|
50
55
|
rollupContract.getL1GenesisTime(),
|
|
51
|
-
rollupContract.getSlotDuration()
|
|
56
|
+
rollupContract.getSlotDuration(),
|
|
57
|
+
rollupContract.getVersion(),
|
|
58
|
+
rollupContract.getManaLimit().then(Number)
|
|
52
59
|
]);
|
|
53
60
|
const governanceProposerContract = new GovernanceProposerContract(publicClient, config.l1Contracts.governanceProposerAddress.toString());
|
|
54
61
|
const epochCache = deps.epochCache ?? await EpochCache.create(config.l1Contracts.rollupAddress, {
|
|
@@ -62,7 +69,7 @@ import { Sequencer } from '../sequencer/index.js';
|
|
|
62
69
|
const slashFactoryContract = new SlashFactoryContract(publicClient, config.l1Contracts.slashFactoryAddress?.toString() ?? EthAddress.ZERO.toString());
|
|
63
70
|
const publisherFactory = deps.publisherFactory ?? new SequencerPublisherFactory(config, {
|
|
64
71
|
telemetry: telemetryClient,
|
|
65
|
-
|
|
72
|
+
blobClient: deps.blobClient,
|
|
66
73
|
epochCache,
|
|
67
74
|
governanceProposerContract,
|
|
68
75
|
slashFactoryContract,
|
|
@@ -72,41 +79,47 @@ import { Sequencer } from '../sequencer/index.js';
|
|
|
72
79
|
nodeKeyStore: NodeKeystoreAdapter.fromKeyStoreManager(deps.nodeKeyStore),
|
|
73
80
|
logger: log
|
|
74
81
|
});
|
|
75
|
-
const globalsBuilder = new GlobalVariableBuilder(config);
|
|
76
82
|
const ethereumSlotDuration = config.ethereumSlotDuration;
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
+
const globalsBuilder = new GlobalVariableBuilder({
|
|
84
|
+
...config,
|
|
85
|
+
l1GenesisTime,
|
|
86
|
+
slotDuration: Number(slotDuration),
|
|
87
|
+
ethereumSlotDuration,
|
|
88
|
+
rollupVersion
|
|
89
|
+
});
|
|
83
90
|
// When running in anvil, assume we can post a tx up until one second before the end of an L1 slot.
|
|
84
|
-
// Otherwise,
|
|
85
|
-
// 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.
|
|
86
92
|
// In theory, the L1 slot has an initial 4s phase where the block is propagated, so we could
|
|
87
|
-
//
|
|
93
|
+
// reduce the publishing time allowance. However, we prefer being conservative.
|
|
88
94
|
// See https://www.blocknative.com/blog/anatomy-of-a-slot#7 for more info.
|
|
89
|
-
const
|
|
90
|
-
const
|
|
95
|
+
const l1PublishingTimeBasedOnChain = isAnvilTestChain(config.l1ChainId) ? 1 : ethereumSlotDuration;
|
|
96
|
+
const l1PublishingTime = config.l1PublishingTime ?? l1PublishingTimeBasedOnChain;
|
|
97
|
+
const { maxL2BlockGas, maxDABlockGas, maxTxsPerBlock, maxBlocksPerCheckpoint } = computeBlockLimits(config, rollupManaLimit, l1PublishingTime, log);
|
|
91
98
|
const l1Constants = {
|
|
92
99
|
l1GenesisTime,
|
|
93
100
|
slotDuration: Number(slotDuration),
|
|
94
|
-
ethereumSlotDuration
|
|
101
|
+
ethereumSlotDuration,
|
|
102
|
+
rollupManaLimit
|
|
95
103
|
};
|
|
96
|
-
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, {
|
|
97
105
|
...config,
|
|
98
|
-
|
|
99
|
-
maxL2BlockGas
|
|
106
|
+
l1PublishingTime,
|
|
107
|
+
maxL2BlockGas,
|
|
108
|
+
maxDABlockGas,
|
|
109
|
+
maxTxsPerBlock,
|
|
110
|
+
maxBlocksPerCheckpoint
|
|
100
111
|
}, telemetryClient, log);
|
|
101
|
-
|
|
102
|
-
|
|
112
|
+
sequencer.init();
|
|
113
|
+
// Extract the shared delayer from the first L1TxUtils instance (all instances share the same delayer)
|
|
114
|
+
const delayer = l1TxUtils[0]?.delayer;
|
|
115
|
+
return new SequencerClient(publisherManager, sequencer, checkpointsBuilder, validatorClient, l1Metrics, delayer);
|
|
103
116
|
}
|
|
104
117
|
/**
|
|
105
118
|
* Updates sequencer and validator client config.
|
|
106
119
|
* @param config - New parameters.
|
|
107
120
|
*/ updateConfig(config) {
|
|
108
121
|
this.sequencer.updateConfig(config);
|
|
109
|
-
this.
|
|
122
|
+
this.checkpointsBuilder.updateConfig(config);
|
|
110
123
|
this.validatorClient?.updateConfig(config);
|
|
111
124
|
}
|
|
112
125
|
/** Starts the sequencer. */ async start() {
|
|
@@ -126,6 +139,12 @@ import { Sequencer } from '../sequencer/index.js';
|
|
|
126
139
|
getSequencer() {
|
|
127
140
|
return this.sequencer;
|
|
128
141
|
}
|
|
142
|
+
/** Updates the publisher factory's node keystore adapter after a keystore reload. */ updatePublisherNodeKeyStore(adapter) {
|
|
143
|
+
this.sequencer.updatePublisherNodeKeyStore(adapter);
|
|
144
|
+
}
|
|
145
|
+
/** Returns the shared tx delayer for sequencer L1 txs, if enabled. Test-only. */ getDelayer() {
|
|
146
|
+
return this.delayer_;
|
|
147
|
+
}
|
|
129
148
|
get validatorAddresses() {
|
|
130
149
|
return this.sequencer.getValidatorAddresses();
|
|
131
150
|
}
|
|
@@ -133,3 +152,73 @@ import { Sequencer } from '../sequencer/index.js';
|
|
|
133
152
|
return this.sequencer.maxL2BlockGas;
|
|
134
153
|
}
|
|
135
154
|
}
|
|
155
|
+
/**
|
|
156
|
+
* Computes per-block L2 gas, DA gas, and TX count budgets based on the L1 rollup limits and the timetable.
|
|
157
|
+
* If the user explicitly set a limit, it is capped at the corresponding checkpoint limit.
|
|
158
|
+
* Otherwise, derives it as (checkpointLimit / maxBlocks) * multiplier, capped at the checkpoint limit.
|
|
159
|
+
*/ export function computeBlockLimits(config, rollupManaLimit, l1PublishingTime, log) {
|
|
160
|
+
const maxNumberOfBlocks = new SequencerTimetable({
|
|
161
|
+
ethereumSlotDuration: config.ethereumSlotDuration,
|
|
162
|
+
aztecSlotDuration: config.aztecSlotDuration,
|
|
163
|
+
l1PublishingTime,
|
|
164
|
+
p2pPropagationTime: config.attestationPropagationTime,
|
|
165
|
+
blockDurationMs: config.blockDurationMs,
|
|
166
|
+
enforce: config.enforceTimeTable ?? DefaultSequencerConfig.enforceTimeTable
|
|
167
|
+
}).maxNumberOfBlocks;
|
|
168
|
+
const multiplier = config.perBlockAllocationMultiplier ?? DefaultSequencerConfig.perBlockAllocationMultiplier;
|
|
169
|
+
// Compute maxL2BlockGas
|
|
170
|
+
let maxL2BlockGas;
|
|
171
|
+
if (config.maxL2BlockGas !== undefined) {
|
|
172
|
+
if (config.maxL2BlockGas > rollupManaLimit) {
|
|
173
|
+
log.warn(`Provided MAX_L2_BLOCK_GAS ${config.maxL2BlockGas} exceeds L1 rollup mana limit ${rollupManaLimit} (capping)`);
|
|
174
|
+
maxL2BlockGas = rollupManaLimit;
|
|
175
|
+
} else {
|
|
176
|
+
maxL2BlockGas = config.maxL2BlockGas;
|
|
177
|
+
}
|
|
178
|
+
} else {
|
|
179
|
+
maxL2BlockGas = Math.min(rollupManaLimit, Math.ceil(rollupManaLimit / maxNumberOfBlocks * multiplier));
|
|
180
|
+
}
|
|
181
|
+
// Compute maxDABlockGas
|
|
182
|
+
const daCheckpointLimit = MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT;
|
|
183
|
+
let maxDABlockGas;
|
|
184
|
+
if (config.maxDABlockGas !== undefined) {
|
|
185
|
+
if (config.maxDABlockGas > daCheckpointLimit) {
|
|
186
|
+
log.warn(`Provided MAX_DA_BLOCK_GAS ${config.maxDABlockGas} exceeds DA checkpoint limit ${daCheckpointLimit} (capping)`);
|
|
187
|
+
maxDABlockGas = daCheckpointLimit;
|
|
188
|
+
} else {
|
|
189
|
+
maxDABlockGas = config.maxDABlockGas;
|
|
190
|
+
}
|
|
191
|
+
} else {
|
|
192
|
+
maxDABlockGas = Math.min(daCheckpointLimit, Math.ceil(daCheckpointLimit / maxNumberOfBlocks * multiplier));
|
|
193
|
+
}
|
|
194
|
+
// Compute maxTxsPerBlock
|
|
195
|
+
const defaultMaxTxsPerBlock = 32;
|
|
196
|
+
let maxTxsPerBlock;
|
|
197
|
+
if (config.maxTxsPerBlock !== undefined) {
|
|
198
|
+
if (config.maxTxsPerCheckpoint !== undefined && config.maxTxsPerBlock > config.maxTxsPerCheckpoint) {
|
|
199
|
+
log.warn(`Provided MAX_TX_PER_BLOCK ${config.maxTxsPerBlock} exceeds MAX_TX_PER_CHECKPOINT ${config.maxTxsPerCheckpoint} (capping)`);
|
|
200
|
+
maxTxsPerBlock = config.maxTxsPerCheckpoint;
|
|
201
|
+
} else {
|
|
202
|
+
maxTxsPerBlock = config.maxTxsPerBlock;
|
|
203
|
+
}
|
|
204
|
+
} else if (config.maxTxsPerCheckpoint !== undefined) {
|
|
205
|
+
maxTxsPerBlock = Math.min(config.maxTxsPerCheckpoint, Math.ceil(config.maxTxsPerCheckpoint / maxNumberOfBlocks * multiplier));
|
|
206
|
+
} else {
|
|
207
|
+
maxTxsPerBlock = defaultMaxTxsPerBlock;
|
|
208
|
+
}
|
|
209
|
+
log.info(`Computed block limits L2=${maxL2BlockGas} DA=${maxDABlockGas} maxTxs=${maxTxsPerBlock}`, {
|
|
210
|
+
maxL2BlockGas,
|
|
211
|
+
maxDABlockGas,
|
|
212
|
+
maxTxsPerBlock,
|
|
213
|
+
rollupManaLimit,
|
|
214
|
+
daCheckpointLimit,
|
|
215
|
+
maxNumberOfBlocks,
|
|
216
|
+
multiplier
|
|
217
|
+
});
|
|
218
|
+
return {
|
|
219
|
+
maxL2BlockGas,
|
|
220
|
+
maxDABlockGas,
|
|
221
|
+
maxTxsPerBlock,
|
|
222
|
+
maxBlocksPerCheckpoint: maxNumberOfBlocks
|
|
223
|
+
};
|
|
224
|
+
}
|
package/dest/config.d.ts
CHANGED
|
@@ -5,18 +5,43 @@ import { type KeyStoreConfig } from '@aztec/node-keystore/config';
|
|
|
5
5
|
import { type P2PConfig } from '@aztec/p2p/config';
|
|
6
6
|
import { type ChainConfig, type SequencerConfig } from '@aztec/stdlib/config';
|
|
7
7
|
import { type ValidatorClientConfig } from '@aztec/validator-client/config';
|
|
8
|
-
import { type
|
|
8
|
+
import { type SequencerPublisherConfig, type SequencerTxSenderConfig } from './publisher/config.js';
|
|
9
9
|
export * from './publisher/config.js';
|
|
10
10
|
export type { SequencerConfig };
|
|
11
|
-
|
|
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
|
+
redistributeCheckpointBudget: true;
|
|
22
|
+
enforceTimeTable: true;
|
|
23
|
+
attestationPropagationTime: number;
|
|
24
|
+
secondsBeforeInvalidatingBlockAsCommitteeMember: number;
|
|
25
|
+
secondsBeforeInvalidatingBlockAsNonCommitteeMember: number;
|
|
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: number;
|
|
36
|
+
};
|
|
12
37
|
/**
|
|
13
38
|
* Configuration settings for the SequencerClient.
|
|
14
39
|
*/
|
|
15
|
-
export type SequencerClientConfig =
|
|
40
|
+
export type SequencerClientConfig = SequencerPublisherConfig & KeyStoreConfig & ValidatorClientConfig & SequencerTxSenderConfig & SequencerConfig & L1ReaderConfig & ChainConfig & Pick<P2PConfig, 'txPublicSetupAllowListExtend'> & Pick<L1ContractsConfig, 'ethereumSlotDuration' | 'aztecSlotDuration' | 'aztecEpochDuration'>;
|
|
16
41
|
export declare const sequencerConfigMappings: ConfigMappingsType<SequencerConfig>;
|
|
17
42
|
export declare const sequencerClientConfigMappings: ConfigMappingsType<SequencerClientConfig>;
|
|
18
43
|
/**
|
|
19
44
|
* Creates an instance of SequencerClientConfig out of environment variables using sensible defaults for integration testing if not set.
|
|
20
45
|
*/
|
|
21
46
|
export declare function getConfigEnvVars(): SequencerClientConfig;
|
|
22
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
47
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlnLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvY29uZmlnLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ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sZUFBTyxNQUFNLHVCQUF1QixFQUFFLGtCQUFrQixDQUFDLGVBQWUsQ0FtS3ZFLENBQUM7QUFFRixlQUFPLE1BQU0sNkJBQTZCLEVBQUUsa0JBQWtCLENBQUMscUJBQXFCLENBU25GLENBQUM7QUFFRjs7R0FFRztBQUNILHdCQUFnQixnQkFBZ0IsSUFBSSxxQkFBcUIsQ0FFeEQifQ==
|
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,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,
|
|
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;;;;;;;;;;;;;;;;;;;;;CAqBA,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,CAmKvE,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,kBAAkB,CAAC,qBAAqB,CASnF,CAAC;AAEF;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,qBAAqB,CAExD"}
|
package/dest/config.js
CHANGED
|
@@ -5,41 +5,82 @@ import { EthAddress } from '@aztec/foundation/eth-address';
|
|
|
5
5
|
import { keyStoreConfigMappings } from '@aztec/node-keystore/config';
|
|
6
6
|
import { p2pConfigMappings } from '@aztec/p2p/config';
|
|
7
7
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
8
|
-
import { chainConfigMappings } from '@aztec/stdlib/config';
|
|
8
|
+
import { chainConfigMappings, sharedSequencerConfigMappings } from '@aztec/stdlib/config';
|
|
9
|
+
import { DEFAULT_P2P_PROPAGATION_TIME } from '@aztec/stdlib/timetable';
|
|
9
10
|
import { validatorClientConfigMappings } from '@aztec/validator-client/config';
|
|
10
|
-
import {
|
|
11
|
+
import { sequencerPublisherConfigMappings, sequencerTxSenderConfigMappings } from './publisher/config.js';
|
|
11
12
|
export * from './publisher/config.js';
|
|
12
|
-
|
|
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: 1.2,
|
|
22
|
+
redistributeCheckpointBudget: true,
|
|
23
|
+
enforceTimeTable: true,
|
|
24
|
+
attestationPropagationTime: DEFAULT_P2P_PROPAGATION_TIME,
|
|
25
|
+
secondsBeforeInvalidatingBlockAsCommitteeMember: 144,
|
|
26
|
+
secondsBeforeInvalidatingBlockAsNonCommitteeMember: 432,
|
|
27
|
+
skipCollectingAttestations: false,
|
|
28
|
+
skipInvalidateBlockAsProposer: false,
|
|
29
|
+
broadcastInvalidBlockProposal: false,
|
|
30
|
+
injectFakeAttestation: false,
|
|
31
|
+
injectHighSValueAttestation: false,
|
|
32
|
+
injectUnrecoverableSignatureAttestation: false,
|
|
33
|
+
fishermanMode: false,
|
|
34
|
+
shuffleAttestationOrdering: false,
|
|
35
|
+
skipPushProposedBlocksToArchiver: false,
|
|
36
|
+
skipPublishingCheckpointsPercent: 0
|
|
37
|
+
};
|
|
13
38
|
export const sequencerConfigMappings = {
|
|
14
|
-
|
|
15
|
-
env: '
|
|
16
|
-
description: 'The number of ms to wait between polling for
|
|
17
|
-
...numberConfigHelper(
|
|
18
|
-
},
|
|
19
|
-
|
|
20
|
-
env: '
|
|
21
|
-
description: 'The maximum number of txs
|
|
22
|
-
|
|
39
|
+
sequencerPollingIntervalMS: {
|
|
40
|
+
env: 'SEQ_POLLING_INTERVAL_MS',
|
|
41
|
+
description: 'The number of ms to wait between polling for checking to build on the next slot.',
|
|
42
|
+
...numberConfigHelper(DefaultSequencerConfig.sequencerPollingIntervalMS)
|
|
43
|
+
},
|
|
44
|
+
maxTxsPerCheckpoint: {
|
|
45
|
+
env: 'SEQ_MAX_TX_PER_CHECKPOINT',
|
|
46
|
+
description: 'The maximum number of txs across all blocks in a checkpoint.',
|
|
47
|
+
parseEnv: (val)=>val ? parseInt(val, 10) : undefined
|
|
23
48
|
},
|
|
24
49
|
minTxsPerBlock: {
|
|
25
50
|
env: 'SEQ_MIN_TX_PER_BLOCK',
|
|
26
51
|
description: 'The minimum number of txs to include in a block.',
|
|
27
|
-
...numberConfigHelper(
|
|
52
|
+
...numberConfigHelper(DefaultSequencerConfig.minTxsPerBlock)
|
|
53
|
+
},
|
|
54
|
+
minValidTxsPerBlock: {
|
|
55
|
+
description: 'The minimum number of valid txs (after execution) to include in a block. If not set, falls back to minTxsPerBlock.'
|
|
28
56
|
},
|
|
29
57
|
publishTxsWithProposals: {
|
|
30
58
|
env: 'SEQ_PUBLISH_TXS_WITH_PROPOSALS',
|
|
31
59
|
description: 'Whether to publish txs with proposals.',
|
|
32
|
-
...booleanConfigHelper(
|
|
60
|
+
...booleanConfigHelper(DefaultSequencerConfig.publishTxsWithProposals)
|
|
33
61
|
},
|
|
34
62
|
maxL2BlockGas: {
|
|
35
63
|
env: 'SEQ_MAX_L2_BLOCK_GAS',
|
|
36
64
|
description: 'The maximum L2 block gas.',
|
|
37
|
-
|
|
65
|
+
parseEnv: (val)=>val ? parseInt(val, 10) : undefined
|
|
38
66
|
},
|
|
39
67
|
maxDABlockGas: {
|
|
40
68
|
env: 'SEQ_MAX_DA_BLOCK_GAS',
|
|
41
69
|
description: 'The maximum DA block gas.',
|
|
42
|
-
|
|
70
|
+
parseEnv: (val)=>val ? parseInt(val, 10) : undefined
|
|
71
|
+
},
|
|
72
|
+
perBlockAllocationMultiplier: {
|
|
73
|
+
env: 'SEQ_PER_BLOCK_ALLOCATION_MULTIPLIER',
|
|
74
|
+
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.',
|
|
75
|
+
...numberConfigHelper(DefaultSequencerConfig.perBlockAllocationMultiplier)
|
|
76
|
+
},
|
|
77
|
+
redistributeCheckpointBudget: {
|
|
78
|
+
env: 'SEQ_REDISTRIBUTE_CHECKPOINT_BUDGET',
|
|
79
|
+
description: 'Redistribute remaining checkpoint budget evenly across remaining blocks instead of allowing a single block to consume the entire remaining budget.',
|
|
80
|
+
...booleanConfigHelper(DefaultSequencerConfig.redistributeCheckpointBudget)
|
|
81
|
+
},
|
|
82
|
+
maxBlocksPerCheckpoint: {
|
|
83
|
+
description: 'Computed max number of blocks per checkpoint from timetable.'
|
|
43
84
|
},
|
|
44
85
|
coinbase: {
|
|
45
86
|
env: 'COINBASE',
|
|
@@ -59,73 +100,95 @@ export const sequencerConfigMappings = {
|
|
|
59
100
|
env: 'ACVM_BINARY_PATH',
|
|
60
101
|
description: 'The path to the ACVM binary'
|
|
61
102
|
},
|
|
62
|
-
maxBlockSizeInBytes: {
|
|
63
|
-
env: 'SEQ_MAX_BLOCK_SIZE_IN_BYTES',
|
|
64
|
-
description: 'Max block size',
|
|
65
|
-
...numberConfigHelper(1024 * 1024)
|
|
66
|
-
},
|
|
67
103
|
enforceTimeTable: {
|
|
68
104
|
env: 'SEQ_ENFORCE_TIME_TABLE',
|
|
69
105
|
description: 'Whether to enforce the time table when building blocks',
|
|
70
|
-
...booleanConfigHelper()
|
|
71
|
-
defaultValue: true
|
|
106
|
+
...booleanConfigHelper(DefaultSequencerConfig.enforceTimeTable)
|
|
72
107
|
},
|
|
73
108
|
governanceProposerPayload: {
|
|
74
109
|
env: 'GOVERNANCE_PROPOSER_PAYLOAD_ADDRESS',
|
|
75
110
|
description: 'The address of the payload for the governanceProposer',
|
|
76
|
-
parseEnv: (val)=>EthAddress.fromString(val)
|
|
77
|
-
defaultValue: EthAddress.ZERO
|
|
111
|
+
parseEnv: (val)=>EthAddress.fromString(val)
|
|
78
112
|
},
|
|
79
|
-
|
|
80
|
-
env: '
|
|
81
|
-
description: 'How
|
|
113
|
+
l1PublishingTime: {
|
|
114
|
+
env: 'SEQ_L1_PUBLISHING_TIME_ALLOWANCE_IN_SLOT',
|
|
115
|
+
description: 'How much time (in seconds) we allow in the slot for publishing the L1 tx (defaults to 1 L1 slot).',
|
|
82
116
|
parseEnv: (val)=>val ? parseInt(val, 10) : undefined
|
|
83
117
|
},
|
|
84
118
|
attestationPropagationTime: {
|
|
85
119
|
env: 'SEQ_ATTESTATION_PROPAGATION_TIME',
|
|
86
120
|
description: 'How many seconds it takes for proposals and attestations to travel across the p2p layer (one-way)',
|
|
87
|
-
...numberConfigHelper(
|
|
121
|
+
...numberConfigHelper(DefaultSequencerConfig.attestationPropagationTime)
|
|
88
122
|
},
|
|
89
123
|
fakeProcessingDelayPerTxMs: {
|
|
90
124
|
description: 'Used for testing to introduce a fake delay after processing each tx'
|
|
91
125
|
},
|
|
126
|
+
fakeThrowAfterProcessingTxCount: {
|
|
127
|
+
description: 'Used for testing to throw an error after processing N txs'
|
|
128
|
+
},
|
|
92
129
|
secondsBeforeInvalidatingBlockAsCommitteeMember: {
|
|
93
130
|
env: 'SEQ_SECONDS_BEFORE_INVALIDATING_BLOCK_AS_COMMITTEE_MEMBER',
|
|
94
131
|
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.',
|
|
95
|
-
...numberConfigHelper(
|
|
132
|
+
...numberConfigHelper(DefaultSequencerConfig.secondsBeforeInvalidatingBlockAsCommitteeMember)
|
|
96
133
|
},
|
|
97
134
|
secondsBeforeInvalidatingBlockAsNonCommitteeMember: {
|
|
98
135
|
env: 'SEQ_SECONDS_BEFORE_INVALIDATING_BLOCK_AS_NON_COMMITTEE_MEMBER',
|
|
99
136
|
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.',
|
|
100
|
-
...numberConfigHelper(
|
|
137
|
+
...numberConfigHelper(DefaultSequencerConfig.secondsBeforeInvalidatingBlockAsNonCommitteeMember)
|
|
101
138
|
},
|
|
102
139
|
skipCollectingAttestations: {
|
|
103
140
|
description: 'Whether to skip collecting attestations from validators and only use self-attestations (for testing only)',
|
|
104
|
-
...booleanConfigHelper(
|
|
141
|
+
...booleanConfigHelper(DefaultSequencerConfig.skipCollectingAttestations)
|
|
105
142
|
},
|
|
106
143
|
skipInvalidateBlockAsProposer: {
|
|
107
144
|
description: 'Do not invalidate the previous block if invalid when we are the proposer (for testing only)',
|
|
108
|
-
...booleanConfigHelper(
|
|
145
|
+
...booleanConfigHelper(DefaultSequencerConfig.skipInvalidateBlockAsProposer)
|
|
109
146
|
},
|
|
110
147
|
broadcastInvalidBlockProposal: {
|
|
111
148
|
description: 'Broadcast invalid block proposals with corrupted state (for testing only)',
|
|
112
|
-
...booleanConfigHelper(
|
|
149
|
+
...booleanConfigHelper(DefaultSequencerConfig.broadcastInvalidBlockProposal)
|
|
113
150
|
},
|
|
114
151
|
injectFakeAttestation: {
|
|
115
152
|
description: 'Inject a fake attestation (for testing only)',
|
|
116
|
-
...booleanConfigHelper(
|
|
153
|
+
...booleanConfigHelper(DefaultSequencerConfig.injectFakeAttestation)
|
|
154
|
+
},
|
|
155
|
+
injectHighSValueAttestation: {
|
|
156
|
+
description: 'Inject a malleable attestation with a high-s value (for testing only)',
|
|
157
|
+
...booleanConfigHelper(DefaultSequencerConfig.injectHighSValueAttestation)
|
|
158
|
+
},
|
|
159
|
+
injectUnrecoverableSignatureAttestation: {
|
|
160
|
+
description: 'Inject an attestation with an unrecoverable signature (for testing only)',
|
|
161
|
+
...booleanConfigHelper(DefaultSequencerConfig.injectUnrecoverableSignatureAttestation)
|
|
117
162
|
},
|
|
118
163
|
fishermanMode: {
|
|
119
164
|
env: 'FISHERMAN_MODE',
|
|
120
165
|
description: 'Whether to run in fisherman mode: builds blocks on every slot for validation without publishing to L1',
|
|
121
|
-
...booleanConfigHelper(
|
|
166
|
+
...booleanConfigHelper(DefaultSequencerConfig.fishermanMode)
|
|
122
167
|
},
|
|
123
168
|
shuffleAttestationOrdering: {
|
|
124
169
|
description: 'Shuffle attestation ordering to create invalid ordering (for testing only)',
|
|
125
|
-
...booleanConfigHelper(
|
|
170
|
+
...booleanConfigHelper(DefaultSequencerConfig.shuffleAttestationOrdering)
|
|
171
|
+
},
|
|
172
|
+
...sharedSequencerConfigMappings,
|
|
173
|
+
buildCheckpointIfEmpty: {
|
|
174
|
+
env: 'SEQ_BUILD_CHECKPOINT_IF_EMPTY',
|
|
175
|
+
description: 'Have sequencer build and publish an empty checkpoint if there are no txs',
|
|
176
|
+
...booleanConfigHelper(DefaultSequencerConfig.buildCheckpointIfEmpty)
|
|
177
|
+
},
|
|
178
|
+
skipPushProposedBlocksToArchiver: {
|
|
179
|
+
description: 'Skip pushing proposed blocks to archiver (default: true)',
|
|
180
|
+
...booleanConfigHelper(DefaultSequencerConfig.skipPushProposedBlocksToArchiver)
|
|
181
|
+
},
|
|
182
|
+
minBlocksForCheckpoint: {
|
|
183
|
+
description: 'Minimum number of blocks required for a checkpoint proposal (test only)'
|
|
184
|
+
},
|
|
185
|
+
skipPublishingCheckpointsPercent: {
|
|
186
|
+
env: 'SEQ_SKIP_CHECKPOINT_PUBLISH_PERCENT',
|
|
187
|
+
description: 'Percent probability (0 - 100) of sequencer skipping checkpoint publishing (testing only)',
|
|
188
|
+
...numberConfigHelper(DefaultSequencerConfig.skipPublishingCheckpointsPercent)
|
|
126
189
|
},
|
|
127
190
|
...pickConfigMappings(p2pConfigMappings, [
|
|
128
|
-
'
|
|
191
|
+
'txPublicSetupAllowListExtend'
|
|
129
192
|
])
|
|
130
193
|
};
|
|
131
194
|
export const sequencerClientConfigMappings = {
|
|
@@ -133,8 +196,8 @@ export const sequencerClientConfigMappings = {
|
|
|
133
196
|
...sequencerConfigMappings,
|
|
134
197
|
...keyStoreConfigMappings,
|
|
135
198
|
...l1ReaderConfigMappings,
|
|
136
|
-
...
|
|
137
|
-
...
|
|
199
|
+
...sequencerTxSenderConfigMappings,
|
|
200
|
+
...sequencerPublisherConfigMappings,
|
|
138
201
|
...chainConfigMappings,
|
|
139
202
|
...pickConfigMappings(l1ContractsConfigMappings, [
|
|
140
203
|
'ethereumSlotDuration',
|