@aztec/sequencer-client 0.0.1-commit.b655e406 → 0.0.1-commit.b6e433891

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.
Files changed (119) hide show
  1. package/dest/client/index.d.ts +1 -1
  2. package/dest/client/sequencer-client.d.ts +21 -16
  3. package/dest/client/sequencer-client.d.ts.map +1 -1
  4. package/dest/client/sequencer-client.js +75 -28
  5. package/dest/config.d.ts +35 -9
  6. package/dest/config.d.ts.map +1 -1
  7. package/dest/config.js +113 -42
  8. package/dest/global_variable_builder/global_builder.d.ts +20 -16
  9. package/dest/global_variable_builder/global_builder.d.ts.map +1 -1
  10. package/dest/global_variable_builder/global_builder.js +54 -40
  11. package/dest/global_variable_builder/index.d.ts +1 -1
  12. package/dest/index.d.ts +2 -3
  13. package/dest/index.d.ts.map +1 -1
  14. package/dest/index.js +1 -2
  15. package/dest/publisher/config.d.ts +43 -20
  16. package/dest/publisher/config.d.ts.map +1 -1
  17. package/dest/publisher/config.js +109 -34
  18. package/dest/publisher/index.d.ts +2 -1
  19. package/dest/publisher/index.d.ts.map +1 -1
  20. package/dest/publisher/l1_tx_failed_store/factory.d.ts +11 -0
  21. package/dest/publisher/l1_tx_failed_store/factory.d.ts.map +1 -0
  22. package/dest/publisher/l1_tx_failed_store/factory.js +22 -0
  23. package/dest/publisher/l1_tx_failed_store/failed_tx_store.d.ts +59 -0
  24. package/dest/publisher/l1_tx_failed_store/failed_tx_store.d.ts.map +1 -0
  25. package/dest/publisher/l1_tx_failed_store/failed_tx_store.js +1 -0
  26. package/dest/publisher/l1_tx_failed_store/file_store_failed_tx_store.d.ts +15 -0
  27. package/dest/publisher/l1_tx_failed_store/file_store_failed_tx_store.d.ts.map +1 -0
  28. package/dest/publisher/l1_tx_failed_store/file_store_failed_tx_store.js +34 -0
  29. package/dest/publisher/l1_tx_failed_store/index.d.ts +4 -0
  30. package/dest/publisher/l1_tx_failed_store/index.d.ts.map +1 -0
  31. package/dest/publisher/l1_tx_failed_store/index.js +2 -0
  32. package/dest/publisher/sequencer-publisher-factory.d.ts +15 -6
  33. package/dest/publisher/sequencer-publisher-factory.d.ts.map +1 -1
  34. package/dest/publisher/sequencer-publisher-factory.js +28 -3
  35. package/dest/publisher/sequencer-publisher-metrics.d.ts +3 -3
  36. package/dest/publisher/sequencer-publisher-metrics.d.ts.map +1 -1
  37. package/dest/publisher/sequencer-publisher-metrics.js +23 -86
  38. package/dest/publisher/sequencer-publisher.d.ts +103 -69
  39. package/dest/publisher/sequencer-publisher.d.ts.map +1 -1
  40. package/dest/publisher/sequencer-publisher.js +999 -190
  41. package/dest/sequencer/checkpoint_proposal_job.d.ts +108 -0
  42. package/dest/sequencer/checkpoint_proposal_job.d.ts.map +1 -0
  43. package/dest/sequencer/checkpoint_proposal_job.js +1289 -0
  44. package/dest/sequencer/checkpoint_voter.d.ts +35 -0
  45. package/dest/sequencer/checkpoint_voter.d.ts.map +1 -0
  46. package/dest/sequencer/checkpoint_voter.js +109 -0
  47. package/dest/sequencer/config.d.ts +3 -2
  48. package/dest/sequencer/config.d.ts.map +1 -1
  49. package/dest/sequencer/errors.d.ts +1 -1
  50. package/dest/sequencer/errors.d.ts.map +1 -1
  51. package/dest/sequencer/events.d.ts +47 -0
  52. package/dest/sequencer/events.d.ts.map +1 -0
  53. package/dest/sequencer/events.js +1 -0
  54. package/dest/sequencer/index.d.ts +4 -2
  55. package/dest/sequencer/index.d.ts.map +1 -1
  56. package/dest/sequencer/index.js +3 -1
  57. package/dest/sequencer/metrics.d.ts +48 -3
  58. package/dest/sequencer/metrics.d.ts.map +1 -1
  59. package/dest/sequencer/metrics.js +243 -50
  60. package/dest/sequencer/sequencer.d.ts +127 -144
  61. package/dest/sequencer/sequencer.d.ts.map +1 -1
  62. package/dest/sequencer/sequencer.js +770 -545
  63. package/dest/sequencer/timetable.d.ts +54 -16
  64. package/dest/sequencer/timetable.d.ts.map +1 -1
  65. package/dest/sequencer/timetable.js +147 -62
  66. package/dest/sequencer/types.d.ts +3 -0
  67. package/dest/sequencer/types.d.ts.map +1 -0
  68. package/dest/sequencer/types.js +1 -0
  69. package/dest/sequencer/utils.d.ts +14 -8
  70. package/dest/sequencer/utils.d.ts.map +1 -1
  71. package/dest/sequencer/utils.js +7 -4
  72. package/dest/test/index.d.ts +6 -7
  73. package/dest/test/index.d.ts.map +1 -1
  74. package/dest/test/mock_checkpoint_builder.d.ts +95 -0
  75. package/dest/test/mock_checkpoint_builder.d.ts.map +1 -0
  76. package/dest/test/mock_checkpoint_builder.js +231 -0
  77. package/dest/test/utils.d.ts +53 -0
  78. package/dest/test/utils.d.ts.map +1 -0
  79. package/dest/test/utils.js +104 -0
  80. package/package.json +32 -30
  81. package/src/client/sequencer-client.ts +100 -52
  82. package/src/config.ts +132 -51
  83. package/src/global_variable_builder/global_builder.ts +69 -60
  84. package/src/index.ts +1 -7
  85. package/src/publisher/config.ts +139 -50
  86. package/src/publisher/index.ts +3 -0
  87. package/src/publisher/l1_tx_failed_store/factory.ts +32 -0
  88. package/src/publisher/l1_tx_failed_store/failed_tx_store.ts +55 -0
  89. package/src/publisher/l1_tx_failed_store/file_store_failed_tx_store.ts +46 -0
  90. package/src/publisher/l1_tx_failed_store/index.ts +3 -0
  91. package/src/publisher/sequencer-publisher-factory.ts +45 -11
  92. package/src/publisher/sequencer-publisher-metrics.ts +19 -71
  93. package/src/publisher/sequencer-publisher.ts +717 -248
  94. package/src/sequencer/README.md +531 -0
  95. package/src/sequencer/checkpoint_proposal_job.ts +1049 -0
  96. package/src/sequencer/checkpoint_voter.ts +130 -0
  97. package/src/sequencer/config.ts +2 -1
  98. package/src/sequencer/events.ts +27 -0
  99. package/src/sequencer/index.ts +3 -1
  100. package/src/sequencer/metrics.ts +310 -61
  101. package/src/sequencer/sequencer.ts +541 -735
  102. package/src/sequencer/timetable.ts +178 -83
  103. package/src/sequencer/types.ts +6 -0
  104. package/src/sequencer/utils.ts +18 -9
  105. package/src/test/index.ts +5 -6
  106. package/src/test/mock_checkpoint_builder.ts +323 -0
  107. package/src/test/utils.ts +167 -0
  108. package/dest/sequencer/block_builder.d.ts +0 -27
  109. package/dest/sequencer/block_builder.d.ts.map +0 -1
  110. package/dest/sequencer/block_builder.js +0 -130
  111. package/dest/tx_validator/nullifier_cache.d.ts +0 -14
  112. package/dest/tx_validator/nullifier_cache.d.ts.map +0 -1
  113. package/dest/tx_validator/nullifier_cache.js +0 -24
  114. package/dest/tx_validator/tx_validator_factory.d.ts +0 -17
  115. package/dest/tx_validator/tx_validator_factory.d.ts.map +0 -1
  116. package/dest/tx_validator/tx_validator_factory.js +0 -53
  117. package/src/sequencer/block_builder.ts +0 -218
  118. package/src/tx_validator/nullifier_cache.ts +0 -30
  119. package/src/tx_validator/tx_validator_factory.ts +0 -132
@@ -1,2 +1,2 @@
1
1
  export * from './sequencer-client.js';
2
- //# sourceMappingURL=index.d.ts.map
2
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9jbGllbnQvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyx1QkFBdUIsQ0FBQyJ9
@@ -1,30 +1,31 @@
1
- import type { BlobSinkClientInterface } from '@aztec/blob-sink/client';
1
+ import type { BlobClientInterface } from '@aztec/blob-client/client';
2
2
  import { EpochCache } from '@aztec/epoch-cache';
3
- import { PublisherManager } from '@aztec/ethereum';
4
- import { L1TxUtilsWithBlobs } from '@aztec/ethereum/l1-tx-utils-with-blobs';
3
+ import { type Delayer, L1TxUtils } from '@aztec/ethereum/l1-tx-utils';
4
+ import { PublisherManager } from '@aztec/ethereum/publisher-manager';
5
5
  import { EthAddress } from '@aztec/foundation/eth-address';
6
6
  import type { DateProvider } from '@aztec/foundation/timer';
7
7
  import type { KeystoreManager } from '@aztec/node-keystore';
8
8
  import type { P2P } from '@aztec/p2p';
9
9
  import type { SlasherClientInterface } from '@aztec/slasher';
10
- import type { L2BlockSource } from '@aztec/stdlib/block';
11
- import type { IFullNodeBlockBuilder, ValidatorClientFullConfig, WorldStateSynchronizer } from '@aztec/stdlib/interfaces/server';
10
+ import type { L2BlockSink, L2BlockSource } from '@aztec/stdlib/block';
11
+ import type { ValidatorClientFullConfig, WorldStateSynchronizer } from '@aztec/stdlib/interfaces/server';
12
12
  import type { L1ToL2MessageSource } from '@aztec/stdlib/messaging';
13
13
  import { L1Metrics, type TelemetryClient } from '@aztec/telemetry-client';
14
- import { type ValidatorClient } from '@aztec/validator-client';
15
- import type { SequencerClientConfig } from '../config.js';
14
+ import { FullNodeCheckpointsBuilder, NodeKeystoreAdapter, type ValidatorClient } from '@aztec/validator-client';
15
+ import { type SequencerClientConfig } from '../config.js';
16
16
  import { SequencerPublisherFactory } from '../publisher/sequencer-publisher-factory.js';
17
17
  import { Sequencer, type SequencerConfig } from '../sequencer/index.js';
18
18
  /**
19
19
  * Encapsulates the full sequencer and publisher.
20
20
  */
21
21
  export declare class SequencerClient {
22
- protected publisherManager: PublisherManager<L1TxUtilsWithBlobs>;
22
+ protected publisherManager: PublisherManager<L1TxUtils>;
23
23
  protected sequencer: Sequencer;
24
- protected blockBuilder: IFullNodeBlockBuilder;
24
+ protected checkpointsBuilder: FullNodeCheckpointsBuilder;
25
25
  protected validatorClient?: ValidatorClient | undefined;
26
26
  private l1Metrics?;
27
- constructor(publisherManager: PublisherManager<L1TxUtilsWithBlobs>, sequencer: Sequencer, blockBuilder: IFullNodeBlockBuilder, validatorClient?: ValidatorClient | undefined, l1Metrics?: L1Metrics | undefined);
27
+ private delayer_?;
28
+ constructor(publisherManager: PublisherManager<L1TxUtils>, sequencer: Sequencer, checkpointsBuilder: FullNodeCheckpointsBuilder, validatorClient?: ValidatorClient | undefined, l1Metrics?: L1Metrics | undefined, delayer_?: Delayer | undefined);
28
29
  /**
29
30
  * Initializes a new instance.
30
31
  * @param config - Configuration for the sequencer, publisher, and L1 tx sender.
@@ -38,19 +39,19 @@ export declare class SequencerClient {
38
39
  * @returns A new running instance.
39
40
  */
40
41
  static new(config: SequencerClientConfig, deps: {
41
- validatorClient: ValidatorClient | undefined;
42
+ validatorClient: ValidatorClient;
42
43
  p2pClient: P2P;
43
44
  worldStateSynchronizer: WorldStateSynchronizer;
44
45
  slasherClient: SlasherClientInterface | undefined;
45
- blockBuilder: IFullNodeBlockBuilder;
46
- l2BlockSource: L2BlockSource;
46
+ checkpointsBuilder: FullNodeCheckpointsBuilder;
47
+ l2BlockSource: L2BlockSource & L2BlockSink;
47
48
  l1ToL2MessageSource: L1ToL2MessageSource;
48
49
  telemetry: TelemetryClient;
49
50
  publisherFactory?: SequencerPublisherFactory;
50
- blobSinkClient?: BlobSinkClientInterface;
51
+ blobClient: BlobClientInterface;
51
52
  dateProvider: DateProvider;
52
53
  epochCache?: EpochCache;
53
- l1TxUtils: L1TxUtilsWithBlobs[];
54
+ l1TxUtils: L1TxUtils[];
54
55
  nodeKeyStore: KeystoreManager;
55
56
  }): Promise<SequencerClient>;
56
57
  /**
@@ -65,7 +66,11 @@ export declare class SequencerClient {
65
66
  */
66
67
  stop(): Promise<void>;
67
68
  getSequencer(): Sequencer;
69
+ /** Updates the publisher factory's node keystore adapter after a keystore reload. */
70
+ updatePublisherNodeKeyStore(adapter: NodeKeystoreAdapter): void;
71
+ /** Returns the shared tx delayer for sequencer L1 txs, if enabled. Test-only. */
72
+ getDelayer(): Delayer | undefined;
68
73
  get validatorAddresses(): EthAddress[] | undefined;
69
74
  get maxL2BlockGas(): number | undefined;
70
75
  }
71
- //# sourceMappingURL=sequencer-client.d.ts.map
76
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoic2VxdWVuY2VyLWNsaWVudC5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL2NsaWVudC9zZXF1ZW5jZXItY2xpZW50Ln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;;;;;;;;;OAWG;IACH,OAAoB,GAAG,CACrB,MAAM,EAAE,qBAAqB,EAC7B,IAAI,EAAE;QACJ,eAAe,EAAE,eAAe,CAAC;QACjC,SAAS,EAAE,GAAG,CAAC;QACf,sBAAsB,EAAE,sBAAsB,CAAC;QAC/C,aAAa,EAAE,sBAAsB,GAAG,SAAS,CAAC;QAClD,kBAAkB,EAAE,0BAA0B,CAAC;QAC/C,aAAa,EAAE,aAAa,GAAG,WAAW,CAAC;QAC3C,mBAAmB,EAAE,mBAAmB,CAAC;QACzC,SAAS,EAAE,eAAe,CAAC;QAC3B,gBAAgB,CAAC,EAAE,yBAAyB,CAAC;QAC7C,UAAU,EAAE,mBAAmB,CAAC;QAChC,YAAY,EAAE,YAAY,CAAC;QAC3B,UAAU,CAAC,EAAE,UAAU,CAAC;QACxB,SAAS,EAAE,SAAS,EAAE,CAAC;QACvB,YAAY,EAAE,eAAe,CAAC;KAC/B,4BAuHF;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"}
@@ -1,10 +1,15 @@
1
+ import { MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT } from '@aztec/constants';
1
2
  import { EpochCache } from '@aztec/epoch-cache';
2
- import { GovernanceProposerContract, PublisherManager, RollupContract, getPublicClient, isAnvilTestChain } from '@aztec/ethereum';
3
+ import { isAnvilTestChain } from '@aztec/ethereum/chain';
4
+ import { getPublicClient } from '@aztec/ethereum/client';
5
+ import { GovernanceProposerContract, RollupContract } from '@aztec/ethereum/contracts';
6
+ import { PublisherManager } from '@aztec/ethereum/publisher-manager';
3
7
  import { EthAddress } from '@aztec/foundation/eth-address';
4
8
  import { createLogger } from '@aztec/foundation/log';
5
9
  import { SlashFactoryContract } from '@aztec/stdlib/l1-contracts';
6
10
  import { L1Metrics } from '@aztec/telemetry-client';
7
11
  import { NodeKeystoreAdapter } from '@aztec/validator-client';
12
+ import { getPublisherConfigFromSequencerConfig } from '../config.js';
8
13
  import { GlobalVariableBuilder } from '../global_variable_builder/index.js';
9
14
  import { SequencerPublisherFactory } from '../publisher/sequencer-publisher-factory.js';
10
15
  import { Sequencer } from '../sequencer/index.js';
@@ -13,15 +18,17 @@ import { Sequencer } from '../sequencer/index.js';
13
18
  */ export class SequencerClient {
14
19
  publisherManager;
15
20
  sequencer;
16
- blockBuilder;
21
+ checkpointsBuilder;
17
22
  validatorClient;
18
23
  l1Metrics;
19
- constructor(publisherManager, sequencer, blockBuilder, validatorClient, l1Metrics){
24
+ delayer_;
25
+ constructor(publisherManager, sequencer, checkpointsBuilder, validatorClient, l1Metrics, delayer_){
20
26
  this.publisherManager = publisherManager;
21
27
  this.sequencer = sequencer;
22
- this.blockBuilder = blockBuilder;
28
+ this.checkpointsBuilder = checkpointsBuilder;
23
29
  this.validatorClient = validatorClient;
24
30
  this.l1Metrics = l1Metrics;
31
+ this.delayer_ = delayer_;
25
32
  }
26
33
  /**
27
34
  * Initializes a new instance.
@@ -35,31 +42,34 @@ import { Sequencer } from '../sequencer/index.js';
35
42
  * @param prover - An instance of a block prover
36
43
  * @returns A new running instance.
37
44
  */ static async new(config, deps) {
38
- const { validatorClient, p2pClient, worldStateSynchronizer, slasherClient, blockBuilder, l2BlockSource, l1ToL2MessageSource, telemetry: telemetryClient } = deps;
45
+ const { validatorClient, p2pClient, worldStateSynchronizer, slasherClient, checkpointsBuilder, l2BlockSource, l1ToL2MessageSource, telemetry: telemetryClient } = deps;
39
46
  const { l1RpcUrls: rpcUrls, l1ChainId: chainId } = config;
40
47
  const log = createLogger('sequencer');
41
48
  const publicClient = getPublicClient(config);
42
49
  const l1TxUtils = deps.l1TxUtils;
43
50
  const l1Metrics = new L1Metrics(telemetryClient.getMeter('L1PublisherMetrics'), publicClient, l1TxUtils.map((x)=>x.getSenderAddress()));
44
- const publisherManager = new PublisherManager(l1TxUtils, config);
51
+ const publisherManager = new PublisherManager(l1TxUtils, getPublisherConfigFromSequencerConfig(config), log.getBindings());
45
52
  const rollupContract = new RollupContract(publicClient, config.l1Contracts.rollupAddress.toString());
46
- const [l1GenesisTime, slotDuration] = await Promise.all([
53
+ const [l1GenesisTime, slotDuration, rollupVersion, rollupManaLimit] = await Promise.all([
47
54
  rollupContract.getL1GenesisTime(),
48
- rollupContract.getSlotDuration()
55
+ rollupContract.getSlotDuration(),
56
+ rollupContract.getVersion(),
57
+ rollupContract.getManaLimit().then(Number)
49
58
  ]);
50
59
  const governanceProposerContract = new GovernanceProposerContract(publicClient, config.l1Contracts.governanceProposerAddress.toString());
51
60
  const epochCache = deps.epochCache ?? await EpochCache.create(config.l1Contracts.rollupAddress, {
52
61
  l1RpcUrls: rpcUrls,
53
62
  l1ChainId: chainId,
54
63
  viemPollingIntervalMS: config.viemPollingIntervalMS,
55
- ethereumSlotDuration: config.ethereumSlotDuration
64
+ ethereumSlotDuration: config.ethereumSlotDuration,
65
+ enableProposerPipelining: config.enableProposerPipelining
56
66
  }, {
57
67
  dateProvider: deps.dateProvider
58
68
  });
59
69
  const slashFactoryContract = new SlashFactoryContract(publicClient, config.l1Contracts.slashFactoryAddress?.toString() ?? EthAddress.ZERO.toString());
60
70
  const publisherFactory = deps.publisherFactory ?? new SequencerPublisherFactory(config, {
61
71
  telemetry: telemetryClient,
62
- blobSinkClient: deps.blobSinkClient,
72
+ blobClient: deps.blobClient,
63
73
  epochCache,
64
74
  governanceProposerContract,
65
75
  slashFactoryContract,
@@ -69,40 +79,46 @@ import { Sequencer } from '../sequencer/index.js';
69
79
  nodeKeyStore: NodeKeystoreAdapter.fromKeyStoreManager(deps.nodeKeyStore),
70
80
  logger: log
71
81
  });
72
- const globalsBuilder = new GlobalVariableBuilder(config);
73
82
  const ethereumSlotDuration = config.ethereumSlotDuration;
74
- const rollupManaLimit = Number(await rollupContract.getManaLimit());
75
- let sequencerManaLimit = config.maxL2BlockGas ?? rollupManaLimit;
76
- if (sequencerManaLimit > rollupManaLimit) {
77
- log.warn(`Provided maxL2BlockGas of ${sequencerManaLimit} is greater than the maximum allowed by the L1 (${rollupManaLimit}), setting limit to ${rollupManaLimit}`);
78
- sequencerManaLimit = rollupManaLimit;
79
- }
83
+ const globalsBuilder = new GlobalVariableBuilder({
84
+ ...config,
85
+ l1GenesisTime,
86
+ slotDuration: Number(slotDuration),
87
+ ethereumSlotDuration,
88
+ rollupVersion
89
+ });
80
90
  // When running in anvil, assume we can post a tx up until one second before the end of an L1 slot.
81
- // Otherwise, assume we must have broadcasted the tx before the slot started (we use a default
82
- // maxL1TxInclusionTimeIntoSlot of zero) to get the tx into that L1 slot.
91
+ // Otherwise, we need the full L1 slot duration for publishing to ensure inclusion.
83
92
  // In theory, the L1 slot has an initial 4s phase where the block is propagated, so we could
84
- // make it with a propagation time into slot equal to 4s. However, we prefer being conservative.
93
+ // reduce the publishing time allowance. However, we prefer being conservative.
85
94
  // See https://www.blocknative.com/blog/anatomy-of-a-slot#7 for more info.
86
- const maxL1TxInclusionTimeIntoSlot = config.maxL1TxInclusionTimeIntoSlot ?? isAnvilTestChain(config.l1ChainId) ? ethereumSlotDuration - 1 : 0;
95
+ const l1PublishingTimeBasedOnChain = isAnvilTestChain(config.l1ChainId) ? 1 : ethereumSlotDuration;
96
+ const l1PublishingTime = config.l1PublishingTime ?? l1PublishingTimeBasedOnChain;
97
+ const { maxL2BlockGas, maxDABlockGas, maxTxsPerBlock } = capPerBlockLimits(config, rollupManaLimit, log);
87
98
  const l1Constants = {
88
99
  l1GenesisTime,
89
100
  slotDuration: Number(slotDuration),
90
- ethereumSlotDuration
101
+ ethereumSlotDuration,
102
+ rollupManaLimit
91
103
  };
92
- const sequencer = new Sequencer(publisherFactory, validatorClient, globalsBuilder, p2pClient, worldStateSynchronizer, slasherClient, l2BlockSource, l1ToL2MessageSource, blockBuilder, l1Constants, deps.dateProvider, epochCache, rollupContract, {
104
+ const sequencer = new Sequencer(publisherFactory, validatorClient, globalsBuilder, p2pClient, worldStateSynchronizer, slasherClient, l2BlockSource, l1ToL2MessageSource, checkpointsBuilder, l1Constants, deps.dateProvider, epochCache, rollupContract, {
93
105
  ...config,
94
- maxL1TxInclusionTimeIntoSlot,
95
- maxL2BlockGas: sequencerManaLimit
106
+ l1PublishingTime,
107
+ maxL2BlockGas,
108
+ maxDABlockGas,
109
+ maxTxsPerBlock
96
110
  }, telemetryClient, log);
97
- await sequencer.init();
98
- return new SequencerClient(publisherManager, sequencer, blockBuilder, validatorClient, l1Metrics);
111
+ sequencer.init();
112
+ // Extract the shared delayer from the first L1TxUtils instance (all instances share the same delayer)
113
+ const delayer = l1TxUtils[0]?.delayer;
114
+ return new SequencerClient(publisherManager, sequencer, checkpointsBuilder, validatorClient, l1Metrics, delayer);
99
115
  }
100
116
  /**
101
117
  * Updates sequencer and validator client config.
102
118
  * @param config - New parameters.
103
119
  */ updateConfig(config) {
104
120
  this.sequencer.updateConfig(config);
105
- this.blockBuilder.updateConfig(config);
121
+ this.checkpointsBuilder.updateConfig(config);
106
122
  this.validatorClient?.updateConfig(config);
107
123
  }
108
124
  /** Starts the sequencer. */ async start() {
@@ -122,6 +138,12 @@ import { Sequencer } from '../sequencer/index.js';
122
138
  getSequencer() {
123
139
  return this.sequencer;
124
140
  }
141
+ /** Updates the publisher factory's node keystore adapter after a keystore reload. */ updatePublisherNodeKeyStore(adapter) {
142
+ this.sequencer.updatePublisherNodeKeyStore(adapter);
143
+ }
144
+ /** Returns the shared tx delayer for sequencer L1 txs, if enabled. Test-only. */ getDelayer() {
145
+ return this.delayer_;
146
+ }
125
147
  get validatorAddresses() {
126
148
  return this.sequencer.getValidatorAddresses();
127
149
  }
@@ -129,3 +151,28 @@ import { Sequencer } from '../sequencer/index.js';
129
151
  return this.sequencer.maxL2BlockGas;
130
152
  }
131
153
  }
154
+ /**
155
+ * Caps operator-provided per-block limits at checkpoint-level limits.
156
+ * Returns undefined for any limit the operator didn't set — the checkpoint builder handles redistribution.
157
+ */ function capPerBlockLimits(config, rollupManaLimit, log) {
158
+ let maxL2BlockGas = config.maxL2BlockGas;
159
+ if (maxL2BlockGas !== undefined && maxL2BlockGas > rollupManaLimit) {
160
+ log.warn(`Provided MAX_L2_BLOCK_GAS ${maxL2BlockGas} exceeds rollup mana limit ${rollupManaLimit} (capping)`);
161
+ maxL2BlockGas = rollupManaLimit;
162
+ }
163
+ let maxDABlockGas = config.maxDABlockGas;
164
+ if (maxDABlockGas !== undefined && maxDABlockGas > MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT) {
165
+ log.warn(`Provided MAX_DA_BLOCK_GAS ${maxDABlockGas} exceeds DA checkpoint limit ${MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT} (capping)`);
166
+ maxDABlockGas = MAX_PROCESSABLE_DA_GAS_PER_CHECKPOINT;
167
+ }
168
+ let maxTxsPerBlock = config.maxTxsPerBlock;
169
+ if (maxTxsPerBlock !== undefined && config.maxTxsPerCheckpoint !== undefined && maxTxsPerBlock > config.maxTxsPerCheckpoint) {
170
+ log.warn(`Provided MAX_TX_PER_BLOCK ${maxTxsPerBlock} exceeds MAX_TX_PER_CHECKPOINT ${config.maxTxsPerCheckpoint} (capping)`);
171
+ maxTxsPerBlock = config.maxTxsPerCheckpoint;
172
+ }
173
+ return {
174
+ maxL2BlockGas,
175
+ maxDABlockGas,
176
+ maxTxsPerBlock
177
+ };
178
+ }
package/dest/config.d.ts CHANGED
@@ -1,21 +1,47 @@
1
- import { type L1ContractsConfig, type L1ReaderConfig } from '@aztec/ethereum';
1
+ import { type L1ContractsConfig } from '@aztec/ethereum/config';
2
+ import { type L1ReaderConfig } from '@aztec/ethereum/l1-reader';
2
3
  import { type ConfigMappingsType } from '@aztec/foundation/config';
3
- import { type KeyStoreConfig } from '@aztec/node-keystore';
4
- import { type P2PConfig } from '@aztec/p2p';
5
- import { type ChainConfig, type SequencerConfig } from '@aztec/stdlib/config';
6
- import { type ValidatorClientConfig } from '@aztec/validator-client';
7
- import { type PublisherConfig, type TxSenderConfig } from './publisher/config.js';
4
+ import { type KeyStoreConfig } from '@aztec/node-keystore/config';
5
+ import { type P2PConfig } from '@aztec/p2p/config';
6
+ import { type ChainConfig, type PipelineConfig, 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';
8
9
  export * from './publisher/config.js';
9
10
  export type { SequencerConfig };
10
- export declare const DEFAULT_ATTESTATION_PROPAGATION_TIME = 2;
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
+ };
11
37
  /**
12
38
  * Configuration settings for the SequencerClient.
13
39
  */
14
- export type SequencerClientConfig = PublisherConfig & KeyStoreConfig & ValidatorClientConfig & TxSenderConfig & SequencerConfig & L1ReaderConfig & ChainConfig & Pick<P2PConfig, 'txPublicSetupAllowList'> & Pick<L1ContractsConfig, 'ethereumSlotDuration' | 'aztecSlotDuration' | 'aztecEpochDuration'>;
40
+ export type SequencerClientConfig = SequencerPublisherConfig & KeyStoreConfig & ValidatorClientConfig & SequencerTxSenderConfig & SequencerConfig & L1ReaderConfig & ChainConfig & PipelineConfig & Pick<P2PConfig, 'txPublicSetupAllowListExtend'> & Pick<L1ContractsConfig, 'ethereumSlotDuration' | 'aztecSlotDuration' | 'aztecEpochDuration'>;
15
41
  export declare const sequencerConfigMappings: ConfigMappingsType<SequencerConfig>;
16
42
  export declare const sequencerClientConfigMappings: ConfigMappingsType<SequencerClientConfig>;
17
43
  /**
18
44
  * Creates an instance of SequencerClientConfig out of environment variables using sensible defaults for integration testing if not set.
19
45
  */
20
46
  export declare function getConfigEnvVars(): SequencerClientConfig;
21
- //# sourceMappingURL=config.d.ts.map
47
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlnLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvY29uZmlnLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxLQUFLLGlCQUFpQixFQUE2QixNQUFNLHdCQUF3QixDQUFDO0FBQzNGLE9BQU8sRUFBRSxLQUFLLGNBQWMsRUFBMEIsTUFBTSwyQkFBMkIsQ0FBQztBQUN4RixPQUFPLEVBQ0wsS0FBSyxrQkFBa0IsRUFLeEIsTUFBTSwwQkFBMEIsQ0FBQztBQUVsQyxPQUFPLEVBQUUsS0FBSyxjQUFjLEVBQTBCLE1BQU0sNkJBQTZCLENBQUM7QUFDMUYsT0FBTyxFQUFFLEtBQUssU0FB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AAkB,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,cAAc,EACnB,KAAK,eAAe,EAIrB,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,cAAc,GACd,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,CAgKvE,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,kBAAkB,CAAC,qBAAqB,CAUnF,CAAC;AAEF;;GAEG;AACH,wBAAgB,gBAAgB,IAAI,qBAAqB,CAExD"}
package/dest/config.js CHANGED
@@ -1,44 +1,83 @@
1
- import { l1ContractsConfigMappings, l1ReaderConfigMappings } from '@aztec/ethereum';
1
+ import { l1ContractsConfigMappings } from '@aztec/ethereum/config';
2
+ import { l1ReaderConfigMappings } from '@aztec/ethereum/l1-reader';
2
3
  import { booleanConfigHelper, getConfigFromMappings, numberConfigHelper, pickConfigMappings } from '@aztec/foundation/config';
3
4
  import { EthAddress } from '@aztec/foundation/eth-address';
4
- import { keyStoreConfigMappings } from '@aztec/node-keystore';
5
- import { p2pConfigMappings } from '@aztec/p2p';
5
+ import { keyStoreConfigMappings } from '@aztec/node-keystore/config';
6
+ import { p2pConfigMappings } from '@aztec/p2p/config';
6
7
  import { AztecAddress } from '@aztec/stdlib/aztec-address';
7
- import { chainConfigMappings } from '@aztec/stdlib/config';
8
- import { validatorClientConfigMappings } from '@aztec/validator-client';
9
- import { getPublisherConfigMappings, getTxSenderConfigMappings } from './publisher/config.js';
8
+ import { chainConfigMappings, pipelineConfigMappings, sharedSequencerConfigMappings } from '@aztec/stdlib/config';
9
+ import { DEFAULT_P2P_PROPAGATION_TIME } from '@aztec/stdlib/timetable';
10
+ import { validatorClientConfigMappings } from '@aztec/validator-client/config';
11
+ import { sequencerPublisherConfigMappings, sequencerTxSenderConfigMappings } from './publisher/config.js';
10
12
  export * from './publisher/config.js';
11
- export const DEFAULT_ATTESTATION_PROPAGATION_TIME = 2;
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
+ };
12
38
  export const sequencerConfigMappings = {
13
- transactionPollingIntervalMS: {
14
- env: 'SEQ_TX_POLLING_INTERVAL_MS',
15
- description: 'The number of ms to wait between polling for pending txs.',
16
- ...numberConfigHelper(500)
17
- },
18
- maxTxsPerBlock: {
19
- env: 'SEQ_MAX_TX_PER_BLOCK',
20
- description: 'The maximum number of txs to include in a block.',
21
- ...numberConfigHelper(32)
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
22
48
  },
23
49
  minTxsPerBlock: {
24
50
  env: 'SEQ_MIN_TX_PER_BLOCK',
25
51
  description: 'The minimum number of txs to include in a block.',
26
- ...numberConfigHelper(1)
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.'
27
56
  },
28
57
  publishTxsWithProposals: {
29
58
  env: 'SEQ_PUBLISH_TXS_WITH_PROPOSALS',
30
59
  description: 'Whether to publish txs with proposals.',
31
- ...booleanConfigHelper(false)
60
+ ...booleanConfigHelper(DefaultSequencerConfig.publishTxsWithProposals)
32
61
  },
33
62
  maxL2BlockGas: {
34
63
  env: 'SEQ_MAX_L2_BLOCK_GAS',
35
64
  description: 'The maximum L2 block gas.',
36
- ...numberConfigHelper(10e9)
65
+ parseEnv: (val)=>val ? parseInt(val, 10) : undefined
37
66
  },
38
67
  maxDABlockGas: {
39
68
  env: 'SEQ_MAX_DA_BLOCK_GAS',
40
69
  description: 'The maximum DA block gas.',
41
- ...numberConfigHelper(10e9)
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)
42
81
  },
43
82
  coinbase: {
44
83
  env: 'COINBASE',
@@ -58,64 +97,95 @@ export const sequencerConfigMappings = {
58
97
  env: 'ACVM_BINARY_PATH',
59
98
  description: 'The path to the ACVM binary'
60
99
  },
61
- maxBlockSizeInBytes: {
62
- env: 'SEQ_MAX_BLOCK_SIZE_IN_BYTES',
63
- description: 'Max block size',
64
- ...numberConfigHelper(1024 * 1024)
65
- },
66
100
  enforceTimeTable: {
67
101
  env: 'SEQ_ENFORCE_TIME_TABLE',
68
102
  description: 'Whether to enforce the time table when building blocks',
69
- ...booleanConfigHelper(),
70
- defaultValue: true
103
+ ...booleanConfigHelper(DefaultSequencerConfig.enforceTimeTable)
71
104
  },
72
105
  governanceProposerPayload: {
73
106
  env: 'GOVERNANCE_PROPOSER_PAYLOAD_ADDRESS',
74
107
  description: 'The address of the payload for the governanceProposer',
75
- parseEnv: (val)=>EthAddress.fromString(val),
76
- defaultValue: EthAddress.ZERO
108
+ parseEnv: (val)=>EthAddress.fromString(val)
77
109
  },
78
- maxL1TxInclusionTimeIntoSlot: {
79
- env: 'SEQ_MAX_L1_TX_INCLUSION_TIME_INTO_SLOT',
80
- description: 'How many seconds into an L1 slot we can still send a tx and get it mined.',
110
+ l1PublishingTime: {
111
+ env: 'SEQ_L1_PUBLISHING_TIME_ALLOWANCE_IN_SLOT',
112
+ description: 'How much time (in seconds) we allow in the slot for publishing the L1 tx (defaults to 1 L1 slot).',
81
113
  parseEnv: (val)=>val ? parseInt(val, 10) : undefined
82
114
  },
83
115
  attestationPropagationTime: {
84
116
  env: 'SEQ_ATTESTATION_PROPAGATION_TIME',
85
117
  description: 'How many seconds it takes for proposals and attestations to travel across the p2p layer (one-way)',
86
- ...numberConfigHelper(DEFAULT_ATTESTATION_PROPAGATION_TIME)
118
+ ...numberConfigHelper(DefaultSequencerConfig.attestationPropagationTime)
87
119
  },
88
120
  fakeProcessingDelayPerTxMs: {
89
121
  description: 'Used for testing to introduce a fake delay after processing each tx'
90
122
  },
123
+ fakeThrowAfterProcessingTxCount: {
124
+ description: 'Used for testing to throw an error after processing N txs'
125
+ },
91
126
  secondsBeforeInvalidatingBlockAsCommitteeMember: {
92
127
  env: 'SEQ_SECONDS_BEFORE_INVALIDATING_BLOCK_AS_COMMITTEE_MEMBER',
93
128
  description: 'How many seconds to wait before trying to invalidate a block from the pending chain as a committee member (zero to never invalidate).' + ' The next proposer is expected to invalidate, so the committee acts as a fallback.',
94
- ...numberConfigHelper(144)
129
+ ...numberConfigHelper(DefaultSequencerConfig.secondsBeforeInvalidatingBlockAsCommitteeMember)
95
130
  },
96
131
  secondsBeforeInvalidatingBlockAsNonCommitteeMember: {
97
132
  env: 'SEQ_SECONDS_BEFORE_INVALIDATING_BLOCK_AS_NON_COMMITTEE_MEMBER',
98
133
  description: 'How many seconds to wait before trying to invalidate a block from the pending chain as a non-committee member (zero to never invalidate).' + ' The next proposer is expected to invalidate, then the committee, so other sequencers act as a fallback.',
99
- ...numberConfigHelper(432)
134
+ ...numberConfigHelper(DefaultSequencerConfig.secondsBeforeInvalidatingBlockAsNonCommitteeMember)
100
135
  },
101
136
  skipCollectingAttestations: {
102
137
  description: 'Whether to skip collecting attestations from validators and only use self-attestations (for testing only)',
103
- ...booleanConfigHelper(false)
138
+ ...booleanConfigHelper(DefaultSequencerConfig.skipCollectingAttestations)
104
139
  },
105
140
  skipInvalidateBlockAsProposer: {
106
141
  description: 'Do not invalidate the previous block if invalid when we are the proposer (for testing only)',
107
- ...booleanConfigHelper(false)
142
+ ...booleanConfigHelper(DefaultSequencerConfig.skipInvalidateBlockAsProposer)
108
143
  },
109
144
  broadcastInvalidBlockProposal: {
110
145
  description: 'Broadcast invalid block proposals with corrupted state (for testing only)',
111
- ...booleanConfigHelper(false)
146
+ ...booleanConfigHelper(DefaultSequencerConfig.broadcastInvalidBlockProposal)
112
147
  },
113
148
  injectFakeAttestation: {
114
149
  description: 'Inject a fake attestation (for testing only)',
115
- ...booleanConfigHelper(false)
150
+ ...booleanConfigHelper(DefaultSequencerConfig.injectFakeAttestation)
151
+ },
152
+ injectHighSValueAttestation: {
153
+ description: 'Inject a malleable attestation with a high-s value (for testing only)',
154
+ ...booleanConfigHelper(DefaultSequencerConfig.injectHighSValueAttestation)
155
+ },
156
+ injectUnrecoverableSignatureAttestation: {
157
+ description: 'Inject an attestation with an unrecoverable signature (for testing only)',
158
+ ...booleanConfigHelper(DefaultSequencerConfig.injectUnrecoverableSignatureAttestation)
159
+ },
160
+ fishermanMode: {
161
+ env: 'FISHERMAN_MODE',
162
+ description: 'Whether to run in fisherman mode: builds blocks on every slot for validation without publishing to L1',
163
+ ...booleanConfigHelper(DefaultSequencerConfig.fishermanMode)
164
+ },
165
+ shuffleAttestationOrdering: {
166
+ description: 'Shuffle attestation ordering to create invalid ordering (for testing only)',
167
+ ...booleanConfigHelper(DefaultSequencerConfig.shuffleAttestationOrdering)
168
+ },
169
+ ...sharedSequencerConfigMappings,
170
+ buildCheckpointIfEmpty: {
171
+ env: 'SEQ_BUILD_CHECKPOINT_IF_EMPTY',
172
+ description: 'Have sequencer build and publish an empty checkpoint if there are no txs',
173
+ ...booleanConfigHelper(DefaultSequencerConfig.buildCheckpointIfEmpty)
174
+ },
175
+ skipPushProposedBlocksToArchiver: {
176
+ description: 'Skip pushing proposed blocks to archiver (default: true)',
177
+ ...booleanConfigHelper(DefaultSequencerConfig.skipPushProposedBlocksToArchiver)
178
+ },
179
+ minBlocksForCheckpoint: {
180
+ description: 'Minimum number of blocks required for a checkpoint proposal (test only)'
181
+ },
182
+ skipPublishingCheckpointsPercent: {
183
+ env: 'SEQ_SKIP_CHECKPOINT_PUBLISH_PERCENT',
184
+ description: 'Percent probability (0 - 100) of sequencer skipping checkpoint publishing (testing only)',
185
+ ...numberConfigHelper(DefaultSequencerConfig.skipPublishingCheckpointsPercent)
116
186
  },
117
187
  ...pickConfigMappings(p2pConfigMappings, [
118
- 'txPublicSetupAllowList'
188
+ 'txPublicSetupAllowListExtend'
119
189
  ])
120
190
  };
121
191
  export const sequencerClientConfigMappings = {
@@ -123,9 +193,10 @@ export const sequencerClientConfigMappings = {
123
193
  ...sequencerConfigMappings,
124
194
  ...keyStoreConfigMappings,
125
195
  ...l1ReaderConfigMappings,
126
- ...getTxSenderConfigMappings('SEQ'),
127
- ...getPublisherConfigMappings('SEQ'),
196
+ ...sequencerTxSenderConfigMappings,
197
+ ...sequencerPublisherConfigMappings,
128
198
  ...chainConfigMappings,
199
+ ...pipelineConfigMappings,
129
200
  ...pickConfigMappings(l1ContractsConfigMappings, [
130
201
  'ethereumSlotDuration',
131
202
  'aztecSlotDuration',