@aztec/sequencer-client 0.0.1-commit.f2ce05ee → 0.0.1-commit.f5a9928
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 +283 -21
- package/dest/client/sequencer-client.d.ts +34 -11
- package/dest/client/sequencer-client.d.ts.map +1 -1
- package/dest/client/sequencer-client.js +77 -39
- package/dest/config.d.ts +34 -5
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +103 -39
- 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 +138 -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 +80 -0
- package/dest/global_variable_builder/global_builder.d.ts +13 -28
- package/dest/global_variable_builder/global_builder.d.ts.map +1 -1
- package/dest/global_variable_builder/global_builder.js +9 -66
- 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/publisher/config.d.ts +51 -17
- package/dest/publisher/config.d.ts.map +1 -1
- package/dest/publisher/config.js +131 -42
- package/dest/publisher/index.d.ts +2 -1
- package/dest/publisher/index.d.ts.map +1 -1
- package/dest/publisher/l1_to_l2_messaging.d.ts +21 -0
- package/dest/publisher/l1_to_l2_messaging.d.ts.map +1 -0
- package/dest/publisher/l1_to_l2_messaging.js +70 -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 +11 -5
- package/dest/publisher/sequencer-publisher-factory.d.ts.map +1 -1
- package/dest/publisher/sequencer-publisher-factory.js +27 -3
- package/dest/publisher/sequencer-publisher.d.ts +112 -71
- package/dest/publisher/sequencer-publisher.d.ts.map +1 -1
- package/dest/publisher/sequencer-publisher.js +571 -392
- package/dest/publisher/write_json.d.ts +11 -0
- package/dest/publisher/write_json.d.ts.map +1 -0
- package/dest/publisher/write_json.js +57 -0
- package/dest/sequencer/automine/automine_factory.d.ts +56 -0
- package/dest/sequencer/automine/automine_factory.d.ts.map +1 -0
- package/dest/sequencer/automine/automine_factory.js +85 -0
- package/dest/sequencer/automine/automine_sequencer.d.ts +189 -0
- package/dest/sequencer/automine/automine_sequencer.d.ts.map +1 -0
- package/dest/sequencer/automine/automine_sequencer.js +696 -0
- package/dest/sequencer/automine/index.d.ts +3 -0
- package/dest/sequencer/automine/index.d.ts.map +1 -0
- package/dest/sequencer/automine/index.js +2 -0
- package/dest/sequencer/checkpoint_proposal_job.d.ts +75 -19
- package/dest/sequencer/checkpoint_proposal_job.d.ts.map +1 -1
- package/dest/sequencer/checkpoint_proposal_job.js +886 -264
- 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 +1 -2
- package/dest/sequencer/checkpoint_voter.d.ts.map +1 -1
- package/dest/sequencer/checkpoint_voter.js +2 -5
- package/dest/sequencer/errors.d.ts +1 -8
- package/dest/sequencer/errors.d.ts.map +1 -1
- package/dest/sequencer/errors.js +0 -9
- package/dest/sequencer/events.d.ts +62 -5
- package/dest/sequencer/events.d.ts.map +1 -1
- package/dest/sequencer/metrics.d.ts +23 -8
- package/dest/sequencer/metrics.d.ts.map +1 -1
- package/dest/sequencer/metrics.js +117 -21
- package/dest/sequencer/requests_tracker.d.ts +22 -0
- package/dest/sequencer/requests_tracker.d.ts.map +1 -0
- package/dest/sequencer/requests_tracker.js +33 -0
- package/dest/sequencer/sequencer.d.ts +181 -44
- package/dest/sequencer/sequencer.d.ts.map +1 -1
- package/dest/sequencer/sequencer.js +635 -218
- package/dest/sequencer/types.d.ts +2 -2
- package/dest/sequencer/types.d.ts.map +1 -1
- package/dest/test/index.d.ts +5 -7
- package/dest/test/index.d.ts.map +1 -1
- package/dest/test/mock_checkpoint_builder.d.ts +11 -11
- package/dest/test/mock_checkpoint_builder.d.ts.map +1 -1
- package/dest/test/mock_checkpoint_builder.js +45 -34
- package/dest/test/utils.d.ts +17 -3
- package/dest/test/utils.d.ts.map +1 -1
- package/dest/test/utils.js +28 -9
- package/package.json +28 -28
- package/src/client/sequencer-client.ts +110 -47
- package/src/config.ts +126 -44
- package/src/global_variable_builder/README.md +44 -0
- package/src/global_variable_builder/fee_predictor.ts +182 -0
- package/src/global_variable_builder/fee_provider.ts +97 -0
- package/src/global_variable_builder/global_builder.ts +20 -89
- package/src/global_variable_builder/index.ts +3 -1
- package/src/publisher/config.ts +173 -40
- package/src/publisher/index.ts +3 -0
- package/src/publisher/l1_to_l2_messaging.ts +85 -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 +38 -9
- package/src/publisher/sequencer-publisher.ts +667 -484
- package/src/publisher/write_json.ts +78 -0
- package/src/sequencer/automine/README.md +60 -0
- package/src/sequencer/automine/automine_factory.ts +152 -0
- package/src/sequencer/automine/automine_sequencer.ts +800 -0
- package/src/sequencer/automine/index.ts +6 -0
- package/src/sequencer/checkpoint_proposal_job.ts +1073 -290
- package/src/sequencer/checkpoint_proposal_job_metrics.ts +128 -0
- package/src/sequencer/checkpoint_voter.ts +1 -12
- package/src/sequencer/errors.ts +0 -15
- package/src/sequencer/events.ts +66 -5
- package/src/sequencer/metrics.ts +138 -26
- package/src/sequencer/requests_tracker.ts +43 -0
- package/src/sequencer/sequencer.ts +745 -243
- package/src/sequencer/types.ts +1 -1
- package/src/test/index.ts +4 -6
- package/src/test/mock_checkpoint_builder.ts +63 -49
- package/src/test/utils.ts +64 -10
- package/dest/sequencer/timetable.d.ts +0 -87
- package/dest/sequencer/timetable.d.ts.map +0 -1
- package/dest/sequencer/timetable.js +0 -223
- package/src/sequencer/README.md +0 -531
- package/src/sequencer/timetable.ts +0 -283
|
@@ -1,14 +1,12 @@
|
|
|
1
|
+
import { MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT } from '@aztec/constants';
|
|
1
2
|
import { EpochCache } from '@aztec/epoch-cache';
|
|
2
|
-
import { isAnvilTestChain } from '@aztec/ethereum/chain';
|
|
3
3
|
import { getPublicClient } from '@aztec/ethereum/client';
|
|
4
4
|
import { GovernanceProposerContract, RollupContract } from '@aztec/ethereum/contracts';
|
|
5
5
|
import { PublisherManager } from '@aztec/ethereum/publisher-manager';
|
|
6
|
-
import { EthAddress } from '@aztec/foundation/eth-address';
|
|
7
6
|
import { createLogger } from '@aztec/foundation/log';
|
|
8
|
-
import { SlashFactoryContract } from '@aztec/stdlib/l1-contracts';
|
|
9
7
|
import { L1Metrics } from '@aztec/telemetry-client';
|
|
10
8
|
import { NodeKeystoreAdapter } from '@aztec/validator-client';
|
|
11
|
-
import {
|
|
9
|
+
import { getPublisherConfigFromSequencerConfig } from '../config.js';
|
|
12
10
|
import { SequencerPublisherFactory } from '../publisher/sequencer-publisher-factory.js';
|
|
13
11
|
import { Sequencer } from '../sequencer/index.js';
|
|
14
12
|
/**
|
|
@@ -19,12 +17,14 @@ import { Sequencer } from '../sequencer/index.js';
|
|
|
19
17
|
checkpointsBuilder;
|
|
20
18
|
validatorClient;
|
|
21
19
|
l1Metrics;
|
|
22
|
-
|
|
20
|
+
delayer_;
|
|
21
|
+
constructor(publisherManager, sequencer, checkpointsBuilder, validatorClient, l1Metrics, delayer_){
|
|
23
22
|
this.publisherManager = publisherManager;
|
|
24
23
|
this.sequencer = sequencer;
|
|
25
24
|
this.checkpointsBuilder = checkpointsBuilder;
|
|
26
25
|
this.validatorClient = validatorClient;
|
|
27
26
|
this.l1Metrics = l1Metrics;
|
|
27
|
+
this.delayer_ = delayer_;
|
|
28
28
|
}
|
|
29
29
|
/**
|
|
30
30
|
* Initializes a new instance.
|
|
@@ -44,16 +44,18 @@ import { Sequencer } from '../sequencer/index.js';
|
|
|
44
44
|
const publicClient = getPublicClient(config);
|
|
45
45
|
const l1TxUtils = deps.l1TxUtils;
|
|
46
46
|
const l1Metrics = new L1Metrics(telemetryClient.getMeter('L1PublisherMetrics'), publicClient, l1TxUtils.map((x)=>x.getSenderAddress()));
|
|
47
|
-
const publisherManager = new PublisherManager(l1TxUtils, config,
|
|
48
|
-
|
|
49
|
-
|
|
47
|
+
const publisherManager = new PublisherManager(l1TxUtils, getPublisherConfigFromSequencerConfig(config), {
|
|
48
|
+
bindings: log.getBindings(),
|
|
49
|
+
funder: deps.funderL1TxUtils
|
|
50
|
+
});
|
|
51
|
+
const rollupContract = new RollupContract(publicClient, config.rollupAddress.toString());
|
|
52
|
+
const [l1GenesisTime, slotDuration, rollupManaLimit] = await Promise.all([
|
|
50
53
|
rollupContract.getL1GenesisTime(),
|
|
51
54
|
rollupContract.getSlotDuration(),
|
|
52
|
-
rollupContract.getVersion(),
|
|
53
55
|
rollupContract.getManaLimit().then(Number)
|
|
54
56
|
]);
|
|
55
|
-
const governanceProposerContract = new GovernanceProposerContract(publicClient, config.
|
|
56
|
-
const epochCache = deps.epochCache ?? await EpochCache.create(config.
|
|
57
|
+
const governanceProposerContract = new GovernanceProposerContract(publicClient, config.governanceProposerAddress.toString());
|
|
58
|
+
const epochCache = deps.epochCache ?? await EpochCache.create(config.rollupAddress, {
|
|
57
59
|
l1RpcUrls: rpcUrls,
|
|
58
60
|
l1ChainId: chainId,
|
|
59
61
|
viemPollingIntervalMS: config.viemPollingIntervalMS,
|
|
@@ -61,13 +63,11 @@ import { Sequencer } from '../sequencer/index.js';
|
|
|
61
63
|
}, {
|
|
62
64
|
dateProvider: deps.dateProvider
|
|
63
65
|
});
|
|
64
|
-
const slashFactoryContract = new SlashFactoryContract(publicClient, config.l1Contracts.slashFactoryAddress?.toString() ?? EthAddress.ZERO.toString());
|
|
65
66
|
const publisherFactory = deps.publisherFactory ?? new SequencerPublisherFactory(config, {
|
|
66
67
|
telemetry: telemetryClient,
|
|
67
68
|
blobClient: deps.blobClient,
|
|
68
69
|
epochCache,
|
|
69
70
|
governanceProposerContract,
|
|
70
|
-
slashFactoryContract,
|
|
71
71
|
rollupContract,
|
|
72
72
|
dateProvider: deps.dateProvider,
|
|
73
73
|
publisherManager,
|
|
@@ -75,35 +75,25 @@ import { Sequencer } from '../sequencer/index.js';
|
|
|
75
75
|
logger: log
|
|
76
76
|
});
|
|
77
77
|
const ethereumSlotDuration = config.ethereumSlotDuration;
|
|
78
|
+
const globalsBuilder = deps.globalVariableBuilder;
|
|
79
|
+
const { maxL2BlockGas, maxDABlockGas, maxTxsPerBlock } = capPerBlockLimits(config, rollupManaLimit, log);
|
|
78
80
|
const l1Constants = {
|
|
79
81
|
l1GenesisTime,
|
|
80
82
|
slotDuration: Number(slotDuration),
|
|
81
|
-
ethereumSlotDuration
|
|
83
|
+
ethereumSlotDuration,
|
|
84
|
+
rollupManaLimit,
|
|
85
|
+
epochDuration: config.aztecEpochDuration
|
|
82
86
|
};
|
|
83
|
-
const globalsBuilder = new GlobalVariableBuilder({
|
|
84
|
-
...config,
|
|
85
|
-
...l1Constants,
|
|
86
|
-
rollupVersion
|
|
87
|
-
});
|
|
88
|
-
let sequencerManaLimit = config.maxL2BlockGas ?? rollupManaLimit;
|
|
89
|
-
if (sequencerManaLimit > rollupManaLimit) {
|
|
90
|
-
log.warn(`Provided maxL2BlockGas ${sequencerManaLimit} is greater than the max allowed by L1. Setting limit to ${rollupManaLimit}.`);
|
|
91
|
-
sequencerManaLimit = rollupManaLimit;
|
|
92
|
-
}
|
|
93
|
-
// When running in anvil, assume we can post a tx up until one second before the end of an L1 slot.
|
|
94
|
-
// Otherwise, we need the full L1 slot duration for publishing to ensure inclusion.
|
|
95
|
-
// In theory, the L1 slot has an initial 4s phase where the block is propagated, so we could
|
|
96
|
-
// reduce the publishing time allowance. However, we prefer being conservative.
|
|
97
|
-
// See https://www.blocknative.com/blog/anatomy-of-a-slot#7 for more info.
|
|
98
|
-
const l1PublishingTimeBasedOnChain = isAnvilTestChain(config.l1ChainId) ? 1 : ethereumSlotDuration;
|
|
99
|
-
const l1PublishingTime = config.l1PublishingTime ?? l1PublishingTimeBasedOnChain;
|
|
100
87
|
const sequencer = new Sequencer(publisherFactory, validatorClient, globalsBuilder, p2pClient, worldStateSynchronizer, slasherClient, l2BlockSource, l1ToL2MessageSource, checkpointsBuilder, l1Constants, deps.dateProvider, epochCache, rollupContract, {
|
|
101
88
|
...config,
|
|
102
|
-
|
|
103
|
-
|
|
89
|
+
maxL2BlockGas,
|
|
90
|
+
maxDABlockGas,
|
|
91
|
+
maxTxsPerBlock
|
|
104
92
|
}, telemetryClient, log);
|
|
105
|
-
|
|
106
|
-
|
|
93
|
+
sequencer.init();
|
|
94
|
+
// Extract the shared delayer from the first L1TxUtils instance (all instances share the same delayer)
|
|
95
|
+
const delayer = l1TxUtils[0]?.delayer;
|
|
96
|
+
return new SequencerClient(publisherManager, sequencer, checkpointsBuilder, validatorClient, l1Metrics, delayer);
|
|
107
97
|
}
|
|
108
98
|
/**
|
|
109
99
|
* Updates sequencer and validator client config.
|
|
@@ -113,23 +103,46 @@ import { Sequencer } from '../sequencer/index.js';
|
|
|
113
103
|
this.checkpointsBuilder.updateConfig(config);
|
|
114
104
|
this.validatorClient?.updateConfig(config);
|
|
115
105
|
}
|
|
116
|
-
/**
|
|
106
|
+
/**
|
|
107
|
+
* Starts (or resumes) the sequencer, validator, publishers, and metrics. Each underlying start is
|
|
108
|
+
* idempotent, so this is safe to call after a previous {@link pause} to resume building and publishing.
|
|
109
|
+
* The publisher manager is started before the sequencer's poll loop so publishing is ready before the
|
|
110
|
+
* sequencer first tries to publish to L1.
|
|
111
|
+
*/ async start() {
|
|
117
112
|
await this.validatorClient?.start();
|
|
113
|
+
await this.publisherManager.start();
|
|
118
114
|
this.sequencer.start();
|
|
119
115
|
this.l1Metrics?.start();
|
|
120
|
-
await this.publisherManager.loadState();
|
|
121
116
|
}
|
|
122
117
|
/**
|
|
123
|
-
* Stops the sequencer
|
|
118
|
+
* Stops the sequencer, validator, publishers, and metrics for good, draining in-flight work. This is the
|
|
119
|
+
* final teardown path: stopping the validator client closes its slashing-protection database. For a
|
|
120
|
+
* restartable pause (e.g. around a test clock warp) use {@link pause} instead.
|
|
124
121
|
*/ async stop() {
|
|
125
122
|
await this.sequencer.stop();
|
|
126
123
|
await this.validatorClient?.stop();
|
|
127
|
-
this.publisherManager.
|
|
124
|
+
await this.publisherManager.stop();
|
|
128
125
|
this.l1Metrics?.stop();
|
|
129
126
|
}
|
|
127
|
+
/**
|
|
128
|
+
* Gracefully pauses block production, waiting for in-flight work to finish rather than interrupting it,
|
|
129
|
+
* while leaving the validator, publishers, and metrics running so the sequencer can be resumed with
|
|
130
|
+
* {@link start}. Used by tests that pause sequencers around an L1 clock warp.
|
|
131
|
+
*/ async pause() {
|
|
132
|
+
await this.sequencer.pause();
|
|
133
|
+
}
|
|
134
|
+
/** Triggers an immediate run of the sequencer, bypassing the polling interval. */ trigger() {
|
|
135
|
+
return this.sequencer.trigger();
|
|
136
|
+
}
|
|
130
137
|
getSequencer() {
|
|
131
138
|
return this.sequencer;
|
|
132
139
|
}
|
|
140
|
+
/** Updates the publisher factory's node keystore adapter after a keystore reload. */ updatePublisherNodeKeyStore(adapter) {
|
|
141
|
+
this.sequencer.updatePublisherNodeKeyStore(adapter);
|
|
142
|
+
}
|
|
143
|
+
/** Returns the shared tx delayer for sequencer L1 txs, if enabled. Test-only. */ getDelayer() {
|
|
144
|
+
return this.delayer_;
|
|
145
|
+
}
|
|
133
146
|
get validatorAddresses() {
|
|
134
147
|
return this.sequencer.getValidatorAddresses();
|
|
135
148
|
}
|
|
@@ -137,3 +150,28 @@ import { Sequencer } from '../sequencer/index.js';
|
|
|
137
150
|
return this.sequencer.maxL2BlockGas;
|
|
138
151
|
}
|
|
139
152
|
}
|
|
153
|
+
/**
|
|
154
|
+
* Caps operator-provided per-block limits at checkpoint-level limits.
|
|
155
|
+
* Returns undefined for any limit the operator didn't set — the checkpoint builder handles redistribution.
|
|
156
|
+
*/ function capPerBlockLimits(config, rollupManaLimit, log) {
|
|
157
|
+
let maxL2BlockGas = config.maxL2BlockGas;
|
|
158
|
+
if (maxL2BlockGas !== undefined && maxL2BlockGas > rollupManaLimit) {
|
|
159
|
+
log.warn(`Provided MAX_L2_BLOCK_GAS ${maxL2BlockGas} exceeds rollup mana limit ${rollupManaLimit} (capping)`);
|
|
160
|
+
maxL2BlockGas = rollupManaLimit;
|
|
161
|
+
}
|
|
162
|
+
let maxDABlockGas = config.maxDABlockGas;
|
|
163
|
+
if (maxDABlockGas !== undefined && maxDABlockGas > MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT) {
|
|
164
|
+
log.warn(`Provided MAX_DA_BLOCK_GAS ${maxDABlockGas} exceeds DA checkpoint limit ${MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT} (capping)`);
|
|
165
|
+
maxDABlockGas = MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT;
|
|
166
|
+
}
|
|
167
|
+
let maxTxsPerBlock = config.maxTxsPerBlock;
|
|
168
|
+
if (maxTxsPerBlock !== undefined && config.maxTxsPerCheckpoint !== undefined && maxTxsPerBlock > config.maxTxsPerCheckpoint) {
|
|
169
|
+
log.warn(`Provided MAX_TX_PER_BLOCK ${maxTxsPerBlock} exceeds MAX_TX_PER_CHECKPOINT ${config.maxTxsPerCheckpoint} (capping)`);
|
|
170
|
+
maxTxsPerBlock = config.maxTxsPerCheckpoint;
|
|
171
|
+
}
|
|
172
|
+
return {
|
|
173
|
+
maxL2BlockGas,
|
|
174
|
+
maxDABlockGas,
|
|
175
|
+
maxTxsPerBlock
|
|
176
|
+
};
|
|
177
|
+
}
|
package/dest/config.d.ts
CHANGED
|
@@ -4,24 +4,53 @@ import { type ConfigMappingsType } from '@aztec/foundation/config';
|
|
|
4
4
|
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
|
-
import type { ResolvedSequencerConfig } from '@aztec/stdlib/interfaces/server';
|
|
8
7
|
import { type ValidatorClientConfig } from '@aztec/validator-client/config';
|
|
9
|
-
import { type
|
|
8
|
+
import { type SequencerPublisherConfig, type SequencerTxSenderConfig } from './publisher/config.js';
|
|
10
9
|
export * from './publisher/config.js';
|
|
11
10
|
export type { SequencerConfig };
|
|
12
11
|
/**
|
|
13
12
|
* Default values for SequencerConfig.
|
|
14
13
|
* Centralized location for all sequencer configuration defaults.
|
|
15
14
|
*/
|
|
16
|
-
export declare const DefaultSequencerConfig:
|
|
15
|
+
export declare const DefaultSequencerConfig: {
|
|
16
|
+
sequencerPollingIntervalMS: number;
|
|
17
|
+
minTxsPerBlock: number;
|
|
18
|
+
buildCheckpointIfEmpty: false;
|
|
19
|
+
publishTxsWithProposals: false;
|
|
20
|
+
perBlockAllocationMultiplier: number;
|
|
21
|
+
perBlockDAAllocationMultiplier: number;
|
|
22
|
+
redistributeCheckpointBudget: true;
|
|
23
|
+
blockDurationMs: number;
|
|
24
|
+
l1PublishingTime: number;
|
|
25
|
+
checkpointProposalSyncGraceSeconds: number;
|
|
26
|
+
attestationPropagationTime: number;
|
|
27
|
+
secondsBeforeInvalidatingBlockAsCommitteeMember: number;
|
|
28
|
+
secondsBeforeInvalidatingBlockAsNonCommitteeMember: number;
|
|
29
|
+
skipCollectingAttestations: false;
|
|
30
|
+
skipInvalidateBlockAsProposer: false;
|
|
31
|
+
skipWaitForValidParentCheckpointOnL1: false;
|
|
32
|
+
broadcastInvalidBlockProposal: false;
|
|
33
|
+
broadcastInvalidCheckpointProposalOnly: false;
|
|
34
|
+
injectFakeAttestation: false;
|
|
35
|
+
injectHighSValueAttestation: false;
|
|
36
|
+
injectUnrecoverableSignatureAttestation: false;
|
|
37
|
+
injectYParityAttestation: false;
|
|
38
|
+
fishermanMode: false;
|
|
39
|
+
governanceProposerForcePayloadVote: false;
|
|
40
|
+
shuffleAttestationOrdering: false;
|
|
41
|
+
skipPushProposedBlocksToArchiver: false;
|
|
42
|
+
skipPublishingCheckpointsPercent: number;
|
|
43
|
+
maxBlocksPerCheckpoint: number;
|
|
44
|
+
minPeersToPropose: number;
|
|
45
|
+
};
|
|
17
46
|
/**
|
|
18
47
|
* Configuration settings for the SequencerClient.
|
|
19
48
|
*/
|
|
20
|
-
export type SequencerClientConfig =
|
|
49
|
+
export type SequencerClientConfig = SequencerPublisherConfig & KeyStoreConfig & ValidatorClientConfig & SequencerTxSenderConfig & SequencerConfig & L1ReaderConfig & ChainConfig & Pick<P2PConfig, 'txPublicSetupAllowListExtend'> & Pick<L1ContractsConfig, 'ethereumSlotDuration' | 'aztecSlotDuration' | 'aztecEpochDuration'>;
|
|
21
50
|
export declare const sequencerConfigMappings: ConfigMappingsType<SequencerConfig>;
|
|
22
51
|
export declare const sequencerClientConfigMappings: ConfigMappingsType<SequencerClientConfig>;
|
|
23
52
|
/**
|
|
24
53
|
* Creates an instance of SequencerClientConfig out of environment variables using sensible defaults for integration testing if not set.
|
|
25
54
|
*/
|
|
26
55
|
export declare function getConfigEnvVars(): SequencerClientConfig;
|
|
27
|
-
//# sourceMappingURL=data:application/json;base64,
|
|
56
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlnLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvY29uZmlnLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxLQUFLLGlCQUFpQixFQUE2QixNQUFNLHdCQUF3QixDQUFDO0FBQzNGLE9BQU8sRUFBRSxLQUFLLGNBQWMsRUFBMEIsTUFBTSwyQkFBMkIsQ0FBQztBQUN4RixPQUFPLEVBQ0wsS0FBSyxrQkFBa0IsRUFPeEIsTUFBTSwwQkFBMEIsQ0FBQztBQUVsQyxPQUFPLEVBQUUsS0FBSyxjQUFjLEVBQTBCLE1BQU0sNkJBQTZCLENBQUM7QUFDMUYsT0FBTyxFQUFFLEtBQUssU0FBUyxFQUFxQixNQUFNLG1CQUFtQixDQUFDO0FBRXRFLE9BQU8sRUFDTCxLQUFLLFdBQVcsRUFHaEIsS0FBSyxlQUFlLEVBR3JCLE1BQU0sc0JBQXNCLENBQUM7QUFJOUIsT0FBTyxFQUFFLEtBQUsscUJBQXFCLEVBQWlDLE1BQU0sZ0NBQWdDLENBQUM7QUFFM0csT0FBTyxFQUNMLEtBQUssd0JBQXdCLEVBQzdCLEtBQUssdUJBQXVCLEVBRzdCLE1BQU0sdUJBQXVCLENBQUM7QUFFL0IsY0FBYyx1QkFBdUIsQ0FBQztBQUN0QyxZQUFZLEVBQUUsZUFBZSxFQUFFLENBQUM7QUFFaEM7OztHQUdHO0FBQ0gsZUFBTyxNQUFNLHNCQUFzQjs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7O0NBOEJBLENBQUM7QUFFcEM7O0dBRUc7QUFDSCxNQUFNLE1BQU0scUJBQXFCLEdBQUcsd0JBQXdCLEdBQzFELGNBQWMsR0FDZCxxQkFBcUIsR0FDckIsdUJBQXVCLEdBQ3ZCLGVBQWUsR0FDZixjQUFjLEdBQ2QsV0FBVyxHQUNYLElBQUksQ0FBQyxTQUFTLEVBQUUsOEJBQThCLENBQUMsR0FDL0MsSUFBSSxDQUFDLGlCQUFpQixFQUFFLHNCQUFzQixHQUFHLG1CQUFtQixHQUFHLG9CQUFvQixDQUFDLENBQUM7QUFFL0YsZUFBTyxNQUFNLHVCQUF1QixFQUFFLGtCQUFrQixDQUFDLGVBQWUsQ0EyTXZFLENBQUM7QUFFRixlQUFPLE1BQU0sNkJBQTZCLEVBQUUsa0JBQWtCLENBQUMscUJBQXFCLENBU25GLENBQUM7QUFFRjs7R0FFRztBQUNILHdCQUFnQixnQkFBZ0IsSUFBSSxxQkFBcUIsQ0FFeEQifQ==
|
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,
|
|
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,EAOxB,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,EAGhB,KAAK,eAAe,EAGrB,MAAM,sBAAsB,CAAC;AAI9B,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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BA,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,CA2MvE,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,38 +1,49 @@
|
|
|
1
1
|
import { l1ContractsConfigMappings } from '@aztec/ethereum/config';
|
|
2
2
|
import { l1ReaderConfigMappings } from '@aztec/ethereum/l1-reader';
|
|
3
|
-
import { booleanConfigHelper, getConfigFromMappings, numberConfigHelper, pickConfigMappings } from '@aztec/foundation/config';
|
|
3
|
+
import { booleanConfigHelper, floatConfigHelper, getConfigFromMappings, numberConfigHelper, optionalNumberConfigHelper, pickConfigMappings } from '@aztec/foundation/config';
|
|
4
4
|
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, sharedSequencerConfigMappings } from '@aztec/stdlib/config';
|
|
8
|
+
import { DEFAULT_BLOCK_DURATION_MS, DEFAULT_MAX_BLOCKS_PER_CHECKPOINT, chainConfigMappings, sharedSequencerConfigMappings } from '@aztec/stdlib/config';
|
|
9
|
+
import { MIN_PER_BLOCK_ALLOCATION_MULTIPLIER, MIN_PER_BLOCK_DA_ALLOCATION_MULTIPLIER } from '@aztec/stdlib/gas';
|
|
9
10
|
import { DEFAULT_P2P_PROPAGATION_TIME } from '@aztec/stdlib/timetable';
|
|
10
11
|
import { validatorClientConfigMappings } from '@aztec/validator-client/config';
|
|
11
|
-
import {
|
|
12
|
+
import { sequencerPublisherConfigMappings, sequencerTxSenderConfigMappings } from './publisher/config.js';
|
|
12
13
|
export * from './publisher/config.js';
|
|
13
14
|
/**
|
|
14
15
|
* Default values for SequencerConfig.
|
|
15
16
|
* Centralized location for all sequencer configuration defaults.
|
|
16
17
|
*/ export const DefaultSequencerConfig = {
|
|
17
18
|
sequencerPollingIntervalMS: 500,
|
|
18
|
-
maxTxsPerBlock: 32,
|
|
19
19
|
minTxsPerBlock: 1,
|
|
20
20
|
buildCheckpointIfEmpty: false,
|
|
21
21
|
publishTxsWithProposals: false,
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
22
|
+
perBlockAllocationMultiplier: MIN_PER_BLOCK_ALLOCATION_MULTIPLIER,
|
|
23
|
+
perBlockDAAllocationMultiplier: MIN_PER_BLOCK_DA_ALLOCATION_MULTIPLIER,
|
|
24
|
+
redistributeCheckpointBudget: true,
|
|
25
|
+
blockDurationMs: DEFAULT_BLOCK_DURATION_MS,
|
|
26
|
+
l1PublishingTime: 12,
|
|
27
|
+
checkpointProposalSyncGraceSeconds: 2 * (DEFAULT_BLOCK_DURATION_MS / 1000),
|
|
26
28
|
attestationPropagationTime: DEFAULT_P2P_PROPAGATION_TIME,
|
|
27
29
|
secondsBeforeInvalidatingBlockAsCommitteeMember: 144,
|
|
28
30
|
secondsBeforeInvalidatingBlockAsNonCommitteeMember: 432,
|
|
29
31
|
skipCollectingAttestations: false,
|
|
30
32
|
skipInvalidateBlockAsProposer: false,
|
|
33
|
+
skipWaitForValidParentCheckpointOnL1: false,
|
|
31
34
|
broadcastInvalidBlockProposal: false,
|
|
35
|
+
broadcastInvalidCheckpointProposalOnly: false,
|
|
32
36
|
injectFakeAttestation: false,
|
|
37
|
+
injectHighSValueAttestation: false,
|
|
38
|
+
injectUnrecoverableSignatureAttestation: false,
|
|
39
|
+
injectYParityAttestation: false,
|
|
33
40
|
fishermanMode: false,
|
|
41
|
+
governanceProposerForcePayloadVote: false,
|
|
34
42
|
shuffleAttestationOrdering: false,
|
|
35
|
-
skipPushProposedBlocksToArchiver: false
|
|
43
|
+
skipPushProposedBlocksToArchiver: false,
|
|
44
|
+
skipPublishingCheckpointsPercent: 0,
|
|
45
|
+
maxBlocksPerCheckpoint: DEFAULT_MAX_BLOCKS_PER_CHECKPOINT,
|
|
46
|
+
minPeersToPropose: 1
|
|
36
47
|
};
|
|
37
48
|
export const sequencerConfigMappings = {
|
|
38
49
|
sequencerPollingIntervalMS: {
|
|
@@ -40,10 +51,10 @@ export const sequencerConfigMappings = {
|
|
|
40
51
|
description: 'The number of ms to wait between polling for checking to build on the next slot.',
|
|
41
52
|
...numberConfigHelper(DefaultSequencerConfig.sequencerPollingIntervalMS)
|
|
42
53
|
},
|
|
43
|
-
|
|
44
|
-
env: '
|
|
45
|
-
description: 'The maximum number of txs
|
|
46
|
-
...
|
|
54
|
+
maxTxsPerCheckpoint: {
|
|
55
|
+
env: 'SEQ_MAX_TX_PER_CHECKPOINT',
|
|
56
|
+
description: 'The maximum number of txs across all blocks in a checkpoint.',
|
|
57
|
+
...optionalNumberConfigHelper()
|
|
47
58
|
},
|
|
48
59
|
minTxsPerBlock: {
|
|
49
60
|
env: 'SEQ_MIN_TX_PER_BLOCK',
|
|
@@ -61,21 +72,36 @@ export const sequencerConfigMappings = {
|
|
|
61
72
|
maxL2BlockGas: {
|
|
62
73
|
env: 'SEQ_MAX_L2_BLOCK_GAS',
|
|
63
74
|
description: 'The maximum L2 block gas.',
|
|
64
|
-
...
|
|
75
|
+
...optionalNumberConfigHelper()
|
|
65
76
|
},
|
|
66
77
|
maxDABlockGas: {
|
|
67
78
|
env: 'SEQ_MAX_DA_BLOCK_GAS',
|
|
68
79
|
description: 'The maximum DA block gas.',
|
|
69
|
-
...
|
|
80
|
+
...optionalNumberConfigHelper()
|
|
81
|
+
},
|
|
82
|
+
perBlockAllocationMultiplier: {
|
|
83
|
+
env: 'SEQ_PER_BLOCK_ALLOCATION_MULTIPLIER',
|
|
84
|
+
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.',
|
|
85
|
+
...floatConfigHelper(DefaultSequencerConfig.perBlockAllocationMultiplier)
|
|
86
|
+
},
|
|
87
|
+
perBlockDAAllocationMultiplier: {
|
|
88
|
+
env: 'SEQ_PER_BLOCK_DA_ALLOCATION_MULTIPLIER',
|
|
89
|
+
description: 'Per-block budget multiplier applied to DA gas and blob fields in place of perBlockAllocationMultiplier.' + ' Defaults higher than the general multiplier so the largest contract class deploy fits a single block.',
|
|
90
|
+
...floatConfigHelper(DefaultSequencerConfig.perBlockDAAllocationMultiplier)
|
|
91
|
+
},
|
|
92
|
+
redistributeCheckpointBudget: {
|
|
93
|
+
env: 'SEQ_REDISTRIBUTE_CHECKPOINT_BUDGET',
|
|
94
|
+
description: 'Redistribute remaining checkpoint budget evenly across remaining blocks instead of allowing a single block to consume the entire remaining budget.',
|
|
95
|
+
...booleanConfigHelper(DefaultSequencerConfig.redistributeCheckpointBudget)
|
|
70
96
|
},
|
|
71
97
|
coinbase: {
|
|
72
98
|
env: 'COINBASE',
|
|
73
|
-
parseEnv: (val)=>
|
|
99
|
+
parseEnv: (val)=>EthAddress.fromString(val),
|
|
74
100
|
description: 'Recipient of block reward.'
|
|
75
101
|
},
|
|
76
102
|
feeRecipient: {
|
|
77
103
|
env: 'FEE_RECIPIENT',
|
|
78
|
-
parseEnv: (val)=>AztecAddress.
|
|
104
|
+
parseEnv: (val)=>AztecAddress.fromStringUnsafe(val),
|
|
79
105
|
description: 'Address to receive fees.'
|
|
80
106
|
},
|
|
81
107
|
acvmWorkingDirectory: {
|
|
@@ -86,30 +112,20 @@ export const sequencerConfigMappings = {
|
|
|
86
112
|
env: 'ACVM_BINARY_PATH',
|
|
87
113
|
description: 'The path to the ACVM binary'
|
|
88
114
|
},
|
|
89
|
-
maxBlockSizeInBytes: {
|
|
90
|
-
env: 'SEQ_MAX_BLOCK_SIZE_IN_BYTES',
|
|
91
|
-
description: 'Max block size',
|
|
92
|
-
...numberConfigHelper(DefaultSequencerConfig.maxBlockSizeInBytes)
|
|
93
|
-
},
|
|
94
|
-
enforceTimeTable: {
|
|
95
|
-
env: 'SEQ_ENFORCE_TIME_TABLE',
|
|
96
|
-
description: 'Whether to enforce the time table when building blocks',
|
|
97
|
-
...booleanConfigHelper(DefaultSequencerConfig.enforceTimeTable)
|
|
98
|
-
},
|
|
99
115
|
governanceProposerPayload: {
|
|
100
116
|
env: 'GOVERNANCE_PROPOSER_PAYLOAD_ADDRESS',
|
|
101
117
|
description: 'The address of the payload for the governanceProposer',
|
|
102
118
|
parseEnv: (val)=>EthAddress.fromString(val)
|
|
103
119
|
},
|
|
120
|
+
governanceProposerForcePayloadVote: {
|
|
121
|
+
env: 'GOVERNANCE_PROPOSER_FORCE_PAYLOAD_VOTE',
|
|
122
|
+
description: 'Keep signalling the configured governance payload even if a proposal referencing it was already executed.',
|
|
123
|
+
...booleanConfigHelper(DefaultSequencerConfig.governanceProposerForcePayloadVote)
|
|
124
|
+
},
|
|
104
125
|
l1PublishingTime: {
|
|
105
126
|
env: 'SEQ_L1_PUBLISHING_TIME_ALLOWANCE_IN_SLOT',
|
|
106
|
-
description: 'How much time
|
|
107
|
-
|
|
108
|
-
},
|
|
109
|
-
attestationPropagationTime: {
|
|
110
|
-
env: 'SEQ_ATTESTATION_PROPAGATION_TIME',
|
|
111
|
-
description: 'How many seconds it takes for proposals and attestations to travel across the p2p layer (one-way)',
|
|
112
|
-
...numberConfigHelper(DefaultSequencerConfig.attestationPropagationTime)
|
|
127
|
+
description: 'How much time in seconds to allow in the slot for publishing the L1 transaction.',
|
|
128
|
+
...numberConfigHelper(DefaultSequencerConfig.l1PublishingTime)
|
|
113
129
|
},
|
|
114
130
|
fakeProcessingDelayPerTxMs: {
|
|
115
131
|
description: 'Used for testing to introduce a fake delay after processing each tx'
|
|
@@ -135,14 +151,38 @@ export const sequencerConfigMappings = {
|
|
|
135
151
|
description: 'Do not invalidate the previous block if invalid when we are the proposer (for testing only)',
|
|
136
152
|
...booleanConfigHelper(DefaultSequencerConfig.skipInvalidateBlockAsProposer)
|
|
137
153
|
},
|
|
154
|
+
skipWaitForValidParentCheckpointOnL1: {
|
|
155
|
+
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)',
|
|
156
|
+
...booleanConfigHelper(DefaultSequencerConfig.skipWaitForValidParentCheckpointOnL1)
|
|
157
|
+
},
|
|
138
158
|
broadcastInvalidBlockProposal: {
|
|
139
159
|
description: 'Broadcast invalid block proposals with corrupted state (for testing only)',
|
|
140
160
|
...booleanConfigHelper(DefaultSequencerConfig.broadcastInvalidBlockProposal)
|
|
141
161
|
},
|
|
162
|
+
invalidBlockProposalIndexWithinCheckpoint: {
|
|
163
|
+
description: 'Broadcast an invalid block proposal only at this indexWithinCheckpoint (for testing only)',
|
|
164
|
+
...optionalNumberConfigHelper()
|
|
165
|
+
},
|
|
166
|
+
broadcastInvalidCheckpointProposalOnly: {
|
|
167
|
+
description: 'Broadcast invalid checkpoint proposals while keeping the underlying block proposals valid (for testing only). When unset, the checkpoint follows broadcastInvalidBlockProposal.',
|
|
168
|
+
...booleanConfigHelper(DefaultSequencerConfig.broadcastInvalidCheckpointProposalOnly)
|
|
169
|
+
},
|
|
142
170
|
injectFakeAttestation: {
|
|
143
171
|
description: 'Inject a fake attestation (for testing only)',
|
|
144
172
|
...booleanConfigHelper(DefaultSequencerConfig.injectFakeAttestation)
|
|
145
173
|
},
|
|
174
|
+
injectHighSValueAttestation: {
|
|
175
|
+
description: 'Inject a malleable attestation with a high-s value (for testing only)',
|
|
176
|
+
...booleanConfigHelper(DefaultSequencerConfig.injectHighSValueAttestation)
|
|
177
|
+
},
|
|
178
|
+
injectUnrecoverableSignatureAttestation: {
|
|
179
|
+
description: 'Inject an attestation with an unrecoverable signature (for testing only)',
|
|
180
|
+
...booleanConfigHelper(DefaultSequencerConfig.injectUnrecoverableSignatureAttestation)
|
|
181
|
+
},
|
|
182
|
+
injectYParityAttestation: {
|
|
183
|
+
description: 'Inject a non-proposer attestation slot in yParity form in the packed L1 tuple (for testing only)',
|
|
184
|
+
...booleanConfigHelper(DefaultSequencerConfig.injectYParityAttestation)
|
|
185
|
+
},
|
|
146
186
|
fishermanMode: {
|
|
147
187
|
env: 'FISHERMAN_MODE',
|
|
148
188
|
description: 'Whether to run in fisherman mode: builds blocks on every slot for validation without publishing to L1',
|
|
@@ -159,21 +199,45 @@ export const sequencerConfigMappings = {
|
|
|
159
199
|
...booleanConfigHelper(DefaultSequencerConfig.buildCheckpointIfEmpty)
|
|
160
200
|
},
|
|
161
201
|
skipPushProposedBlocksToArchiver: {
|
|
162
|
-
description: 'Skip pushing proposed blocks to archiver (
|
|
202
|
+
description: 'Skip pushing proposed blocks to archiver (test only)',
|
|
163
203
|
...booleanConfigHelper(DefaultSequencerConfig.skipPushProposedBlocksToArchiver)
|
|
164
204
|
},
|
|
205
|
+
minBlocksForCheckpoint: {
|
|
206
|
+
description: 'Minimum number of blocks required for a checkpoint proposal (test only)'
|
|
207
|
+
},
|
|
208
|
+
skipPublishingCheckpointsPercent: {
|
|
209
|
+
env: 'SEQ_SKIP_CHECKPOINT_PUBLISH_PERCENT',
|
|
210
|
+
description: 'Percent probability (0 - 100) of sequencer skipping checkpoint publishing (testing only)',
|
|
211
|
+
...numberConfigHelper(DefaultSequencerConfig.skipPublishingCheckpointsPercent)
|
|
212
|
+
},
|
|
213
|
+
skipBroadcastProposals: {
|
|
214
|
+
description: 'Skip broadcasting checkpoint and block proposals via gossipsub when proposer (for testing only)',
|
|
215
|
+
...booleanConfigHelper(false)
|
|
216
|
+
},
|
|
217
|
+
skipBroadcastCheckpointProposal: {
|
|
218
|
+
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)',
|
|
219
|
+
...booleanConfigHelper(false)
|
|
220
|
+
},
|
|
221
|
+
pauseProposingForSlots: {
|
|
222
|
+
description: 'List of slots for which the sequencer will not produce a proposal (for testing only). Attestation paths are unaffected.'
|
|
223
|
+
},
|
|
224
|
+
minPeersToPropose: {
|
|
225
|
+
env: 'SEQ_MIN_PEERS_TO_PROPOSE',
|
|
226
|
+
description: 'Minimum number of connected p2p peers required to build and propose a checkpoint (zero to disable the check).' + ' Ignored when p2p is disabled by config.',
|
|
227
|
+
...numberConfigHelper(DefaultSequencerConfig.minPeersToPropose)
|
|
228
|
+
},
|
|
165
229
|
...pickConfigMappings(p2pConfigMappings, [
|
|
166
|
-
'
|
|
230
|
+
'txPublicSetupAllowListExtend'
|
|
167
231
|
])
|
|
168
232
|
};
|
|
169
233
|
export const sequencerClientConfigMappings = {
|
|
234
|
+
...chainConfigMappings,
|
|
170
235
|
...validatorClientConfigMappings,
|
|
171
236
|
...sequencerConfigMappings,
|
|
172
237
|
...keyStoreConfigMappings,
|
|
173
238
|
...l1ReaderConfigMappings,
|
|
174
|
-
...
|
|
175
|
-
...
|
|
176
|
-
...chainConfigMappings,
|
|
239
|
+
...sequencerTxSenderConfigMappings,
|
|
240
|
+
...sequencerPublisherConfigMappings,
|
|
177
241
|
...pickConfigMappings(l1ContractsConfigMappings, [
|
|
178
242
|
'ethereumSlotDuration',
|
|
179
243
|
'aztecSlotDuration',
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { type RollupContract } from '@aztec/ethereum/contracts';
|
|
2
|
+
import type { DateProvider } from '@aztec/foundation/timer';
|
|
3
|
+
import { GasFees, ManaUsageEstimate } from '@aztec/stdlib/gas';
|
|
4
|
+
/**
|
|
5
|
+
* Predicts min fees for LAG upcoming slots based on the L1 oracle state.
|
|
6
|
+
* A new oracle update can activate at startSlot + LAG, so only the first LAG entries
|
|
7
|
+
* are guaranteed stable. Caches L1 queries per L1 block and recomputes predictions
|
|
8
|
+
* for each mana usage estimate.
|
|
9
|
+
*/
|
|
10
|
+
export declare class FeePredictor {
|
|
11
|
+
private readonly rollupContract;
|
|
12
|
+
private readonly publicClient;
|
|
13
|
+
private readonly dateProvider;
|
|
14
|
+
private cachedState;
|
|
15
|
+
private cachedL1BlockNumber;
|
|
16
|
+
private readonly slotDuration;
|
|
17
|
+
private readonly l1GenesisTime;
|
|
18
|
+
private readonly ethereumSlotDuration;
|
|
19
|
+
constructor(rollupContract: RollupContract, publicClient: {
|
|
20
|
+
getBlockNumber: (opts?: {
|
|
21
|
+
cacheTime?: number;
|
|
22
|
+
}) => Promise<bigint>;
|
|
23
|
+
}, dateProvider: DateProvider, config: {
|
|
24
|
+
slotDuration: number;
|
|
25
|
+
l1GenesisTime: bigint;
|
|
26
|
+
ethereumSlotDuration: number;
|
|
27
|
+
});
|
|
28
|
+
/** Returns predicted min fees for each slot in the prediction window. */
|
|
29
|
+
getPredictedMinFees(manaUsage: ManaUsageEstimate): Promise<GasFees[]>;
|
|
30
|
+
private getState;
|
|
31
|
+
private fetchState;
|
|
32
|
+
/** Computes per-slot fee predictions given cached state and a mana usage assumption. */
|
|
33
|
+
private computePredictions;
|
|
34
|
+
private getAssumedManaUsed;
|
|
35
|
+
private computeGasFees;
|
|
36
|
+
}
|
|
37
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmVlX3ByZWRpY3Rvci5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2dsb2JhbF92YXJpYWJsZV9idWlsZGVyL2ZlZV9wcmVkaWN0b3IudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFvRCxLQUFLLGNBQWMsRUFBRSxNQUFNLDJCQUEyQixDQUFDO0FBR2xILE9BQU8sS0FBSyxFQUFFLFlBQVksRUFBRSxNQUFNLHlCQUF5QixDQUFDO0FBRTVELE9BQU8sRUFFTCxPQUFPLEVBRVAsaUJBQWlCLEVBR2xCLE1BQU0sbUJBQW1CLENBQUM7QUFlM0I7Ozs7O0dBS0c7QUFDSCxxQkFBYSxZQUFZO0lBU3JCLE9BQU8sQ0FBQyxRQUFRLENBQUMsY0FBYztJQUMvQixPQUFPLENBQUMsUUFBUSxDQUFDLFlBQVk7SUFDN0IsT0FBTyxDQUFDLFFBQVEsQ0FBQyxZQUFZO0lBVi9CLE9BQU8sQ0FBQyxXQUFXLENBQXNDO0lBQ3pELE9BQU8sQ0FBQyxtQkFBbUIsQ0FBcUI7SUFFaEQsT0FBTyxDQUFDLFFBQVEsQ0FBQyxZQUFZLENBQVM7SUFDdEMsT0FBTyxDQUFDLFFBQVEsQ0FBQyxhQUFhLENBQVM7SUFDdkMsT0FBTyxDQUFDLFFBQVEsQ0FBQyxvQkFBb0IsQ0FBUztJQUU5QyxZQUNtQixjQUFjLEVBQUUsY0FBYyxFQUM5QixZQUFZLEVBQUU7UUFBRSxjQUFjLEVBQUUsQ0FBQyxJQUFJLENBQUMsRUFBRTtZQUFFLFNBQVMsQ0FBQyxFQUFFLE1BQU0sQ0FBQTtTQUFFLEtBQUssT0FBTyxDQUFDLE1BQU0sQ0FBQyxDQUFBO0tBQUUsRUFDcEYsWUFBWSxFQUFFLFlBQVksRUFDM0MsTUFBTSxFQUFFO1FBQUUsWUFBWSxFQUFFLE1BQU0sQ0FBQztRQUFDLGFBQWEsRUFBRSxNQUFNLENBQUM7UUFBQyxvQkFBb0IsRUFBRSxNQUFNLENBQUE7S0FBRSxFQUt0RjtJQUVELHlFQUF5RTtJQUNuRSxtQkFBbUIsQ0FBQyxTQUFTLEVBQUUsaUJBQWlCLEdBQUcsT0FBTyxDQUFDLE9BQU8sRUFBRSxDQUFDLENBRzFFO1lBR2EsUUFBUTtZQW1CUixVQUFVO0lBaUR4Qix3RkFBd0Y7SUFDeEYsT0FBTyxDQUFDLGtCQUFrQjtJQXVCMUIsT0FBTyxDQUFDLGtCQUFrQjtJQVcxQixPQUFPLENBQUMsY0FBYztDQW1CdkIifQ==
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fee_predictor.d.ts","sourceRoot":"","sources":["../../src/global_variable_builder/fee_predictor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoD,KAAK,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAGlH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,yBAAyB,CAAC;AAE5D,OAAO,EAEL,OAAO,EAEP,iBAAiB,EAGlB,MAAM,mBAAmB,CAAC;AAe3B;;;;;GAKG;AACH,qBAAa,YAAY;IASrB,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,YAAY;IAV/B,OAAO,CAAC,WAAW,CAAsC;IACzD,OAAO,CAAC,mBAAmB,CAAqB;IAEhD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAS;IACtC,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAS;IACvC,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAS;IAE9C,YACmB,cAAc,EAAE,cAAc,EAC9B,YAAY,EAAE;QAAE,cAAc,EAAE,CAAC,IAAI,CAAC,EAAE;YAAE,SAAS,CAAC,EAAE,MAAM,CAAA;SAAE,KAAK,OAAO,CAAC,MAAM,CAAC,CAAA;KAAE,EACpF,YAAY,EAAE,YAAY,EAC3C,MAAM,EAAE;QAAE,YAAY,EAAE,MAAM,CAAC;QAAC,aAAa,EAAE,MAAM,CAAC;QAAC,oBAAoB,EAAE,MAAM,CAAA;KAAE,EAKtF;IAED,yEAAyE;IACnE,mBAAmB,CAAC,SAAS,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAG1E;YAGa,QAAQ;YAmBR,UAAU;IAiDxB,wFAAwF;IACxF,OAAO,CAAC,kBAAkB;IAuB1B,OAAO,CAAC,kBAAkB;IAW1B,OAAO,CAAC,cAAc;CAmBvB"}
|