@aztec/sequencer-client 0.0.0-test.1 → 0.0.1-commit.017a351
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/README.md +281 -21
- package/dest/client/index.d.ts +1 -1
- package/dest/client/sequencer-client.d.ts +43 -33
- package/dest/client/sequencer-client.d.ts.map +1 -1
- package/dest/client/sequencer-client.js +117 -62
- package/dest/config.d.ts +38 -17
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +172 -85
- package/dest/global_variable_builder/fee_predictor.d.ts +37 -0
- package/dest/global_variable_builder/fee_predictor.d.ts.map +1 -0
- package/dest/global_variable_builder/fee_predictor.js +128 -0
- package/dest/global_variable_builder/fee_provider.d.ts +21 -0
- package/dest/global_variable_builder/fee_provider.d.ts.map +1 -0
- package/dest/global_variable_builder/fee_provider.js +58 -0
- package/dest/global_variable_builder/global_builder.d.ts +26 -17
- package/dest/global_variable_builder/global_builder.d.ts.map +1 -1
- package/dest/global_variable_builder/global_builder.js +45 -61
- package/dest/global_variable_builder/index.d.ts +4 -2
- package/dest/global_variable_builder/index.d.ts.map +1 -1
- package/dest/global_variable_builder/index.js +2 -0
- package/dest/index.d.ts +2 -4
- package/dest/index.d.ts.map +1 -1
- package/dest/index.js +1 -3
- package/dest/publisher/config.d.ts +60 -27
- package/dest/publisher/config.d.ts.map +1 -1
- package/dest/publisher/config.js +124 -32
- package/dest/publisher/index.d.ts +4 -1
- package/dest/publisher/index.d.ts.map +1 -1
- package/dest/publisher/index.js +3 -0
- 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 +58 -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-bundle-simulator.d.ts +96 -0
- package/dest/publisher/sequencer-bundle-simulator.d.ts.map +1 -0
- package/dest/publisher/sequencer-bundle-simulator.js +198 -0
- package/dest/publisher/sequencer-publisher-factory.d.ts +50 -0
- package/dest/publisher/sequencer-publisher-factory.d.ts.map +1 -0
- package/dest/publisher/sequencer-publisher-factory.js +75 -0
- package/dest/publisher/sequencer-publisher-metrics.d.ts +5 -4
- package/dest/publisher/sequencer-publisher-metrics.d.ts.map +1 -1
- package/dest/publisher/sequencer-publisher-metrics.js +34 -62
- package/dest/publisher/sequencer-publisher.d.ts +170 -97
- package/dest/publisher/sequencer-publisher.d.ts.map +1 -1
- package/dest/publisher/sequencer-publisher.js +1255 -276
- package/dest/sequencer/automine/automine_factory.d.ts +54 -0
- package/dest/sequencer/automine/automine_factory.d.ts.map +1 -0
- package/dest/sequencer/automine/automine_factory.js +84 -0
- package/dest/sequencer/automine/automine_sequencer.d.ts +151 -0
- package/dest/sequencer/automine/automine_sequencer.d.ts.map +1 -0
- package/dest/sequencer/automine/automine_sequencer.js +509 -0
- package/dest/sequencer/chain_state_overrides.d.ts +61 -0
- package/dest/sequencer/chain_state_overrides.d.ts.map +1 -0
- package/dest/sequencer/chain_state_overrides.js +98 -0
- package/dest/sequencer/checkpoint_proposal_job.d.ts +150 -0
- package/dest/sequencer/checkpoint_proposal_job.d.ts.map +1 -0
- package/dest/sequencer/checkpoint_proposal_job.js +1792 -0
- package/dest/sequencer/checkpoint_proposal_job_metrics.d.ts +34 -0
- package/dest/sequencer/checkpoint_proposal_job_metrics.d.ts.map +1 -0
- package/dest/sequencer/checkpoint_proposal_job_metrics.js +72 -0
- package/dest/sequencer/checkpoint_voter.d.ts +34 -0
- package/dest/sequencer/checkpoint_voter.d.ts.map +1 -0
- package/dest/sequencer/checkpoint_voter.js +106 -0
- package/dest/sequencer/config.d.ts +7 -1
- package/dest/sequencer/config.d.ts.map +1 -1
- package/dest/sequencer/errors.d.ts +11 -0
- package/dest/sequencer/errors.d.ts.map +1 -0
- package/dest/sequencer/errors.js +15 -0
- package/dest/sequencer/events.d.ts +92 -0
- package/dest/sequencer/events.d.ts.map +1 -0
- package/dest/sequencer/events.js +1 -0
- package/dest/sequencer/index.d.ts +6 -2
- package/dest/sequencer/index.d.ts.map +1 -1
- package/dest/sequencer/index.js +5 -1
- package/dest/sequencer/metrics.d.ts +64 -13
- package/dest/sequencer/metrics.d.ts.map +1 -1
- package/dest/sequencer/metrics.js +309 -68
- package/dest/sequencer/sequencer.d.ts +205 -135
- package/dest/sequencer/sequencer.d.ts.map +1 -1
- package/dest/sequencer/sequencer.js +1208 -523
- package/dest/sequencer/timetable.d.ts +85 -25
- package/dest/sequencer/timetable.d.ts.map +1 -1
- package/dest/sequencer/timetable.js +177 -60
- 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 +20 -38
- package/dest/sequencer/utils.d.ts.map +1 -1
- package/dest/sequencer/utils.js +12 -47
- package/dest/test/index.d.ts +9 -3
- package/dest/test/index.d.ts.map +1 -1
- package/dest/test/index.js +0 -4
- 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 +105 -0
- package/package.json +46 -45
- package/src/client/sequencer-client.ts +158 -103
- package/src/config.ts +201 -99
- package/src/global_variable_builder/README.md +44 -0
- package/src/global_variable_builder/fee_predictor.ts +172 -0
- package/src/global_variable_builder/fee_provider.ts +75 -0
- package/src/global_variable_builder/global_builder.ts +68 -76
- package/src/global_variable_builder/index.ts +3 -1
- package/src/index.ts +10 -3
- package/src/publisher/config.ts +184 -59
- package/src/publisher/index.ts +7 -0
- package/src/publisher/l1_tx_failed_store/factory.ts +32 -0
- package/src/publisher/l1_tx_failed_store/failed_tx_store.ts +57 -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-bundle-simulator.ts +254 -0
- package/src/publisher/sequencer-publisher-factory.ts +121 -0
- package/src/publisher/sequencer-publisher-metrics.ts +33 -63
- package/src/publisher/sequencer-publisher.ts +1101 -350
- package/src/sequencer/README.md +243 -0
- package/src/sequencer/automine/README.md +46 -0
- package/src/sequencer/automine/automine_factory.ts +145 -0
- package/src/sequencer/automine/automine_sequencer.ts +595 -0
- package/src/sequencer/chain_state_overrides.ts +162 -0
- package/src/sequencer/checkpoint_proposal_job.ts +1632 -0
- package/src/sequencer/checkpoint_proposal_job_metrics.ts +128 -0
- package/src/sequencer/checkpoint_voter.ts +119 -0
- package/src/sequencer/config.ts +8 -0
- package/src/sequencer/errors.ts +21 -0
- package/src/sequencer/events.ts +76 -0
- package/src/sequencer/index.ts +5 -1
- package/src/sequencer/metrics.ts +397 -75
- package/src/sequencer/sequencer.ts +1013 -579
- package/src/sequencer/timetable.ts +225 -60
- package/src/sequencer/types.ts +6 -0
- package/src/sequencer/utils.ts +28 -60
- package/src/test/index.ts +11 -5
- package/src/test/mock_checkpoint_builder.ts +323 -0
- package/src/test/utils.ts +185 -0
- package/dest/sequencer/allowed.d.ts +0 -3
- package/dest/sequencer/allowed.d.ts.map +0 -1
- package/dest/sequencer/allowed.js +0 -27
- package/dest/slasher/factory.d.ts +0 -7
- package/dest/slasher/factory.d.ts.map +0 -1
- package/dest/slasher/factory.js +0 -8
- package/dest/slasher/index.d.ts +0 -3
- package/dest/slasher/index.d.ts.map +0 -1
- package/dest/slasher/index.js +0 -2
- package/dest/slasher/slasher_client.d.ts +0 -75
- package/dest/slasher/slasher_client.d.ts.map +0 -1
- package/dest/slasher/slasher_client.js +0 -132
- package/dest/tx_validator/archive_cache.d.ts +0 -14
- package/dest/tx_validator/archive_cache.d.ts.map +0 -1
- package/dest/tx_validator/archive_cache.js +0 -22
- package/dest/tx_validator/gas_validator.d.ts +0 -14
- package/dest/tx_validator/gas_validator.d.ts.map +0 -1
- package/dest/tx_validator/gas_validator.js +0 -78
- package/dest/tx_validator/nullifier_cache.d.ts +0 -16
- package/dest/tx_validator/nullifier_cache.d.ts.map +0 -1
- package/dest/tx_validator/nullifier_cache.js +0 -24
- package/dest/tx_validator/phases_validator.d.ts +0 -12
- package/dest/tx_validator/phases_validator.d.ts.map +0 -1
- package/dest/tx_validator/phases_validator.js +0 -80
- package/dest/tx_validator/test_utils.d.ts +0 -23
- package/dest/tx_validator/test_utils.d.ts.map +0 -1
- package/dest/tx_validator/test_utils.js +0 -26
- 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 -50
- package/src/sequencer/allowed.ts +0 -36
- package/src/slasher/factory.ts +0 -15
- package/src/slasher/index.ts +0 -2
- package/src/slasher/slasher_client.ts +0 -193
- package/src/tx_validator/archive_cache.ts +0 -28
- package/src/tx_validator/gas_validator.ts +0 -101
- package/src/tx_validator/nullifier_cache.ts +0 -30
- package/src/tx_validator/phases_validator.ts +0 -98
- package/src/tx_validator/test_utils.ts +0 -48
- package/src/tx_validator/tx_validator_factory.ts +0 -120
|
@@ -1,22 +1,34 @@
|
|
|
1
|
+
import { MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT } from '@aztec/constants';
|
|
1
2
|
import { EpochCache } from '@aztec/epoch-cache';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
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';
|
|
5
7
|
import { createLogger } from '@aztec/foundation/log';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
8
|
+
import { L1Metrics } from '@aztec/telemetry-client';
|
|
9
|
+
import { NodeKeystoreAdapter } from '@aztec/validator-client';
|
|
10
|
+
import { getPublisherConfigFromSequencerConfig } from '../config.js';
|
|
11
|
+
import { SequencerPublisherFactory } from '../publisher/sequencer-publisher-factory.js';
|
|
10
12
|
import { Sequencer } from '../sequencer/index.js';
|
|
11
13
|
/**
|
|
12
14
|
* Encapsulates the full sequencer and publisher.
|
|
13
15
|
*/ export class SequencerClient {
|
|
16
|
+
publisherManager;
|
|
14
17
|
sequencer;
|
|
15
|
-
|
|
18
|
+
checkpointsBuilder;
|
|
19
|
+
validatorClient;
|
|
20
|
+
l1Metrics;
|
|
21
|
+
delayer_;
|
|
22
|
+
constructor(publisherManager, sequencer, checkpointsBuilder, validatorClient, l1Metrics, delayer_){
|
|
23
|
+
this.publisherManager = publisherManager;
|
|
16
24
|
this.sequencer = sequencer;
|
|
25
|
+
this.checkpointsBuilder = checkpointsBuilder;
|
|
26
|
+
this.validatorClient = validatorClient;
|
|
27
|
+
this.l1Metrics = l1Metrics;
|
|
28
|
+
this.delayer_ = delayer_;
|
|
17
29
|
}
|
|
18
30
|
/**
|
|
19
|
-
* Initializes
|
|
31
|
+
* Initializes a new instance.
|
|
20
32
|
* @param config - Configuration for the sequencer, publisher, and L1 tx sender.
|
|
21
33
|
* @param p2pClient - P2P client that provides the txs to be sequenced.
|
|
22
34
|
* @param validatorClient - Validator client performs attestation duties when rotating proposers.
|
|
@@ -25,93 +37,136 @@ import { Sequencer } from '../sequencer/index.js';
|
|
|
25
37
|
* @param l2BlockSource - Provides information about the previously published blocks.
|
|
26
38
|
* @param l1ToL2MessageSource - Provides access to L1 to L2 messages.
|
|
27
39
|
* @param prover - An instance of a block prover
|
|
28
|
-
* @param simulationProvider - An instance of a simulation provider
|
|
29
40
|
* @returns A new running instance.
|
|
30
41
|
*/ static async new(config, deps) {
|
|
31
|
-
const { validatorClient, p2pClient, worldStateSynchronizer, slasherClient,
|
|
32
|
-
const { l1RpcUrls: rpcUrls, l1ChainId: chainId
|
|
33
|
-
const
|
|
34
|
-
const
|
|
35
|
-
const
|
|
36
|
-
const
|
|
37
|
-
const
|
|
38
|
-
|
|
42
|
+
const { validatorClient, p2pClient, worldStateSynchronizer, slasherClient, checkpointsBuilder, l2BlockSource, l1ToL2MessageSource, telemetry: telemetryClient } = deps;
|
|
43
|
+
const { l1RpcUrls: rpcUrls, l1ChainId: chainId } = config;
|
|
44
|
+
const log = createLogger('sequencer');
|
|
45
|
+
const publicClient = getPublicClient(config);
|
|
46
|
+
const l1TxUtils = deps.l1TxUtils;
|
|
47
|
+
const l1Metrics = new L1Metrics(telemetryClient.getMeter('L1PublisherMetrics'), publicClient, l1TxUtils.map((x)=>x.getSenderAddress()));
|
|
48
|
+
const publisherManager = new PublisherManager(l1TxUtils, getPublisherConfigFromSequencerConfig(config), {
|
|
49
|
+
bindings: log.getBindings(),
|
|
50
|
+
funder: deps.funderL1TxUtils
|
|
51
|
+
});
|
|
52
|
+
const rollupContract = new RollupContract(publicClient, config.rollupAddress.toString());
|
|
53
|
+
const [l1GenesisTime, slotDuration, rollupManaLimit] = await Promise.all([
|
|
39
54
|
rollupContract.getL1GenesisTime(),
|
|
40
|
-
rollupContract.getSlotDuration()
|
|
55
|
+
rollupContract.getSlotDuration(),
|
|
56
|
+
rollupContract.getManaLimit().then(Number)
|
|
41
57
|
]);
|
|
42
|
-
const
|
|
43
|
-
const
|
|
44
|
-
const slashingProposerAddress = await rollupContract.getSlashingProposerAddress();
|
|
45
|
-
const slashingProposerContract = new SlashingProposerContract(publicClient, slashingProposerAddress.toString());
|
|
46
|
-
const epochCache = deps.epochCache ?? await EpochCache.create(config.l1Contracts.rollupAddress, {
|
|
58
|
+
const governanceProposerContract = new GovernanceProposerContract(publicClient, config.governanceProposerAddress.toString());
|
|
59
|
+
const epochCache = deps.epochCache ?? await EpochCache.create(config.rollupAddress, {
|
|
47
60
|
l1RpcUrls: rpcUrls,
|
|
48
61
|
l1ChainId: chainId,
|
|
49
62
|
viemPollingIntervalMS: config.viemPollingIntervalMS,
|
|
50
|
-
|
|
51
|
-
ethereumSlotDuration: config.ethereumSlotDuration,
|
|
52
|
-
aztecEpochDuration: config.aztecEpochDuration
|
|
63
|
+
ethereumSlotDuration: config.ethereumSlotDuration
|
|
53
64
|
}, {
|
|
54
65
|
dateProvider: deps.dateProvider
|
|
55
66
|
});
|
|
56
|
-
const
|
|
57
|
-
l1TxUtils,
|
|
67
|
+
const publisherFactory = deps.publisherFactory ?? new SequencerPublisherFactory(config, {
|
|
58
68
|
telemetry: telemetryClient,
|
|
59
|
-
|
|
60
|
-
rollupContract,
|
|
69
|
+
blobClient: deps.blobClient,
|
|
61
70
|
epochCache,
|
|
62
|
-
forwarderContract,
|
|
63
71
|
governanceProposerContract,
|
|
64
|
-
|
|
72
|
+
rollupContract,
|
|
73
|
+
dateProvider: deps.dateProvider,
|
|
74
|
+
publisherManager,
|
|
75
|
+
nodeKeyStore: NodeKeystoreAdapter.fromKeyStoreManager(deps.nodeKeyStore),
|
|
76
|
+
logger: log
|
|
65
77
|
});
|
|
66
|
-
const globalsBuilder = new GlobalVariableBuilder(config);
|
|
67
|
-
const publicProcessorFactory = new PublicProcessorFactory(contractDataSource, deps.dateProvider, telemetryClient);
|
|
68
78
|
const ethereumSlotDuration = config.ethereumSlotDuration;
|
|
69
|
-
|
|
70
|
-
//
|
|
71
|
-
//
|
|
79
|
+
const globalsBuilder = deps.globalVariableBuilder;
|
|
80
|
+
// When running in anvil, assume we can post a tx up until one second before the end of an L1 slot.
|
|
81
|
+
// Otherwise, we need the full L1 slot duration for publishing to ensure inclusion.
|
|
72
82
|
// In theory, the L1 slot has an initial 4s phase where the block is propagated, so we could
|
|
73
|
-
//
|
|
83
|
+
// reduce the publishing time allowance. However, we prefer being conservative.
|
|
74
84
|
// See https://www.blocknative.com/blog/anatomy-of-a-slot#7 for more info.
|
|
75
|
-
const
|
|
85
|
+
const l1PublishingTimeBasedOnChain = isAnvilTestChain(config.l1ChainId) ? 1 : ethereumSlotDuration;
|
|
86
|
+
const l1PublishingTime = config.l1PublishingTime ?? l1PublishingTimeBasedOnChain;
|
|
87
|
+
const { maxL2BlockGas, maxDABlockGas, maxTxsPerBlock } = capPerBlockLimits(config, rollupManaLimit, log);
|
|
76
88
|
const l1Constants = {
|
|
77
89
|
l1GenesisTime,
|
|
78
90
|
slotDuration: Number(slotDuration),
|
|
79
|
-
ethereumSlotDuration
|
|
91
|
+
ethereumSlotDuration,
|
|
92
|
+
rollupManaLimit,
|
|
93
|
+
epochDuration: config.aztecEpochDuration
|
|
80
94
|
};
|
|
81
|
-
const sequencer = new Sequencer(
|
|
95
|
+
const sequencer = new Sequencer(publisherFactory, validatorClient, globalsBuilder, p2pClient, worldStateSynchronizer, slasherClient, l2BlockSource, l1ToL2MessageSource, checkpointsBuilder, l1Constants, deps.dateProvider, epochCache, rollupContract, {
|
|
82
96
|
...config,
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
97
|
+
l1PublishingTime,
|
|
98
|
+
maxL2BlockGas,
|
|
99
|
+
maxDABlockGas,
|
|
100
|
+
maxTxsPerBlock
|
|
101
|
+
}, telemetryClient, log);
|
|
102
|
+
sequencer.init();
|
|
103
|
+
// Extract the shared delayer from the first L1TxUtils instance (all instances share the same delayer)
|
|
104
|
+
const delayer = l1TxUtils[0]?.delayer;
|
|
105
|
+
return new SequencerClient(publisherManager, sequencer, checkpointsBuilder, validatorClient, l1Metrics, delayer);
|
|
88
106
|
}
|
|
89
107
|
/**
|
|
90
|
-
* Updates sequencer config.
|
|
108
|
+
* Updates sequencer and validator client config.
|
|
91
109
|
* @param config - New parameters.
|
|
92
|
-
*/
|
|
93
|
-
|
|
110
|
+
*/ updateConfig(config) {
|
|
111
|
+
this.sequencer.updateConfig(config);
|
|
112
|
+
this.checkpointsBuilder.updateConfig(config);
|
|
113
|
+
this.validatorClient?.updateConfig(config);
|
|
114
|
+
}
|
|
115
|
+
/** Starts the sequencer. */ async start() {
|
|
116
|
+
await this.validatorClient?.start();
|
|
117
|
+
this.sequencer.start();
|
|
118
|
+
this.l1Metrics?.start();
|
|
119
|
+
await this.publisherManager.start();
|
|
94
120
|
}
|
|
95
121
|
/**
|
|
96
122
|
* Stops the sequencer from processing new txs.
|
|
97
123
|
*/ async stop() {
|
|
98
124
|
await this.sequencer.stop();
|
|
125
|
+
await this.validatorClient?.stop();
|
|
126
|
+
await this.publisherManager.stop();
|
|
127
|
+
this.l1Metrics?.stop();
|
|
99
128
|
}
|
|
100
|
-
/**
|
|
101
|
-
this.sequencer.
|
|
129
|
+
/** Triggers an immediate run of the sequencer, bypassing the polling interval. */ trigger() {
|
|
130
|
+
return this.sequencer.trigger();
|
|
102
131
|
}
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
132
|
+
getSequencer() {
|
|
133
|
+
return this.sequencer;
|
|
134
|
+
}
|
|
135
|
+
/** Updates the publisher factory's node keystore adapter after a keystore reload. */ updatePublisherNodeKeyStore(adapter) {
|
|
136
|
+
this.sequencer.updatePublisherNodeKeyStore(adapter);
|
|
107
137
|
}
|
|
108
|
-
|
|
109
|
-
return this.
|
|
138
|
+
/** Returns the shared tx delayer for sequencer L1 txs, if enabled. Test-only. */ getDelayer() {
|
|
139
|
+
return this.delayer_;
|
|
140
|
+
}
|
|
141
|
+
get validatorAddresses() {
|
|
142
|
+
return this.sequencer.getValidatorAddresses();
|
|
143
|
+
}
|
|
144
|
+
get maxL2BlockGas() {
|
|
145
|
+
return this.sequencer.maxL2BlockGas;
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
/**
|
|
149
|
+
* Caps operator-provided per-block limits at checkpoint-level limits.
|
|
150
|
+
* Returns undefined for any limit the operator didn't set — the checkpoint builder handles redistribution.
|
|
151
|
+
*/ function capPerBlockLimits(config, rollupManaLimit, log) {
|
|
152
|
+
let maxL2BlockGas = config.maxL2BlockGas;
|
|
153
|
+
if (maxL2BlockGas !== undefined && maxL2BlockGas > rollupManaLimit) {
|
|
154
|
+
log.warn(`Provided MAX_L2_BLOCK_GAS ${maxL2BlockGas} exceeds rollup mana limit ${rollupManaLimit} (capping)`);
|
|
155
|
+
maxL2BlockGas = rollupManaLimit;
|
|
110
156
|
}
|
|
111
|
-
|
|
112
|
-
|
|
157
|
+
let maxDABlockGas = config.maxDABlockGas;
|
|
158
|
+
if (maxDABlockGas !== undefined && maxDABlockGas > MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT) {
|
|
159
|
+
log.warn(`Provided MAX_DA_BLOCK_GAS ${maxDABlockGas} exceeds DA checkpoint limit ${MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT} (capping)`);
|
|
160
|
+
maxDABlockGas = MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT;
|
|
113
161
|
}
|
|
114
|
-
|
|
115
|
-
|
|
162
|
+
let maxTxsPerBlock = config.maxTxsPerBlock;
|
|
163
|
+
if (maxTxsPerBlock !== undefined && config.maxTxsPerCheckpoint !== undefined && maxTxsPerBlock > config.maxTxsPerCheckpoint) {
|
|
164
|
+
log.warn(`Provided MAX_TX_PER_BLOCK ${maxTxsPerBlock} exceeds MAX_TX_PER_CHECKPOINT ${config.maxTxsPerCheckpoint} (capping)`);
|
|
165
|
+
maxTxsPerBlock = config.maxTxsPerCheckpoint;
|
|
116
166
|
}
|
|
167
|
+
return {
|
|
168
|
+
maxL2BlockGas,
|
|
169
|
+
maxDABlockGas,
|
|
170
|
+
maxTxsPerBlock
|
|
171
|
+
};
|
|
117
172
|
}
|
package/dest/config.d.ts
CHANGED
|
@@ -1,29 +1,50 @@
|
|
|
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
|
|
4
|
-
import { type
|
|
4
|
+
import { type KeyStoreConfig } from '@aztec/node-keystore/config';
|
|
5
|
+
import { type P2PConfig } from '@aztec/p2p/config';
|
|
6
|
+
import { type ChainConfig, type SequencerConfig } from '@aztec/stdlib/config';
|
|
7
|
+
import { type ValidatorClientConfig } from '@aztec/validator-client/config';
|
|
8
|
+
import { type SequencerPublisherConfig, type SequencerTxSenderConfig } from './publisher/config.js';
|
|
5
9
|
export * from './publisher/config.js';
|
|
6
10
|
export type { SequencerConfig };
|
|
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
|
+
skipWaitForValidParentCheckpointOnL1: false;
|
|
29
|
+
broadcastInvalidBlockProposal: false;
|
|
30
|
+
broadcastInvalidCheckpointProposalOnly: false;
|
|
31
|
+
injectFakeAttestation: false;
|
|
32
|
+
injectHighSValueAttestation: false;
|
|
33
|
+
injectUnrecoverableSignatureAttestation: false;
|
|
34
|
+
fishermanMode: false;
|
|
35
|
+
shuffleAttestationOrdering: false;
|
|
36
|
+
skipPushProposedBlocksToArchiver: false;
|
|
37
|
+
skipPublishingCheckpointsPercent: number;
|
|
38
|
+
maxBlocksPerCheckpoint: number;
|
|
39
|
+
};
|
|
7
40
|
/**
|
|
8
41
|
* Configuration settings for the SequencerClient.
|
|
9
42
|
*/
|
|
10
|
-
export type SequencerClientConfig =
|
|
43
|
+
export type SequencerClientConfig = SequencerPublisherConfig & KeyStoreConfig & ValidatorClientConfig & SequencerTxSenderConfig & SequencerConfig & L1ReaderConfig & ChainConfig & Pick<P2PConfig, 'txPublicSetupAllowListExtend'> & Pick<L1ContractsConfig, 'ethereumSlotDuration' | 'aztecSlotDuration' | 'aztecEpochDuration'>;
|
|
11
44
|
export declare const sequencerConfigMappings: ConfigMappingsType<SequencerConfig>;
|
|
12
45
|
export declare const sequencerClientConfigMappings: ConfigMappingsType<SequencerClientConfig>;
|
|
13
46
|
/**
|
|
14
47
|
* Creates an instance of SequencerClientConfig out of environment variables using sensible defaults for integration testing if not set.
|
|
15
48
|
*/
|
|
16
49
|
export declare function getConfigEnvVars(): SequencerClientConfig;
|
|
17
|
-
|
|
18
|
-
* Parses a string to a list of allowed elements.
|
|
19
|
-
* Each encoded is expected to be of one of the following formats
|
|
20
|
-
* `I:${address}`
|
|
21
|
-
* `I:${address}:${selector}`
|
|
22
|
-
* `C:${classId}`
|
|
23
|
-
* `C:${classId}:${selector}`
|
|
24
|
-
*
|
|
25
|
-
* @param value The string to parse
|
|
26
|
-
* @returns A list of allowed elements
|
|
27
|
-
*/
|
|
28
|
-
export declare function parseSequencerAllowList(value: string): AllowedElement[];
|
|
29
|
-
//# sourceMappingURL=config.d.ts.map
|
|
50
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlnLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvY29uZmlnLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxLQUFLLGlCQUFpQixFQUE2QixNQUFNLHdCQUF3QixDQUFDO0FBQzNGLE9BQU8sRUFBRSxLQUFLLGNBQWMsRUFBMEIsTUFBTSwyQkFBMkIsQ0FBQztBQUN4RixPQUFPLEVBQ0wsS0FBSyxrQkFBa0IsRUFNeEIsTUFBTSwwQkFBMEIsQ0FBQztBQUVsQyxPQUFPLEVBQUUsS0FBSyxjQUFjLEVBQTBCLE1BQU0sNkJBQTZCLENBQUM7QUFDMUYsT0FBTyxFQUFFLEtBQUssU0FBUyxFQUFxQixNQUFNLG1CQUFtQixDQUFDO0FBRXRFLE9BQU8sRUFDTCxLQUFLLFdBQVcsRUFFaEIsS0FBSyxlQUFlLEVBR3JCLE1BQU0sc0JBQXNCLENBQUM7QUFHOUIsT0FBTyxFQUFFLEtBQUsscUJBQXFCLEVBQWlDLE1BQU0sZ0NBQWdDLENBQUM7QUFFM0csT0FBTyxFQUNMLEtBQUssd0JBQXdCLEVBQzdCLEtBQUssdUJBQXVCLEVBRzdCLE1BQU0sdUJBQXVCLENBQUM7QUFFL0IsY0FBYyx1QkFBdUIsQ0FBQztBQUN0QyxZQUFZLEVBQUUsZUFBZSxFQUFFLENBQUM7QUFFaEM7OztHQUdHO0FBQ0gsZUFBTyxNQUFNLHNCQUFzQjs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0NBd0JBLENBQUM7QUFFcEM7O0dBRUc7QUFDSCxNQUFNLE1BQU0scUJBQXFCLEdBQUcsd0JBQXdCLEdBQzFELGNBQWMsR0FDZCxxQkFBcUIsR0FDckIsdUJBQXVCLEdBQ3ZCLGVBQWUsR0FDZixjQUFjLEdBQ2QsV0FBVyxHQUNYLElBQUksQ0FBQyxTQUFTLEVBQUUsOEJBQThCLENBQUMsR0FDL0MsSUFBSSxDQUFDLGlCQUFpQixFQUFFLHNCQUFzQixHQUFHLG1CQUFtQixHQUFHLG9CQUFvQixDQUFDLENBQUM7QUFFL0YsZUFBTyxNQUFNLHVCQUF1QixFQUFFLGtCQUFrQixDQUFDLGVBQWUsQ0F3THZFLENBQUM7QUFFRixlQUFPLE1BQU0sNkJBQTZCLEVBQUUsa0JBQWtCLENBQUMscUJBQXFCLENBU25GLENBQUM7QUFFRjs7R0FFRztBQUNILHdCQUFnQixnQkFBZ0IsSUFBSSxxQkFBcUIsQ0FFeEQifQ==
|
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,EAMxB,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,EAEhB,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;;;;;;;;;;;;;;;;;;;;;;;;CAwBA,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,CAwLvE,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,41 +1,90 @@
|
|
|
1
|
-
import { l1ContractsConfigMappings
|
|
2
|
-
import {
|
|
1
|
+
import { l1ContractsConfigMappings } from '@aztec/ethereum/config';
|
|
2
|
+
import { l1ReaderConfigMappings } from '@aztec/ethereum/l1-reader';
|
|
3
|
+
import { booleanConfigHelper, getConfigFromMappings, numberConfigHelper, optionalNumberConfigHelper, pickConfigMappings } from '@aztec/foundation/config';
|
|
3
4
|
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
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 {
|
|
8
|
+
import { DEFAULT_MAX_BLOCKS_PER_CHECKPOINT, 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';
|
|
9
12
|
export * from './publisher/config.js';
|
|
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
|
+
skipWaitForValidParentCheckpointOnL1: false,
|
|
30
|
+
broadcastInvalidBlockProposal: false,
|
|
31
|
+
broadcastInvalidCheckpointProposalOnly: false,
|
|
32
|
+
injectFakeAttestation: false,
|
|
33
|
+
injectHighSValueAttestation: false,
|
|
34
|
+
injectUnrecoverableSignatureAttestation: false,
|
|
35
|
+
fishermanMode: false,
|
|
36
|
+
shuffleAttestationOrdering: false,
|
|
37
|
+
skipPushProposedBlocksToArchiver: false,
|
|
38
|
+
skipPublishingCheckpointsPercent: 0,
|
|
39
|
+
maxBlocksPerCheckpoint: DEFAULT_MAX_BLOCKS_PER_CHECKPOINT
|
|
40
|
+
};
|
|
10
41
|
export const sequencerConfigMappings = {
|
|
11
|
-
|
|
12
|
-
env: '
|
|
13
|
-
description: 'The number of ms to wait between polling for
|
|
14
|
-
...numberConfigHelper(
|
|
42
|
+
sequencerPollingIntervalMS: {
|
|
43
|
+
env: 'SEQ_POLLING_INTERVAL_MS',
|
|
44
|
+
description: 'The number of ms to wait between polling for checking to build on the next slot.',
|
|
45
|
+
...numberConfigHelper(DefaultSequencerConfig.sequencerPollingIntervalMS)
|
|
15
46
|
},
|
|
16
|
-
|
|
17
|
-
env: '
|
|
18
|
-
description: 'The maximum number of txs
|
|
19
|
-
...
|
|
47
|
+
maxTxsPerCheckpoint: {
|
|
48
|
+
env: 'SEQ_MAX_TX_PER_CHECKPOINT',
|
|
49
|
+
description: 'The maximum number of txs across all blocks in a checkpoint.',
|
|
50
|
+
...optionalNumberConfigHelper()
|
|
20
51
|
},
|
|
21
52
|
minTxsPerBlock: {
|
|
22
53
|
env: 'SEQ_MIN_TX_PER_BLOCK',
|
|
23
54
|
description: 'The minimum number of txs to include in a block.',
|
|
24
|
-
...numberConfigHelper(
|
|
55
|
+
...numberConfigHelper(DefaultSequencerConfig.minTxsPerBlock)
|
|
56
|
+
},
|
|
57
|
+
minValidTxsPerBlock: {
|
|
58
|
+
description: 'The minimum number of valid txs (after execution) to include in a block. If not set, falls back to minTxsPerBlock.'
|
|
59
|
+
},
|
|
60
|
+
publishTxsWithProposals: {
|
|
61
|
+
env: 'SEQ_PUBLISH_TXS_WITH_PROPOSALS',
|
|
62
|
+
description: 'Whether to publish txs with proposals.',
|
|
63
|
+
...booleanConfigHelper(DefaultSequencerConfig.publishTxsWithProposals)
|
|
25
64
|
},
|
|
26
65
|
maxL2BlockGas: {
|
|
27
66
|
env: 'SEQ_MAX_L2_BLOCK_GAS',
|
|
28
67
|
description: 'The maximum L2 block gas.',
|
|
29
|
-
...
|
|
68
|
+
...optionalNumberConfigHelper()
|
|
30
69
|
},
|
|
31
70
|
maxDABlockGas: {
|
|
32
71
|
env: 'SEQ_MAX_DA_BLOCK_GAS',
|
|
33
72
|
description: 'The maximum DA block gas.',
|
|
34
|
-
...
|
|
73
|
+
...optionalNumberConfigHelper()
|
|
74
|
+
},
|
|
75
|
+
perBlockAllocationMultiplier: {
|
|
76
|
+
env: 'SEQ_PER_BLOCK_ALLOCATION_MULTIPLIER',
|
|
77
|
+
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.',
|
|
78
|
+
...numberConfigHelper(DefaultSequencerConfig.perBlockAllocationMultiplier)
|
|
79
|
+
},
|
|
80
|
+
redistributeCheckpointBudget: {
|
|
81
|
+
env: 'SEQ_REDISTRIBUTE_CHECKPOINT_BUDGET',
|
|
82
|
+
description: 'Redistribute remaining checkpoint budget evenly across remaining blocks instead of allowing a single block to consume the entire remaining budget.',
|
|
83
|
+
...booleanConfigHelper(DefaultSequencerConfig.redistributeCheckpointBudget)
|
|
35
84
|
},
|
|
36
85
|
coinbase: {
|
|
37
86
|
env: 'COINBASE',
|
|
38
|
-
parseEnv: (val)=>
|
|
87
|
+
parseEnv: (val)=>EthAddress.fromString(val),
|
|
39
88
|
description: 'Recipient of block reward.'
|
|
40
89
|
},
|
|
41
90
|
feeRecipient: {
|
|
@@ -51,41 +100,123 @@ export const sequencerConfigMappings = {
|
|
|
51
100
|
env: 'ACVM_BINARY_PATH',
|
|
52
101
|
description: 'The path to the ACVM binary'
|
|
53
102
|
},
|
|
54
|
-
allowedInSetup: {
|
|
55
|
-
env: 'SEQ_ALLOWED_SETUP_FN',
|
|
56
|
-
parseEnv: (val)=>parseSequencerAllowList(val),
|
|
57
|
-
description: 'The list of functions calls allowed to run in setup',
|
|
58
|
-
printDefault: ()=>'AuthRegistry, FeeJuice.increase_public_balance, Token.increase_public_balance, FPC.prepare_fee'
|
|
59
|
-
},
|
|
60
|
-
maxBlockSizeInBytes: {
|
|
61
|
-
env: 'SEQ_MAX_BLOCK_SIZE_IN_BYTES',
|
|
62
|
-
description: 'Max block size',
|
|
63
|
-
...numberConfigHelper(1024 * 1024)
|
|
64
|
-
},
|
|
65
103
|
enforceTimeTable: {
|
|
66
104
|
env: 'SEQ_ENFORCE_TIME_TABLE',
|
|
67
105
|
description: 'Whether to enforce the time table when building blocks',
|
|
68
|
-
...booleanConfigHelper()
|
|
69
|
-
defaultValue: false
|
|
106
|
+
...booleanConfigHelper(DefaultSequencerConfig.enforceTimeTable)
|
|
70
107
|
},
|
|
71
108
|
governanceProposerPayload: {
|
|
72
109
|
env: 'GOVERNANCE_PROPOSER_PAYLOAD_ADDRESS',
|
|
73
110
|
description: 'The address of the payload for the governanceProposer',
|
|
74
|
-
parseEnv: (val)=>EthAddress.fromString(val)
|
|
75
|
-
|
|
111
|
+
parseEnv: (val)=>EthAddress.fromString(val)
|
|
112
|
+
},
|
|
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).',
|
|
116
|
+
...optionalNumberConfigHelper()
|
|
117
|
+
},
|
|
118
|
+
fakeProcessingDelayPerTxMs: {
|
|
119
|
+
description: 'Used for testing to introduce a fake delay after processing each tx'
|
|
120
|
+
},
|
|
121
|
+
fakeThrowAfterProcessingTxCount: {
|
|
122
|
+
description: 'Used for testing to throw an error after processing N txs'
|
|
123
|
+
},
|
|
124
|
+
secondsBeforeInvalidatingBlockAsCommitteeMember: {
|
|
125
|
+
env: 'SEQ_SECONDS_BEFORE_INVALIDATING_BLOCK_AS_COMMITTEE_MEMBER',
|
|
126
|
+
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.',
|
|
127
|
+
...numberConfigHelper(DefaultSequencerConfig.secondsBeforeInvalidatingBlockAsCommitteeMember)
|
|
128
|
+
},
|
|
129
|
+
secondsBeforeInvalidatingBlockAsNonCommitteeMember: {
|
|
130
|
+
env: 'SEQ_SECONDS_BEFORE_INVALIDATING_BLOCK_AS_NON_COMMITTEE_MEMBER',
|
|
131
|
+
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.',
|
|
132
|
+
...numberConfigHelper(DefaultSequencerConfig.secondsBeforeInvalidatingBlockAsNonCommitteeMember)
|
|
133
|
+
},
|
|
134
|
+
skipCollectingAttestations: {
|
|
135
|
+
description: 'Whether to skip collecting attestations from validators and only use self-attestations (for testing only)',
|
|
136
|
+
...booleanConfigHelper(DefaultSequencerConfig.skipCollectingAttestations)
|
|
137
|
+
},
|
|
138
|
+
skipInvalidateBlockAsProposer: {
|
|
139
|
+
description: 'Do not invalidate the previous block if invalid when we are the proposer (for testing only)',
|
|
140
|
+
...booleanConfigHelper(DefaultSequencerConfig.skipInvalidateBlockAsProposer)
|
|
141
|
+
},
|
|
142
|
+
skipWaitForValidParentCheckpointOnL1: {
|
|
143
|
+
description: 'Bypass the parent checkpoint validity check before submitting a pipelined checkpoint, ' + 'allowing the proposer to publish even when the parent landed on L1 with invalid attestations (for testing only)',
|
|
144
|
+
...booleanConfigHelper(DefaultSequencerConfig.skipWaitForValidParentCheckpointOnL1)
|
|
145
|
+
},
|
|
146
|
+
broadcastInvalidBlockProposal: {
|
|
147
|
+
description: 'Broadcast invalid block proposals with corrupted state (for testing only)',
|
|
148
|
+
...booleanConfigHelper(DefaultSequencerConfig.broadcastInvalidBlockProposal)
|
|
76
149
|
},
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
150
|
+
invalidBlockProposalIndexWithinCheckpoint: {
|
|
151
|
+
description: 'Broadcast an invalid block proposal only at this indexWithinCheckpoint (for testing only)',
|
|
152
|
+
...optionalNumberConfigHelper()
|
|
153
|
+
},
|
|
154
|
+
broadcastInvalidCheckpointProposalOnly: {
|
|
155
|
+
description: 'Broadcast invalid checkpoint proposals while keeping the underlying block proposals valid (for testing only). When unset, the checkpoint follows broadcastInvalidBlockProposal.',
|
|
156
|
+
...booleanConfigHelper(DefaultSequencerConfig.broadcastInvalidCheckpointProposalOnly)
|
|
157
|
+
},
|
|
158
|
+
injectFakeAttestation: {
|
|
159
|
+
description: 'Inject a fake attestation (for testing only)',
|
|
160
|
+
...booleanConfigHelper(DefaultSequencerConfig.injectFakeAttestation)
|
|
161
|
+
},
|
|
162
|
+
injectHighSValueAttestation: {
|
|
163
|
+
description: 'Inject a malleable attestation with a high-s value (for testing only)',
|
|
164
|
+
...booleanConfigHelper(DefaultSequencerConfig.injectHighSValueAttestation)
|
|
165
|
+
},
|
|
166
|
+
injectUnrecoverableSignatureAttestation: {
|
|
167
|
+
description: 'Inject an attestation with an unrecoverable signature (for testing only)',
|
|
168
|
+
...booleanConfigHelper(DefaultSequencerConfig.injectUnrecoverableSignatureAttestation)
|
|
169
|
+
},
|
|
170
|
+
fishermanMode: {
|
|
171
|
+
env: 'FISHERMAN_MODE',
|
|
172
|
+
description: 'Whether to run in fisherman mode: builds blocks on every slot for validation without publishing to L1',
|
|
173
|
+
...booleanConfigHelper(DefaultSequencerConfig.fishermanMode)
|
|
174
|
+
},
|
|
175
|
+
shuffleAttestationOrdering: {
|
|
176
|
+
description: 'Shuffle attestation ordering to create invalid ordering (for testing only)',
|
|
177
|
+
...booleanConfigHelper(DefaultSequencerConfig.shuffleAttestationOrdering)
|
|
178
|
+
},
|
|
179
|
+
...sharedSequencerConfigMappings,
|
|
180
|
+
buildCheckpointIfEmpty: {
|
|
181
|
+
env: 'SEQ_BUILD_CHECKPOINT_IF_EMPTY',
|
|
182
|
+
description: 'Have sequencer build and publish an empty checkpoint if there are no txs',
|
|
183
|
+
...booleanConfigHelper(DefaultSequencerConfig.buildCheckpointIfEmpty)
|
|
184
|
+
},
|
|
185
|
+
skipPushProposedBlocksToArchiver: {
|
|
186
|
+
description: 'Skip pushing proposed blocks to archiver (default: true)',
|
|
187
|
+
...booleanConfigHelper(DefaultSequencerConfig.skipPushProposedBlocksToArchiver)
|
|
188
|
+
},
|
|
189
|
+
minBlocksForCheckpoint: {
|
|
190
|
+
description: 'Minimum number of blocks required for a checkpoint proposal (test only)'
|
|
191
|
+
},
|
|
192
|
+
skipPublishingCheckpointsPercent: {
|
|
193
|
+
env: 'SEQ_SKIP_CHECKPOINT_PUBLISH_PERCENT',
|
|
194
|
+
description: 'Percent probability (0 - 100) of sequencer skipping checkpoint publishing (testing only)',
|
|
195
|
+
...numberConfigHelper(DefaultSequencerConfig.skipPublishingCheckpointsPercent)
|
|
196
|
+
},
|
|
197
|
+
skipBroadcastProposals: {
|
|
198
|
+
description: 'Skip broadcasting checkpoint and block proposals via gossipsub when proposer (for testing only)',
|
|
199
|
+
...booleanConfigHelper(false)
|
|
200
|
+
},
|
|
201
|
+
skipBroadcastCheckpointProposal: {
|
|
202
|
+
description: 'Skip broadcasting only the CheckpointProposal via gossipsub when proposer; the held last block is broadcast ' + 'standalone instead so peers still receive it as a proposed-but-uncheckpointed tip (for testing only)',
|
|
203
|
+
...booleanConfigHelper(false)
|
|
204
|
+
},
|
|
205
|
+
pauseProposingForSlots: {
|
|
206
|
+
description: 'List of slots for which the sequencer will not produce a proposal (for testing only). Attestation paths are unaffected.'
|
|
207
|
+
},
|
|
208
|
+
...pickConfigMappings(p2pConfigMappings, [
|
|
209
|
+
'txPublicSetupAllowListExtend'
|
|
210
|
+
])
|
|
82
211
|
};
|
|
83
212
|
export const sequencerClientConfigMappings = {
|
|
213
|
+
...chainConfigMappings,
|
|
214
|
+
...validatorClientConfigMappings,
|
|
84
215
|
...sequencerConfigMappings,
|
|
216
|
+
...keyStoreConfigMappings,
|
|
85
217
|
...l1ReaderConfigMappings,
|
|
86
|
-
...
|
|
87
|
-
...
|
|
88
|
-
...chainConfigMappings,
|
|
218
|
+
...sequencerTxSenderConfigMappings,
|
|
219
|
+
...sequencerPublisherConfigMappings,
|
|
89
220
|
...pickConfigMappings(l1ContractsConfigMappings, [
|
|
90
221
|
'ethereumSlotDuration',
|
|
91
222
|
'aztecSlotDuration',
|
|
@@ -97,47 +228,3 @@ export const sequencerClientConfigMappings = {
|
|
|
97
228
|
*/ export function getConfigEnvVars() {
|
|
98
229
|
return getConfigFromMappings(sequencerClientConfigMappings);
|
|
99
230
|
}
|
|
100
|
-
/**
|
|
101
|
-
* Parses a string to a list of allowed elements.
|
|
102
|
-
* Each encoded is expected to be of one of the following formats
|
|
103
|
-
* `I:${address}`
|
|
104
|
-
* `I:${address}:${selector}`
|
|
105
|
-
* `C:${classId}`
|
|
106
|
-
* `C:${classId}:${selector}`
|
|
107
|
-
*
|
|
108
|
-
* @param value The string to parse
|
|
109
|
-
* @returns A list of allowed elements
|
|
110
|
-
*/ export function parseSequencerAllowList(value) {
|
|
111
|
-
const entries = [];
|
|
112
|
-
if (!value) {
|
|
113
|
-
return entries;
|
|
114
|
-
}
|
|
115
|
-
for (const val of value.split(',')){
|
|
116
|
-
const [typeString, identifierString, selectorString] = val.split(':');
|
|
117
|
-
const selector = selectorString !== undefined ? FunctionSelector.fromString(selectorString) : undefined;
|
|
118
|
-
if (typeString === 'I') {
|
|
119
|
-
if (selector) {
|
|
120
|
-
entries.push({
|
|
121
|
-
address: AztecAddress.fromString(identifierString),
|
|
122
|
-
selector
|
|
123
|
-
});
|
|
124
|
-
} else {
|
|
125
|
-
entries.push({
|
|
126
|
-
address: AztecAddress.fromString(identifierString)
|
|
127
|
-
});
|
|
128
|
-
}
|
|
129
|
-
} else if (typeString === 'C') {
|
|
130
|
-
if (selector) {
|
|
131
|
-
entries.push({
|
|
132
|
-
classId: Fr.fromHexString(identifierString),
|
|
133
|
-
selector
|
|
134
|
-
});
|
|
135
|
-
} else {
|
|
136
|
-
entries.push({
|
|
137
|
-
classId: Fr.fromHexString(identifierString)
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
}
|
|
141
|
-
}
|
|
142
|
-
return entries;
|
|
143
|
-
}
|