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

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 (153) hide show
  1. package/README.md +281 -21
  2. package/dest/client/index.d.ts +1 -1
  3. package/dest/client/sequencer-client.d.ts +26 -16
  4. package/dest/client/sequencer-client.d.ts.map +1 -1
  5. package/dest/client/sequencer-client.js +78 -37
  6. package/dest/config.d.ts +37 -8
  7. package/dest/config.d.ts.map +1 -1
  8. package/dest/config.js +139 -48
  9. package/dest/global_variable_builder/fee_predictor.d.ts +37 -0
  10. package/dest/global_variable_builder/fee_predictor.d.ts.map +1 -0
  11. package/dest/global_variable_builder/fee_predictor.js +128 -0
  12. package/dest/global_variable_builder/fee_provider.d.ts +21 -0
  13. package/dest/global_variable_builder/fee_provider.d.ts.map +1 -0
  14. package/dest/global_variable_builder/fee_provider.js +58 -0
  15. package/dest/global_variable_builder/global_builder.d.ts +24 -20
  16. package/dest/global_variable_builder/global_builder.d.ts.map +1 -1
  17. package/dest/global_variable_builder/global_builder.js +44 -65
  18. package/dest/global_variable_builder/index.d.ts +4 -2
  19. package/dest/global_variable_builder/index.d.ts.map +1 -1
  20. package/dest/global_variable_builder/index.js +2 -0
  21. package/dest/index.d.ts +2 -3
  22. package/dest/index.d.ts.map +1 -1
  23. package/dest/index.js +1 -2
  24. package/dest/publisher/config.d.ts +55 -20
  25. package/dest/publisher/config.d.ts.map +1 -1
  26. package/dest/publisher/config.js +124 -34
  27. package/dest/publisher/index.d.ts +2 -1
  28. package/dest/publisher/index.d.ts.map +1 -1
  29. package/dest/publisher/l1_tx_failed_store/factory.d.ts +11 -0
  30. package/dest/publisher/l1_tx_failed_store/factory.d.ts.map +1 -0
  31. package/dest/publisher/l1_tx_failed_store/factory.js +22 -0
  32. package/dest/publisher/l1_tx_failed_store/failed_tx_store.d.ts +58 -0
  33. package/dest/publisher/l1_tx_failed_store/failed_tx_store.d.ts.map +1 -0
  34. package/dest/publisher/l1_tx_failed_store/failed_tx_store.js +1 -0
  35. package/dest/publisher/l1_tx_failed_store/file_store_failed_tx_store.d.ts +15 -0
  36. package/dest/publisher/l1_tx_failed_store/file_store_failed_tx_store.d.ts.map +1 -0
  37. package/dest/publisher/l1_tx_failed_store/file_store_failed_tx_store.js +34 -0
  38. package/dest/publisher/l1_tx_failed_store/index.d.ts +4 -0
  39. package/dest/publisher/l1_tx_failed_store/index.d.ts.map +1 -0
  40. package/dest/publisher/l1_tx_failed_store/index.js +2 -0
  41. package/dest/publisher/sequencer-bundle-simulator.d.ts +96 -0
  42. package/dest/publisher/sequencer-bundle-simulator.d.ts.map +1 -0
  43. package/dest/publisher/sequencer-bundle-simulator.js +198 -0
  44. package/dest/publisher/sequencer-publisher-factory.d.ts +15 -8
  45. package/dest/publisher/sequencer-publisher-factory.d.ts.map +1 -1
  46. package/dest/publisher/sequencer-publisher-factory.js +28 -4
  47. package/dest/publisher/sequencer-publisher-metrics.d.ts +3 -3
  48. package/dest/publisher/sequencer-publisher-metrics.d.ts.map +1 -1
  49. package/dest/publisher/sequencer-publisher-metrics.js +23 -86
  50. package/dest/publisher/sequencer-publisher.d.ts +137 -97
  51. package/dest/publisher/sequencer-publisher.d.ts.map +1 -1
  52. package/dest/publisher/sequencer-publisher.js +1004 -416
  53. package/dest/sequencer/automine/automine_factory.d.ts +54 -0
  54. package/dest/sequencer/automine/automine_factory.d.ts.map +1 -0
  55. package/dest/sequencer/automine/automine_factory.js +84 -0
  56. package/dest/sequencer/automine/automine_sequencer.d.ts +151 -0
  57. package/dest/sequencer/automine/automine_sequencer.d.ts.map +1 -0
  58. package/dest/sequencer/automine/automine_sequencer.js +509 -0
  59. package/dest/sequencer/chain_state_overrides.d.ts +61 -0
  60. package/dest/sequencer/chain_state_overrides.d.ts.map +1 -0
  61. package/dest/sequencer/chain_state_overrides.js +98 -0
  62. package/dest/sequencer/checkpoint_proposal_job.d.ts +150 -0
  63. package/dest/sequencer/checkpoint_proposal_job.d.ts.map +1 -0
  64. package/dest/sequencer/checkpoint_proposal_job.js +1793 -0
  65. package/dest/sequencer/checkpoint_proposal_job_metrics.d.ts +34 -0
  66. package/dest/sequencer/checkpoint_proposal_job_metrics.d.ts.map +1 -0
  67. package/dest/sequencer/checkpoint_proposal_job_metrics.js +72 -0
  68. package/dest/sequencer/checkpoint_voter.d.ts +34 -0
  69. package/dest/sequencer/checkpoint_voter.d.ts.map +1 -0
  70. package/dest/sequencer/checkpoint_voter.js +106 -0
  71. package/dest/sequencer/config.d.ts +3 -2
  72. package/dest/sequencer/config.d.ts.map +1 -1
  73. package/dest/sequencer/errors.d.ts +1 -1
  74. package/dest/sequencer/errors.d.ts.map +1 -1
  75. package/dest/sequencer/events.d.ts +92 -0
  76. package/dest/sequencer/events.d.ts.map +1 -0
  77. package/dest/sequencer/events.js +1 -0
  78. package/dest/sequencer/index.d.ts +6 -2
  79. package/dest/sequencer/index.d.ts.map +1 -1
  80. package/dest/sequencer/index.js +5 -1
  81. package/dest/sequencer/metrics.d.ts +48 -4
  82. package/dest/sequencer/metrics.d.ts.map +1 -1
  83. package/dest/sequencer/metrics.js +257 -50
  84. package/dest/sequencer/sequencer.d.ts +175 -144
  85. package/dest/sequencer/sequencer.d.ts.map +1 -1
  86. package/dest/sequencer/sequencer.js +1022 -567
  87. package/dest/sequencer/timetable.d.ts +64 -16
  88. package/dest/sequencer/timetable.d.ts.map +1 -1
  89. package/dest/sequencer/timetable.js +154 -64
  90. package/dest/sequencer/types.d.ts +3 -0
  91. package/dest/sequencer/types.d.ts.map +1 -0
  92. package/dest/sequencer/types.js +1 -0
  93. package/dest/sequencer/utils.d.ts +14 -8
  94. package/dest/sequencer/utils.d.ts.map +1 -1
  95. package/dest/sequencer/utils.js +7 -4
  96. package/dest/test/index.d.ts +6 -7
  97. package/dest/test/index.d.ts.map +1 -1
  98. package/dest/test/mock_checkpoint_builder.d.ts +95 -0
  99. package/dest/test/mock_checkpoint_builder.d.ts.map +1 -0
  100. package/dest/test/mock_checkpoint_builder.js +231 -0
  101. package/dest/test/utils.d.ts +53 -0
  102. package/dest/test/utils.d.ts.map +1 -0
  103. package/dest/test/utils.js +105 -0
  104. package/package.json +32 -30
  105. package/src/client/sequencer-client.ts +105 -60
  106. package/src/config.ts +163 -57
  107. package/src/global_variable_builder/README.md +44 -0
  108. package/src/global_variable_builder/fee_predictor.ts +172 -0
  109. package/src/global_variable_builder/fee_provider.ts +75 -0
  110. package/src/global_variable_builder/global_builder.ts +63 -92
  111. package/src/global_variable_builder/index.ts +3 -1
  112. package/src/index.ts +5 -2
  113. package/src/publisher/config.ts +174 -51
  114. package/src/publisher/index.ts +3 -0
  115. package/src/publisher/l1_tx_failed_store/factory.ts +32 -0
  116. package/src/publisher/l1_tx_failed_store/failed_tx_store.ts +57 -0
  117. package/src/publisher/l1_tx_failed_store/file_store_failed_tx_store.ts +46 -0
  118. package/src/publisher/l1_tx_failed_store/index.ts +3 -0
  119. package/src/publisher/sequencer-bundle-simulator.ts +254 -0
  120. package/src/publisher/sequencer-publisher-factory.ts +45 -14
  121. package/src/publisher/sequencer-publisher-metrics.ts +19 -71
  122. package/src/publisher/sequencer-publisher.ts +798 -538
  123. package/src/sequencer/README.md +243 -0
  124. package/src/sequencer/automine/README.md +46 -0
  125. package/src/sequencer/automine/automine_factory.ts +145 -0
  126. package/src/sequencer/automine/automine_sequencer.ts +595 -0
  127. package/src/sequencer/chain_state_overrides.ts +162 -0
  128. package/src/sequencer/checkpoint_proposal_job.ts +1633 -0
  129. package/src/sequencer/checkpoint_proposal_job_metrics.ts +128 -0
  130. package/src/sequencer/checkpoint_voter.ts +119 -0
  131. package/src/sequencer/config.ts +2 -1
  132. package/src/sequencer/events.ts +76 -0
  133. package/src/sequencer/index.ts +5 -1
  134. package/src/sequencer/metrics.ts +330 -62
  135. package/src/sequencer/sequencer.ts +831 -748
  136. package/src/sequencer/timetable.ts +181 -81
  137. package/src/sequencer/types.ts +6 -0
  138. package/src/sequencer/utils.ts +18 -9
  139. package/src/test/index.ts +5 -6
  140. package/src/test/mock_checkpoint_builder.ts +323 -0
  141. package/src/test/utils.ts +185 -0
  142. package/dest/sequencer/block_builder.d.ts +0 -27
  143. package/dest/sequencer/block_builder.d.ts.map +0 -1
  144. package/dest/sequencer/block_builder.js +0 -130
  145. package/dest/tx_validator/nullifier_cache.d.ts +0 -14
  146. package/dest/tx_validator/nullifier_cache.d.ts.map +0 -1
  147. package/dest/tx_validator/nullifier_cache.js +0 -24
  148. package/dest/tx_validator/tx_validator_factory.d.ts +0 -17
  149. package/dest/tx_validator/tx_validator_factory.d.ts.map +0 -1
  150. package/dest/tx_validator/tx_validator_factory.js +0 -53
  151. package/src/sequencer/block_builder.ts +0 -218
  152. package/src/tx_validator/nullifier_cache.ts +0 -30
  153. package/src/tx_validator/tx_validator_factory.ts +0 -132
@@ -0,0 +1,128 @@
1
+ import { MAX_FEE_ASSET_PRICE_MODIFIER_BPS } from '@aztec/ethereum/contracts';
2
+ import { SlotNumber } from '@aztec/foundation/branded-types';
3
+ import { times } from '@aztec/foundation/collection';
4
+ import { getSlotAtNextL1Block, getTimestampForSlot } from '@aztec/stdlib/epoch-helpers';
5
+ import { FEE_ORACLE_LAG, GasFees, MIN_ETH_PER_FEE_ASSET, ManaUsageEstimate, computeExcessMana, computeManaMinFee } from '@aztec/stdlib/gas';
6
+ /**
7
+ * Predicts min fees for LAG upcoming slots based on the L1 oracle state.
8
+ * A new oracle update can activate at startSlot + LAG, so only the first LAG entries
9
+ * are guaranteed stable. Caches L1 queries per L1 block and recomputes predictions
10
+ * for each mana usage estimate.
11
+ */ export class FeePredictor {
12
+ rollupContract;
13
+ publicClient;
14
+ dateProvider;
15
+ cachedState;
16
+ cachedL1BlockNumber;
17
+ slotDuration;
18
+ l1GenesisTime;
19
+ ethereumSlotDuration;
20
+ constructor(rollupContract, publicClient, dateProvider, config){
21
+ this.rollupContract = rollupContract;
22
+ this.publicClient = publicClient;
23
+ this.dateProvider = dateProvider;
24
+ this.slotDuration = config.slotDuration;
25
+ this.l1GenesisTime = config.l1GenesisTime;
26
+ this.ethereumSlotDuration = config.ethereumSlotDuration;
27
+ }
28
+ /** Returns predicted min fees for each slot in the prediction window. */ async getPredictedMinFees(manaUsage) {
29
+ const state = await this.getState();
30
+ return this.computePredictions(state, manaUsage);
31
+ }
32
+ /** Fetches and caches rollup state. Refreshes when L1 block number advances. */ async getState() {
33
+ const blockNumber = await this.publicClient.getBlockNumber({
34
+ cacheTime: 0
35
+ });
36
+ if (this.cachedL1BlockNumber === undefined || blockNumber > this.cachedL1BlockNumber) {
37
+ this.cachedL1BlockNumber = blockNumber;
38
+ this.cachedState = this.fetchState(blockNumber);
39
+ }
40
+ return this.cachedState;
41
+ }
42
+ async fetchState(blockNumber) {
43
+ // Pin all non-constant queries to this L1 block number for a consistent snapshot.
44
+ const opts = {
45
+ blockNumber
46
+ };
47
+ // Cached constants don't need pinning
48
+ const [manaTarget, manaLimit, provingCostPerManaEth, epochDuration] = await Promise.all([
49
+ this.rollupContract.getManaTarget(),
50
+ this.rollupContract.getManaLimit(),
51
+ this.rollupContract.getProvingCostPerMana(),
52
+ this.rollupContract.getEpochDuration()
53
+ ]);
54
+ // First, compute the earliest possible nextSlot independently of the checkpoint, so we can
55
+ // evaluate pruneability at the prediction start timestamp instead of the current L1 block time.
56
+ // This avoids an epoch-boundary edge case where the effective parent differs between now and nextSlot.
57
+ const slotConfig = {
58
+ slotDuration: this.slotDuration,
59
+ l1GenesisTime: this.l1GenesisTime
60
+ };
61
+ const currentSlot = await this.rollupContract.getSlotNumber(opts);
62
+ const slotAtNextL1Block = getSlotAtNextL1Block(BigInt(this.dateProvider.nowInSeconds()), {
63
+ l1GenesisTime: this.l1GenesisTime,
64
+ slotDuration: this.slotDuration,
65
+ ethereumSlotDuration: this.ethereumSlotDuration
66
+ });
67
+ const preliminaryNextSlot = SlotNumber(Math.max(currentSlot, slotAtNextL1Block));
68
+ const nextSlotTimestamp = getTimestampForSlot(preliminaryNextSlot, slotConfig);
69
+ // Resolve the effective checkpoint at the prediction start timestamp
70
+ const lastCheckpoint = await this.rollupContract.getEffectivePendingCheckpoint(nextSlotTimestamp, opts);
71
+ const lastSlot = lastCheckpoint.slotNumber;
72
+ // Refine nextSlot: also account for the slot after the last checkpoint
73
+ const nextSlot = SlotNumber(Math.max(SlotNumber.add(lastSlot, 1), preliminaryNextSlot));
74
+ const feeHeader = lastCheckpoint.feeHeader;
75
+ const slotCount = FEE_ORACLE_LAG;
76
+ const timestamps = times(slotCount, (i)=>getTimestampForSlot(SlotNumber.add(nextSlot, i), slotConfig));
77
+ const l1FeesBySlot = await Promise.all(timestamps.map((ts)=>this.rollupContract.getL1FeesAt(ts, opts)));
78
+ return {
79
+ lastSlot,
80
+ excessMana: computeExcessMana(feeHeader.excessMana, feeHeader.manaUsed, manaTarget),
81
+ ethPerFeeAsset: feeHeader.ethPerFeeAsset,
82
+ manaTarget,
83
+ manaLimit,
84
+ provingCostPerManaEth,
85
+ epochDuration: BigInt(epochDuration),
86
+ l1FeesBySlot
87
+ };
88
+ }
89
+ /** Computes per-slot fee predictions given cached state and a mana usage assumption. */ computePredictions(state, manaUsage) {
90
+ const assumedManaUsed = this.getAssumedManaUsed(state, manaUsage);
91
+ const result = [];
92
+ let { excessMana } = state;
93
+ let { ethPerFeeAsset } = state;
94
+ // Slot 0: current state (next available slot after last checkpoint)
95
+ result.push(this.computeGasFees(state, excessMana, ethPerFeeAsset, state.l1FeesBySlot[0]));
96
+ // Slots 1..LAG-1: advance excessMana with the assumed mana usage per checkpoint,
97
+ // and decay ethPerFeeAsset by MAX_FEE_ASSET_PRICE_MODIFIER_BPS per slot for conservative estimates.
98
+ // Lower ethPerFeeAsset means higher fees in fee asset terms.
99
+ for(let i = 1; i < state.l1FeesBySlot.length; i++){
100
+ excessMana = computeExcessMana(excessMana, assumedManaUsed, state.manaTarget);
101
+ const decayed = ethPerFeeAsset * (10000n - MAX_FEE_ASSET_PRICE_MODIFIER_BPS) / 10000n;
102
+ ethPerFeeAsset = decayed < MIN_ETH_PER_FEE_ASSET ? MIN_ETH_PER_FEE_ASSET : decayed;
103
+ result.push(this.computeGasFees(state, excessMana, ethPerFeeAsset, state.l1FeesBySlot[i]));
104
+ }
105
+ return result;
106
+ }
107
+ getAssumedManaUsed(state, manaUsage) {
108
+ switch(manaUsage){
109
+ case ManaUsageEstimate.None:
110
+ return 0n;
111
+ case ManaUsageEstimate.Target:
112
+ return state.manaTarget;
113
+ case ManaUsageEstimate.Limit:
114
+ return state.manaLimit;
115
+ }
116
+ }
117
+ computeGasFees(state, excessMana, ethPerFeeAsset, l1Fees) {
118
+ return new GasFees(0, computeManaMinFee({
119
+ l1BaseFee: l1Fees.baseFee,
120
+ l1BlobFee: l1Fees.blobFee,
121
+ manaTarget: state.manaTarget,
122
+ epochDuration: state.epochDuration,
123
+ provingCostPerManaEth: state.provingCostPerManaEth,
124
+ excessMana,
125
+ ethPerFeeAsset
126
+ }));
127
+ }
128
+ }
@@ -0,0 +1,21 @@
1
+ import type { ViemPublicClient } from '@aztec/ethereum/types';
2
+ import type { DateProvider } from '@aztec/foundation/timer';
3
+ import { GasFees, ManaUsageEstimate } from '@aztec/stdlib/gas';
4
+ import type { FeeProvider } from '@aztec/stdlib/tx';
5
+ import type { GlobalVariableBuilderConfig } from './global_builder.js';
6
+ /** Provides current and predicted fee information based on on-chain state. */
7
+ export declare class FeeProviderImpl implements FeeProvider {
8
+ private readonly dateProvider;
9
+ private readonly publicClient;
10
+ private currentMinFees;
11
+ private currentL1BlockNumber;
12
+ private readonly rollupContract;
13
+ private readonly feePredictor;
14
+ private readonly ethereumSlotDuration;
15
+ private readonly l1GenesisTime;
16
+ constructor(dateProvider: DateProvider, publicClient: ViemPublicClient, config: GlobalVariableBuilderConfig);
17
+ private computeCurrentMinFees;
18
+ getCurrentMinFees(): Promise<GasFees>;
19
+ getPredictedMinFees(manaUsage?: ManaUsageEstimate): Promise<GasFees[]>;
20
+ }
21
+ //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AAO,CAAC,OAAO,EAAE,CAAC,CAE5E;CACF"}
@@ -0,0 +1,58 @@
1
+ import { RollupContract } from '@aztec/ethereum/contracts';
2
+ import { SlotNumber } from '@aztec/foundation/branded-types';
3
+ import { getNextL1SlotTimestamp } from '@aztec/stdlib/epoch-helpers';
4
+ import { GasFees, ManaUsageEstimate } from '@aztec/stdlib/gas';
5
+ import { FeePredictor } from './fee_predictor.js';
6
+ /** Provides current and predicted fee information based on on-chain state. */ export class FeeProviderImpl {
7
+ dateProvider;
8
+ publicClient;
9
+ currentMinFees;
10
+ currentL1BlockNumber;
11
+ rollupContract;
12
+ feePredictor;
13
+ ethereumSlotDuration;
14
+ l1GenesisTime;
15
+ constructor(dateProvider, publicClient, config){
16
+ this.dateProvider = dateProvider;
17
+ this.publicClient = publicClient;
18
+ this.currentMinFees = Promise.resolve(new GasFees(0, 0));
19
+ this.currentL1BlockNumber = undefined;
20
+ this.ethereumSlotDuration = config.ethereumSlotDuration;
21
+ this.l1GenesisTime = config.l1GenesisTime;
22
+ this.rollupContract = new RollupContract(this.publicClient, config.rollupAddress);
23
+ this.feePredictor = new FeePredictor(this.rollupContract, this.publicClient, this.dateProvider, {
24
+ slotDuration: config.slotDuration,
25
+ l1GenesisTime: config.l1GenesisTime,
26
+ ethereumSlotDuration: config.ethereumSlotDuration
27
+ });
28
+ }
29
+ /**
30
+ * Computes the "current" min fees, e.g., the price that you currently should pay to get include in the next block
31
+ * @returns Min fees for the next block
32
+ */ async computeCurrentMinFees() {
33
+ // Since this might be called in the middle of a slot where a block might have been published,
34
+ // we need to fetch the last block written, and estimate the earliest timestamp for the next block.
35
+ // The timestamp of that last block will act as a lower bound for the next block.
36
+ const lastCheckpoint = await this.rollupContract.getPendingCheckpoint();
37
+ const earliestTimestamp = await this.rollupContract.getTimestampForSlot(SlotNumber.fromBigInt(BigInt(lastCheckpoint.slotNumber) + 1n));
38
+ const nextEthTimestamp = getNextL1SlotTimestamp(this.dateProvider.nowInSeconds(), {
39
+ l1GenesisTime: this.l1GenesisTime,
40
+ ethereumSlotDuration: this.ethereumSlotDuration
41
+ });
42
+ const timestamp = earliestTimestamp > nextEthTimestamp ? earliestTimestamp : nextEthTimestamp;
43
+ return new GasFees(0, await this.rollupContract.getManaMinFeeAt(timestamp, true));
44
+ }
45
+ async getCurrentMinFees() {
46
+ // Get the current block number
47
+ const blockNumber = await this.publicClient.getBlockNumber();
48
+ // If the L1 block number has changed then chain a new promise to get the current min fees
49
+ if (this.currentL1BlockNumber === undefined || blockNumber > this.currentL1BlockNumber) {
50
+ this.currentL1BlockNumber = blockNumber;
51
+ this.currentMinFees = this.currentMinFees.then(()=>this.computeCurrentMinFees());
52
+ }
53
+ return this.currentMinFees;
54
+ }
55
+ getPredictedMinFees(manaUsage) {
56
+ return this.feePredictor.getPredictedMinFees(manaUsage ?? ManaUsageEstimate.Target);
57
+ }
58
+ }
@@ -1,37 +1,41 @@
1
- import { type L1ContractsConfig, type L1ReaderConfig } from '@aztec/ethereum';
1
+ import { type SimulationOverridesPlan } from '@aztec/ethereum/contracts';
2
+ import type { ViemPublicClient } from '@aztec/ethereum/types';
3
+ import { BlockNumber, SlotNumber } from '@aztec/foundation/branded-types';
2
4
  import type { EthAddress } from '@aztec/foundation/eth-address';
5
+ import type { DateProvider } from '@aztec/foundation/timer';
3
6
  import type { AztecAddress } from '@aztec/stdlib/aztec-address';
4
- import { GasFees } from '@aztec/stdlib/gas';
5
- import type { GlobalVariableBuilder as GlobalVariableBuilderInterface } from '@aztec/stdlib/tx';
7
+ import { type L1RollupConstants } from '@aztec/stdlib/epoch-helpers';
8
+ import type { CheckpointGlobalVariables, GlobalVariableBuilder as GlobalVariableBuilderInterface } from '@aztec/stdlib/tx';
6
9
  import { GlobalVariables } from '@aztec/stdlib/tx';
10
+ /** Configuration for the GlobalVariableBuilder (excludes L1 client config). */
11
+ export type GlobalVariableBuilderConfig = {
12
+ rollupAddress: EthAddress;
13
+ ethereumSlotDuration: number;
14
+ rollupVersion: bigint;
15
+ } & Pick<L1RollupConstants, 'slotDuration' | 'l1GenesisTime'>;
7
16
  /**
8
17
  * Simple global variables builder.
9
18
  */
10
19
  export declare class GlobalVariableBuilder implements GlobalVariableBuilderInterface {
11
- private log;
12
- private currentBaseFees;
13
- private currentL1BlockNumber;
14
- private readonly rollupContract;
20
+ private readonly dateProvider;
15
21
  private readonly publicClient;
22
+ private readonly rollupContract;
16
23
  private readonly ethereumSlotDuration;
17
- private chainId?;
18
- private version?;
19
- constructor(config: L1ReaderConfig & Pick<L1ContractsConfig, 'ethereumSlotDuration'>);
20
- /**
21
- * Computes the "current" base fees, e.g., the price that you currently should pay to get include in the next block
22
- * @returns Base fees for the next block
23
- */
24
- private computeCurrentBaseFees;
25
- getCurrentBaseFees(): Promise<GasFees>;
26
- getGlobalConstantVariables(): Promise<Pick<GlobalVariables, 'chainId' | 'version'>>;
24
+ private readonly aztecSlotDuration;
25
+ private readonly l1GenesisTime;
26
+ private chainId;
27
+ private version;
28
+ constructor(dateProvider: DateProvider, publicClient: ViemPublicClient, config: GlobalVariableBuilderConfig);
27
29
  /**
28
- * Simple builder of global variables that use the minimum time possible.
30
+ * Simple builder of global variables.
29
31
  * @param blockNumber - The block number to build global variables for.
30
32
  * @param coinbase - The address to receive block reward.
31
33
  * @param feeRecipient - The address to receive fees.
32
34
  * @param slotNumber - The slot number to use for the global variables, if undefined it will be calculated.
33
35
  * @returns The global variables for the given block number.
34
36
  */
35
- buildGlobalVariables(blockNumber: number, coinbase: EthAddress, feeRecipient: AztecAddress, slotNumber?: bigint): Promise<GlobalVariables>;
37
+ buildGlobalVariables(blockNumber: BlockNumber, coinbase: EthAddress, feeRecipient: AztecAddress, maybeSlot?: SlotNumber): Promise<GlobalVariables>;
38
+ /** Builds global variables that are constant throughout a checkpoint. */
39
+ buildCheckpointGlobalVariables(coinbase: EthAddress, feeRecipient: AztecAddress, slotNumber: SlotNumber, simulationOverridesPlan?: SimulationOverridesPlan): Promise<CheckpointGlobalVariables>;
36
40
  }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":["../../src/global_variable_builder/global_builder.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,iBAAiB,EACtB,KAAK,cAAc,EAIpB,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAGhE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,KAAK,EAAE,qBAAqB,IAAI,8BAA8B,EAAE,MAAM,kBAAkB,CAAC;AAChG,OAAO,EAAE,eAAe,EAAE,MAAM,kBAAkB,CAAC;AAInD;;GAEG;AACH,qBAAa,qBAAsB,YAAW,8BAA8B;IAC1E,OAAO,CAAC,GAAG,CAAqD;IAChE,OAAO,CAAC,eAAe,CAAwD;IAC/E,OAAO,CAAC,oBAAoB,CAAiC;IAE7D,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAiB;IAChD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAmB;IAChD,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAS;IAE9C,OAAO,CAAC,OAAO,CAAC,CAAK;IACrB,OAAO,CAAC,OAAO,CAAC,CAAK;gBAET,MAAM,EAAE,cAAc,GAAG,IAAI,CAAC,iBAAiB,EAAE,sBAAsB,CAAC;IAgBpF;;;OAGG;YACW,sBAAsB;IAavB,kBAAkB,IAAI,OAAO,CAAC,OAAO,CAAC;IAYtC,0BAA0B,IAAI,OAAO,CAAC,IAAI,CAAC,eAAe,EAAE,SAAS,GAAG,SAAS,CAAC,CAAC;IAUhG;;;;;;;OAOG;IACU,oBAAoB,CAC/B,WAAW,EAAE,MAAM,EACnB,QAAQ,EAAE,UAAU,EACpB,YAAY,EAAE,YAAY,EAC1B,UAAU,CAAC,EAAE,MAAM,GAClB,OAAO,CAAC,eAAe,CAAC;CA4B5B"}
1
+ {"version":3,"file":"global_builder.d.ts","sourceRoot":"","sources":["../../src/global_variable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MAAM,EAAE,2BAA2B,EAUpC;IAED;;;;;;;OAOG;IACU,oBAAoB,CAC/B,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,UAAU,EACpB,YAAY,EAAE,YAAY,EAC1B,SAAS,CAAC,EAAE,UAAU,GACrB,OAAO,CAAC,eAAe,CAAC,CAY1B;IAED,yEAAyE;IAC5D,8BAA8B,CACzC,QAAQ,EAAE,UAAU,EACpB,YAAY,EAAE,YAAY,EAC1B,UAAU,EAAE,UAAU,EACtB,uBAAuB,CAAC,EAAE,uBAAuB,GAChD,OAAO,CAAC,yBAAyB,CAAC,CAYpC;CACF"}
@@ -1,84 +1,63 @@
1
- import { RollupContract, createEthereumChain } from '@aztec/ethereum';
2
- import { Fr } from '@aztec/foundation/fields';
3
- import { createLogger } from '@aztec/foundation/log';
1
+ import { RollupContract, buildSimulationOverridesStateOverride } from '@aztec/ethereum/contracts';
2
+ import { Fr } from '@aztec/foundation/curves/bn254';
3
+ import { getNextL1SlotTimestamp, getTimestampForSlot } from '@aztec/stdlib/epoch-helpers';
4
4
  import { GasFees } from '@aztec/stdlib/gas';
5
5
  import { GlobalVariables } from '@aztec/stdlib/tx';
6
- import { createPublicClient, fallback, http } from 'viem';
7
6
  /**
8
7
  * Simple global variables builder.
9
8
  */ export class GlobalVariableBuilder {
10
- log = createLogger('sequencer:global_variable_builder');
11
- currentBaseFees = Promise.resolve(new GasFees(0, 0));
12
- currentL1BlockNumber = undefined;
13
- rollupContract;
9
+ dateProvider;
14
10
  publicClient;
11
+ rollupContract;
15
12
  ethereumSlotDuration;
13
+ aztecSlotDuration;
14
+ l1GenesisTime;
16
15
  chainId;
17
16
  version;
18
- constructor(config){
19
- const { l1RpcUrls, l1ChainId: chainId, l1Contracts } = config;
20
- const chain = createEthereumChain(l1RpcUrls, chainId);
17
+ constructor(dateProvider, publicClient, config){
18
+ this.dateProvider = dateProvider;
19
+ this.publicClient = publicClient;
20
+ this.version = new Fr(config.rollupVersion);
21
+ this.chainId = new Fr(this.publicClient.chain.id);
21
22
  this.ethereumSlotDuration = config.ethereumSlotDuration;
22
- this.publicClient = createPublicClient({
23
- chain: chain.chainInfo,
24
- transport: fallback(chain.rpcUrls.map((url)=>http(url))),
25
- pollingInterval: config.viemPollingIntervalMS
26
- });
27
- this.rollupContract = new RollupContract(this.publicClient, l1Contracts.rollupAddress);
28
- }
29
- /**
30
- * Computes the "current" base fees, e.g., the price that you currently should pay to get include in the next block
31
- * @returns Base fees for the next block
32
- */ async computeCurrentBaseFees() {
33
- // Since this might be called in the middle of a slot where a block might have been published,
34
- // we need to fetch the last block written, and estimate the earliest timestamp for the next block.
35
- // The timestamp of that last block will act as a lower bound for the next block.
36
- const lastBlock = await this.rollupContract.getBlock(await this.rollupContract.getBlockNumber());
37
- const earliestTimestamp = await this.rollupContract.getTimestampForSlot(lastBlock.slotNumber + 1n);
38
- const nextEthTimestamp = BigInt((await this.publicClient.getBlock()).timestamp + BigInt(this.ethereumSlotDuration));
39
- const timestamp = earliestTimestamp > nextEthTimestamp ? earliestTimestamp : nextEthTimestamp;
40
- return new GasFees(0, await this.rollupContract.getManaBaseFeeAt(timestamp, true));
41
- }
42
- async getCurrentBaseFees() {
43
- // Get the current block number
44
- const blockNumber = await this.publicClient.getBlockNumber();
45
- // If the L1 block number has changed then chain a new promise to get the current base fees
46
- if (this.currentL1BlockNumber === undefined || blockNumber > this.currentL1BlockNumber) {
47
- this.currentL1BlockNumber = blockNumber;
48
- this.currentBaseFees = this.currentBaseFees.then(()=>this.computeCurrentBaseFees());
49
- }
50
- return this.currentBaseFees;
51
- }
52
- async getGlobalConstantVariables() {
53
- if (!this.chainId) {
54
- this.chainId = new Fr(this.publicClient.chain.id);
55
- }
56
- if (!this.version) {
57
- this.version = new Fr(await this.rollupContract.getVersion());
58
- }
59
- return {
60
- chainId: this.chainId,
61
- version: this.version
62
- };
23
+ this.aztecSlotDuration = config.slotDuration;
24
+ this.l1GenesisTime = config.l1GenesisTime;
25
+ this.rollupContract = new RollupContract(this.publicClient, config.rollupAddress);
63
26
  }
64
27
  /**
65
- * Simple builder of global variables that use the minimum time possible.
28
+ * Simple builder of global variables.
66
29
  * @param blockNumber - The block number to build global variables for.
67
30
  * @param coinbase - The address to receive block reward.
68
31
  * @param feeRecipient - The address to receive fees.
69
32
  * @param slotNumber - The slot number to use for the global variables, if undefined it will be calculated.
70
33
  * @returns The global variables for the given block number.
71
- */ async buildGlobalVariables(blockNumber, coinbase, feeRecipient, slotNumber) {
72
- const { chainId, version } = await this.getGlobalConstantVariables();
73
- if (slotNumber === undefined) {
74
- const ts = BigInt((await this.publicClient.getBlock()).timestamp + BigInt(this.ethereumSlotDuration));
75
- slotNumber = await this.rollupContract.getSlotAt(ts);
76
- }
77
- const timestamp = await this.rollupContract.getTimestampForSlot(slotNumber);
78
- const slotFr = new Fr(slotNumber);
79
- // We can skip much of the logic in getCurrentBaseFees since it we already check that we are not within a slot elsewhere.
80
- const gasFees = new GasFees(0, await this.rollupContract.getManaBaseFeeAt(timestamp, true));
81
- const globalVariables = new GlobalVariables(chainId, version, blockNumber, slotFr, timestamp, coinbase, feeRecipient, gasFees);
82
- return globalVariables;
34
+ */ async buildGlobalVariables(blockNumber, coinbase, feeRecipient, maybeSlot) {
35
+ const slot = maybeSlot ?? await this.rollupContract.getSlotAt(getNextL1SlotTimestamp(this.dateProvider.nowInSeconds(), {
36
+ l1GenesisTime: this.l1GenesisTime,
37
+ ethereumSlotDuration: this.ethereumSlotDuration
38
+ }));
39
+ const checkpointGlobalVariables = await this.buildCheckpointGlobalVariables(coinbase, feeRecipient, slot);
40
+ return GlobalVariables.from({
41
+ blockNumber,
42
+ ...checkpointGlobalVariables
43
+ });
44
+ }
45
+ /** Builds global variables that are constant throughout a checkpoint. */ async buildCheckpointGlobalVariables(coinbase, feeRecipient, slotNumber, simulationOverridesPlan) {
46
+ const { chainId, version } = this;
47
+ const timestamp = getTimestampForSlot(slotNumber, {
48
+ slotDuration: this.aztecSlotDuration,
49
+ l1GenesisTime: this.l1GenesisTime
50
+ });
51
+ const stateOverride = await buildSimulationOverridesStateOverride(this.rollupContract, simulationOverridesPlan);
52
+ const gasFees = new GasFees(0, await this.rollupContract.getManaMinFeeAt(timestamp, true, stateOverride));
53
+ return {
54
+ chainId,
55
+ version,
56
+ slotNumber,
57
+ timestamp,
58
+ coinbase,
59
+ feeRecipient,
60
+ gasFees
61
+ };
83
62
  }
84
63
  }
@@ -1,2 +1,4 @@
1
- export { GlobalVariableBuilder } from './global_builder.js';
2
- //# sourceMappingURL=index.d.ts.map
1
+ export { FeeProviderImpl } from './fee_provider.js';
2
+ export { GlobalVariableBuilder, type GlobalVariableBuilderConfig } from './global_builder.js';
3
+ export { FeePredictor } from './fee_predictor.js';
4
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9nbG9iYWxfdmFyaWFibGVfYnVpbGRlci9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsZUFBZSxFQUFFLE1BQU0sbUJBQW1CLENBQUM7QUFDcEQsT0FBTyxFQUFFLHFCQUFxQixFQUFFLEtBQUssMkJBQTJCLEVBQUUsTUFBTSxxQkFBcUIsQ0FBQztBQUM5RixPQUFPLEVBQUUsWUFBWSxFQUFFLE1BQU0sb0JBQW9CLENBQUMifQ==
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/global_variable_builder/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,qBAAqB,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/global_variable_builder/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AACpD,OAAO,EAAE,qBAAqB,EAAE,KAAK,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AAC9F,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC"}
@@ -1 +1,3 @@
1
+ export { FeeProviderImpl } from './fee_provider.js';
1
2
  export { GlobalVariableBuilder } from './global_builder.js';
3
+ export { FeePredictor } from './fee_predictor.js';
package/dest/index.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  export * from './client/index.js';
2
2
  export * from './config.js';
3
3
  export * from './publisher/index.js';
4
- export { FullNodeBlockBuilder as BlockBuilder, Sequencer, SequencerState, type SequencerEvents, } from './sequencer/index.js';
5
- export * from './tx_validator/tx_validator_factory.js';
4
+ export { AutomineSequencer, type AutomineSequencerConstants, type AutomineSequencerDeps, createAutomineSequencer, type CreateAutomineSequencerArgs, Sequencer, SequencerState, type SequencerEvents, } from './sequencer/index.js';
6
5
  export * from './global_variable_builder/index.js';
7
- //# sourceMappingURL=index.d.ts.map
6
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLG1CQUFtQixDQUFDO0FBQ2xDLGNBQWMsYUFBYSxDQUFDO0FBQzVCLGNBQWMsc0JBQXNCLENBQUM7QUFDckMsT0FBTyxFQUNMLGlCQUFpQixFQUNqQixLQUFLLDBCQUEwQixFQUMvQixLQUFLLHFCQUFxQixFQUMxQix1QkFBdUIsRUFDdkIsS0FBSywyQkFBMkIsRUFDaEMsU0FBUyxFQUNULGNBQWMsRUFDZCxLQUFLLGVBQWUsR0FDckIsTUFBTSxzQkFBc0IsQ0FBQztBQUk5QixjQUFjLG9DQUFvQyxDQUFDIn0=
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,OAAO,EACL,oBAAoB,IAAI,YAAY,EACpC,SAAS,EACT,cAAc,EACd,KAAK,eAAe,GACrB,MAAM,sBAAsB,CAAC;AAC9B,cAAc,wCAAwC,CAAC;AAIvD,cAAc,oCAAoC,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,OAAO,EACL,iBAAiB,EACjB,KAAK,0BAA0B,EAC/B,KAAK,qBAAqB,EAC1B,uBAAuB,EACvB,KAAK,2BAA2B,EAChC,SAAS,EACT,cAAc,EACd,KAAK,eAAe,GACrB,MAAM,sBAAsB,CAAC;AAI9B,cAAc,oCAAoC,CAAC"}
package/dest/index.js CHANGED
@@ -1,8 +1,7 @@
1
1
  export * from './client/index.js';
2
2
  export * from './config.js';
3
3
  export * from './publisher/index.js';
4
- export { FullNodeBlockBuilder as BlockBuilder, Sequencer, SequencerState } from './sequencer/index.js';
5
- export * from './tx_validator/tx_validator_factory.js';
4
+ export { AutomineSequencer, createAutomineSequencer, Sequencer, SequencerState } from './sequencer/index.js';
6
5
  // Used by the node to simulate public parts of transactions. Should these be moved to a shared library?
7
6
  // ISSUE(#9832)
8
7
  export * from './global_variable_builder/index.js';
@@ -1,29 +1,64 @@
1
- import { type BlobSinkConfig } from '@aztec/blob-sink/client';
2
- import { type L1ReaderConfig, type L1TxUtilsConfig } from '@aztec/ethereum';
1
+ import { type BlobClientConfig } from '@aztec/blob-client/client/config';
2
+ import { type L1ReaderConfig } from '@aztec/ethereum/l1-reader';
3
+ import { type L1TxUtilsConfig } from '@aztec/ethereum/l1-tx-utils/config';
3
4
  import { type ConfigMappingsType, SecretValue } from '@aztec/foundation/config';
4
5
  import { EthAddress } from '@aztec/foundation/eth-address';
5
- /**
6
- * The configuration of the rollup transaction publisher.
7
- */
6
+ /** Configuration of the transaction publisher. */
8
7
  export type TxSenderConfig = L1ReaderConfig & {
9
- /**
10
- * The private key to be used by the publisher.
11
- */
8
+ /** The private key to be used by the publisher. */
12
9
  publisherPrivateKeys?: SecretValue<`0x${string}`>[];
13
- /**
14
- * Publisher addresses to be used with a remote signer
15
- */
10
+ /** Publisher addresses to be used with a remote signer */
16
11
  publisherAddresses?: EthAddress[];
17
12
  };
18
- /**
19
- * Configuration of the L1Publisher.
20
- */
21
- export type PublisherConfig = L1TxUtilsConfig & BlobSinkConfig & {
13
+ export type ProverTxSenderConfig = L1ReaderConfig & {
14
+ proverPublisherPrivateKeys?: SecretValue<`0x${string}`>[];
15
+ proverPublisherAddresses?: EthAddress[];
16
+ };
17
+ export type SequencerTxSenderConfig = L1ReaderConfig & {
18
+ sequencerPublisherPrivateKeys?: SecretValue<`0x${string}`>[];
19
+ sequencerPublisherAddresses?: EthAddress[];
20
+ };
21
+ export declare function getTxSenderConfigFromProverConfig(config: ProverTxSenderConfig): TxSenderConfig;
22
+ export declare function getTxSenderConfigFromSequencerConfig(config: SequencerTxSenderConfig): TxSenderConfig;
23
+ /** Configuration of the L1Publisher. */
24
+ export type PublisherConfig = L1TxUtilsConfig & BlobClientConfig & {
22
25
  /** True to use publishers in invalid states (timed out, cancelled, etc) if no other is available */
23
26
  publisherAllowInvalidStates?: boolean;
27
+ /** Whether to run in fisherman mode: builds blocks on every slot for validation without publishing to L1 */
28
+ fishermanMode?: boolean;
29
+ /** Address of the forwarder contract to wrap all L1 transactions through (for testing purposes only) */
30
+ publisherForwarderAddress?: EthAddress;
31
+ /** Store for failed L1 transaction inputs (test networks only). Format: gs://bucket/path */
32
+ l1TxFailedStore?: string;
33
+ /** Min ETH balance below which a publisher gets funded. Undefined = funding disabled. */
34
+ publisherFundingThreshold?: bigint;
35
+ /** Amount of ETH to send when funding a publisher. Undefined = funding disabled. */
36
+ publisherFundingAmount?: bigint;
37
+ };
38
+ export type ProverPublisherConfig = L1TxUtilsConfig & BlobClientConfig & {
39
+ fishermanMode?: boolean;
40
+ proverPublisherAllowInvalidStates?: boolean;
41
+ proverPublisherForwarderAddress?: EthAddress;
42
+ /** Min ETH balance below which a publisher gets funded. Undefined = funding disabled. */
43
+ publisherFundingThreshold?: bigint;
44
+ /** Amount of ETH to send when funding a publisher. Undefined = funding disabled. */
45
+ publisherFundingAmount?: bigint;
46
+ };
47
+ export type SequencerPublisherConfig = L1TxUtilsConfig & BlobClientConfig & {
48
+ fishermanMode?: boolean;
49
+ sequencerPublisherAllowInvalidStates?: boolean;
50
+ sequencerPublisherForwarderAddress?: EthAddress;
51
+ /** Store for failed L1 transaction inputs (test networks only). Format: gs://bucket/path */
52
+ l1TxFailedStore?: string;
53
+ /** Min ETH balance below which a publisher gets funded. Undefined = funding disabled. */
54
+ publisherFundingThreshold?: bigint;
55
+ /** Amount of ETH to send when funding a publisher. Undefined = funding disabled. */
56
+ publisherFundingAmount?: bigint;
24
57
  };
25
- export declare const getTxSenderConfigMappings: (scope: 'PROVER' | 'SEQ') => ConfigMappingsType<Omit<TxSenderConfig, 'l1Contracts'>>;
26
- export declare function getTxSenderConfigFromEnv(scope: 'PROVER' | 'SEQ'): Omit<TxSenderConfig, 'l1Contracts'>;
27
- export declare const getPublisherConfigMappings: (scope: 'PROVER' | 'SEQ') => ConfigMappingsType<PublisherConfig & L1TxUtilsConfig>;
28
- export declare function getPublisherConfigFromEnv(scope: 'PROVER' | 'SEQ'): PublisherConfig;
29
- //# sourceMappingURL=config.d.ts.map
58
+ export declare function getPublisherConfigFromProverConfig(config: ProverPublisherConfig): PublisherConfig;
59
+ export declare function getPublisherConfigFromSequencerConfig(config: SequencerPublisherConfig): PublisherConfig;
60
+ export declare const proverTxSenderConfigMappings: ConfigMappingsType<ProverTxSenderConfig>;
61
+ export declare const sequencerTxSenderConfigMappings: ConfigMappingsType<SequencerTxSenderConfig>;
62
+ export declare const sequencerPublisherConfigMappings: ConfigMappingsType<SequencerPublisherConfig & L1TxUtilsConfig>;
63
+ export declare const proverPublisherConfigMappings: ConfigMappingsType<ProverPublisherConfig & L1TxUtilsConfig>;
64
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlnLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvcHVibGlzaGVyL2NvbmZpZy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsS0FBSyxnQkFBZ0IsRUFBMkIsTUFBTSxrQ0FBa0MsQ0FBQztBQUNsRyxPQUFPLEVBQUUsS0FBSyxjQUFjLEVBQTBCLE1BQU0sMkJBQTJCLENBQUM7QUFDeEYsT0FBTyxFQUFFLEtBQUssZUFBZSxFQUEyQixNQUFNLG9DQUFvQyxDQUFDO0FBQ25HLE9BQU8sRUFBRSxLQUFLLGtCQUFrQixFQUFFLFdBQVcsRUFBdUIsTUFBTSwwQkFBMEIsQ0FBQztBQUNyRyxPQUFPLEVBQUUsVUFBVSxFQUFFLE1BQU0sK0JBQStCLENBQUM7QUFJM0Qsa0RBQWtEO0FBQ2xELE1BQU0sTUFBTSxjQUFjLEdBQUcsY0FBYyxHQUFHO0lBQzVDLG1EQUFtRDtJQUNuRCxvQkFBb0IsQ0FBQyxFQUFFLFdBQVcsQ0FBQyxLQUFLLE1BQU0sRUFBRSxDQUFDLEVBQUUsQ0FBQztJQUVwRCwwREFBMEQ7SUFDMUQsa0JBQWtCLENBQUMsRUFBRSxVQUFVLEVBQUUsQ0FBQztDQUNuQyxDQUFDO0FBRUYsTUFBTSxNQUFNLG9CQUFvQixHQUFHLGNBQWMsR0FBRztJQUNsRCwwQkFBMEIsQ0FBQyxFQUFFLFdBQVcsQ0FBQyxLQUFLLE1BQU0sRUFBRSxDQUFDLEVBQUUsQ0FBQztJQUMxRCx3QkFBd0IsQ0FBQyxFQUFFLFVBQVUsRUFBRSxDQUFDO0NBQ3pDLEN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publisher/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAyB,MAAM,yBAAyB,CAAC;AACrF,OAAO,EACL,KAAK,cAAc,EACnB,KAAK,eAAe,EAGrB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,KAAK,kBAAkB,EACvB,WAAW,EAGZ,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAE3D;;GAEG;AACH,MAAM,MAAM,cAAc,GAAG,cAAc,GAAG;IAC5C;;OAEG;IACH,oBAAoB,CAAC,EAAE,WAAW,CAAC,KAAK,MAAM,EAAE,CAAC,EAAE,CAAC;IAEpD;;OAEG;IACH,kBAAkB,CAAC,EAAE,UAAU,EAAE,CAAC;CACnC,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,eAAe,GAAG,eAAe,GAC3C,cAAc,GAAG;IACf,oGAAoG;IACpG,2BAA2B,CAAC,EAAE,OAAO,CAAC;CACvC,CAAC;AAEJ,eAAO,MAAM,yBAAyB,EAAE,CACtC,KAAK,EAAE,QAAQ,GAAG,KAAK,KACpB,kBAAkB,CAAC,IAAI,CAAC,cAAc,EAAE,aAAa,CAAC,CAezD,CAAC;AAEH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,QAAQ,GAAG,KAAK,GAAG,IAAI,CAAC,cAAc,EAAE,aAAa,CAAC,CAErG;AAED,eAAO,MAAM,0BAA0B,EAAE,CACvC,KAAK,EAAE,QAAQ,GAAG,KAAK,KACpB,kBAAkB,CAAC,eAAe,GAAG,eAAe,CAQvD,CAAC;AAEH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,QAAQ,GAAG,KAAK,GAAG,eAAe,CAElF"}
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/publisher/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,gBAAgB,EAA2B,MAAM,kCAAkC,CAAC;AAClG,OAAO,EAAE,KAAK,cAAc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