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

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 (165) 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 +41 -18
  4. package/dest/client/sequencer-client.d.ts.map +1 -1
  5. package/dest/client/sequencer-client.js +88 -42
  6. package/dest/config.d.ts +41 -8
  7. package/dest/config.d.ts.map +1 -1
  8. package/dest/config.js +153 -53
  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 +138 -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 +80 -0
  15. package/dest/global_variable_builder/global_builder.d.ts +20 -29
  16. package/dest/global_variable_builder/global_builder.d.ts.map +1 -1
  17. package/dest/global_variable_builder/global_builder.js +28 -72
  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 +59 -20
  25. package/dest/publisher/config.d.ts.map +1 -1
  26. package/dest/publisher/config.js +134 -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_to_l2_messaging.d.ts +21 -0
  30. package/dest/publisher/l1_to_l2_messaging.d.ts.map +1 -0
  31. package/dest/publisher/l1_to_l2_messaging.js +70 -0
  32. package/dest/publisher/l1_tx_failed_store/factory.d.ts +11 -0
  33. package/dest/publisher/l1_tx_failed_store/factory.d.ts.map +1 -0
  34. package/dest/publisher/l1_tx_failed_store/factory.js +22 -0
  35. package/dest/publisher/l1_tx_failed_store/failed_tx_store.d.ts +98 -0
  36. package/dest/publisher/l1_tx_failed_store/failed_tx_store.d.ts.map +1 -0
  37. package/dest/publisher/l1_tx_failed_store/failed_tx_store.js +68 -0
  38. package/dest/publisher/l1_tx_failed_store/file_store_failed_tx_store.d.ts +15 -0
  39. package/dest/publisher/l1_tx_failed_store/file_store_failed_tx_store.d.ts.map +1 -0
  40. package/dest/publisher/l1_tx_failed_store/file_store_failed_tx_store.js +36 -0
  41. package/dest/publisher/l1_tx_failed_store/index.d.ts +4 -0
  42. package/dest/publisher/l1_tx_failed_store/index.d.ts.map +1 -0
  43. package/dest/publisher/l1_tx_failed_store/index.js +3 -0
  44. package/dest/publisher/sequencer-bundle-simulator.d.ts +96 -0
  45. package/dest/publisher/sequencer-bundle-simulator.d.ts.map +1 -0
  46. package/dest/publisher/sequencer-bundle-simulator.js +198 -0
  47. package/dest/publisher/sequencer-publisher-factory.d.ts +15 -8
  48. package/dest/publisher/sequencer-publisher-factory.d.ts.map +1 -1
  49. package/dest/publisher/sequencer-publisher-factory.js +28 -4
  50. package/dest/publisher/sequencer-publisher-metrics.d.ts +3 -3
  51. package/dest/publisher/sequencer-publisher-metrics.d.ts.map +1 -1
  52. package/dest/publisher/sequencer-publisher-metrics.js +23 -86
  53. package/dest/publisher/sequencer-publisher.d.ts +164 -96
  54. package/dest/publisher/sequencer-publisher.d.ts.map +1 -1
  55. package/dest/publisher/sequencer-publisher.js +1305 -416
  56. package/dest/publisher/write_json.d.ts +11 -0
  57. package/dest/publisher/write_json.d.ts.map +1 -0
  58. package/dest/publisher/write_json.js +57 -0
  59. package/dest/sequencer/automine/automine_factory.d.ts +56 -0
  60. package/dest/sequencer/automine/automine_factory.d.ts.map +1 -0
  61. package/dest/sequencer/automine/automine_factory.js +85 -0
  62. package/dest/sequencer/automine/automine_sequencer.d.ts +189 -0
  63. package/dest/sequencer/automine/automine_sequencer.d.ts.map +1 -0
  64. package/dest/sequencer/automine/automine_sequencer.js +690 -0
  65. package/dest/sequencer/automine/index.d.ts +3 -0
  66. package/dest/sequencer/automine/index.d.ts.map +1 -0
  67. package/dest/sequencer/automine/index.js +2 -0
  68. package/dest/sequencer/checkpoint_proposal_job.d.ts +158 -0
  69. package/dest/sequencer/checkpoint_proposal_job.d.ts.map +1 -0
  70. package/dest/sequencer/checkpoint_proposal_job.js +1801 -0
  71. package/dest/sequencer/checkpoint_proposal_job_metrics.d.ts +34 -0
  72. package/dest/sequencer/checkpoint_proposal_job_metrics.d.ts.map +1 -0
  73. package/dest/sequencer/checkpoint_proposal_job_metrics.js +72 -0
  74. package/dest/sequencer/checkpoint_voter.d.ts +34 -0
  75. package/dest/sequencer/checkpoint_voter.d.ts.map +1 -0
  76. package/dest/sequencer/checkpoint_voter.js +106 -0
  77. package/dest/sequencer/config.d.ts +3 -2
  78. package/dest/sequencer/config.d.ts.map +1 -1
  79. package/dest/sequencer/errors.d.ts +1 -1
  80. package/dest/sequencer/errors.d.ts.map +1 -1
  81. package/dest/sequencer/events.d.ts +103 -0
  82. package/dest/sequencer/events.d.ts.map +1 -0
  83. package/dest/sequencer/events.js +1 -0
  84. package/dest/sequencer/index.d.ts +4 -2
  85. package/dest/sequencer/index.d.ts.map +1 -1
  86. package/dest/sequencer/index.js +3 -1
  87. package/dest/sequencer/metrics.d.ts +48 -4
  88. package/dest/sequencer/metrics.d.ts.map +1 -1
  89. package/dest/sequencer/metrics.js +257 -50
  90. package/dest/sequencer/requests_tracker.d.ts +22 -0
  91. package/dest/sequencer/requests_tracker.d.ts.map +1 -0
  92. package/dest/sequencer/requests_tracker.js +33 -0
  93. package/dest/sequencer/sequencer.d.ts +253 -148
  94. package/dest/sequencer/sequencer.d.ts.map +1 -1
  95. package/dest/sequencer/sequencer.js +1208 -598
  96. package/dest/sequencer/types.d.ts +3 -0
  97. package/dest/sequencer/types.d.ts.map +1 -0
  98. package/dest/sequencer/types.js +1 -0
  99. package/dest/sequencer/utils.d.ts +14 -8
  100. package/dest/sequencer/utils.d.ts.map +1 -1
  101. package/dest/sequencer/utils.js +7 -4
  102. package/dest/test/index.d.ts +8 -9
  103. package/dest/test/index.d.ts.map +1 -1
  104. package/dest/test/mock_checkpoint_builder.d.ts +95 -0
  105. package/dest/test/mock_checkpoint_builder.d.ts.map +1 -0
  106. package/dest/test/mock_checkpoint_builder.js +231 -0
  107. package/dest/test/utils.d.ts +67 -0
  108. package/dest/test/utils.d.ts.map +1 -0
  109. package/dest/test/utils.js +122 -0
  110. package/package.json +34 -30
  111. package/src/client/sequencer-client.ts +118 -66
  112. package/src/config.ts +181 -62
  113. package/src/global_variable_builder/README.md +44 -0
  114. package/src/global_variable_builder/fee_predictor.ts +182 -0
  115. package/src/global_variable_builder/fee_provider.ts +97 -0
  116. package/src/global_variable_builder/global_builder.ts +45 -106
  117. package/src/global_variable_builder/index.ts +3 -1
  118. package/src/index.ts +1 -7
  119. package/src/publisher/config.ts +190 -46
  120. package/src/publisher/index.ts +3 -0
  121. package/src/publisher/l1_to_l2_messaging.ts +85 -0
  122. package/src/publisher/l1_tx_failed_store/factory.ts +32 -0
  123. package/src/publisher/l1_tx_failed_store/failed_tx_store.ts +164 -0
  124. package/src/publisher/l1_tx_failed_store/file_store_failed_tx_store.ts +47 -0
  125. package/src/publisher/l1_tx_failed_store/index.ts +3 -0
  126. package/src/publisher/sequencer-bundle-simulator.ts +254 -0
  127. package/src/publisher/sequencer-publisher-factory.ts +45 -14
  128. package/src/publisher/sequencer-publisher-metrics.ts +19 -71
  129. package/src/publisher/sequencer-publisher.ts +1109 -538
  130. package/src/publisher/write_json.ts +78 -0
  131. package/src/sequencer/README.md +243 -0
  132. package/src/sequencer/automine/README.md +60 -0
  133. package/src/sequencer/automine/automine_factory.ts +152 -0
  134. package/src/sequencer/automine/automine_sequencer.ts +796 -0
  135. package/src/sequencer/automine/index.ts +6 -0
  136. package/src/sequencer/checkpoint_proposal_job.ts +1652 -0
  137. package/src/sequencer/checkpoint_proposal_job_metrics.ts +128 -0
  138. package/src/sequencer/checkpoint_voter.ts +119 -0
  139. package/src/sequencer/config.ts +2 -1
  140. package/src/sequencer/events.ts +88 -0
  141. package/src/sequencer/index.ts +3 -1
  142. package/src/sequencer/metrics.ts +330 -62
  143. package/src/sequencer/requests_tracker.ts +43 -0
  144. package/src/sequencer/sequencer.ts +1033 -777
  145. package/src/sequencer/types.ts +6 -0
  146. package/src/sequencer/utils.ts +18 -9
  147. package/src/test/index.ts +7 -8
  148. package/src/test/mock_checkpoint_builder.ts +323 -0
  149. package/src/test/utils.ts +218 -0
  150. package/dest/sequencer/block_builder.d.ts +0 -27
  151. package/dest/sequencer/block_builder.d.ts.map +0 -1
  152. package/dest/sequencer/block_builder.js +0 -130
  153. package/dest/sequencer/timetable.d.ts +0 -50
  154. package/dest/sequencer/timetable.d.ts.map +0 -1
  155. package/dest/sequencer/timetable.js +0 -137
  156. package/dest/tx_validator/nullifier_cache.d.ts +0 -14
  157. package/dest/tx_validator/nullifier_cache.d.ts.map +0 -1
  158. package/dest/tx_validator/nullifier_cache.js +0 -24
  159. package/dest/tx_validator/tx_validator_factory.d.ts +0 -17
  160. package/dest/tx_validator/tx_validator_factory.d.ts.map +0 -1
  161. package/dest/tx_validator/tx_validator_factory.js +0 -53
  162. package/src/sequencer/block_builder.ts +0 -218
  163. package/src/sequencer/timetable.ts +0 -188
  164. package/src/tx_validator/nullifier_cache.ts +0 -30
  165. package/src/tx_validator/tx_validator_factory.ts +0 -132
@@ -0,0 +1,138 @@
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
+ // Reset the cached block number on failure so a transient L1 RPC error does not leave a
39
+ // rejected promise cached for this block, which would replay the same rejection on every
40
+ // subsequent call until the next L1 block arrives. Only clear it if it still points at the
41
+ // block this attempt was for, so a stale rejection from an older block cannot wipe a marker
42
+ // a newer call already advanced (which would also defeat the monotonic block-number guard).
43
+ this.cachedState = this.fetchState(blockNumber).catch((err)=>{
44
+ if (this.cachedL1BlockNumber === blockNumber) {
45
+ this.cachedL1BlockNumber = undefined;
46
+ }
47
+ throw err;
48
+ });
49
+ }
50
+ return this.cachedState;
51
+ }
52
+ async fetchState(blockNumber) {
53
+ // Pin all non-constant queries to this L1 block number for a consistent snapshot.
54
+ const opts = {
55
+ blockNumber
56
+ };
57
+ // Cached constants don't need pinning
58
+ const [manaTarget, manaLimit, provingCostPerManaEth, epochDuration] = await Promise.all([
59
+ this.rollupContract.getManaTarget(),
60
+ this.rollupContract.getManaLimit(),
61
+ this.rollupContract.getProvingCostPerMana(),
62
+ this.rollupContract.getEpochDuration()
63
+ ]);
64
+ // First, compute the earliest possible nextSlot independently of the checkpoint, so we can
65
+ // evaluate pruneability at the prediction start timestamp instead of the current L1 block time.
66
+ // This avoids an epoch-boundary edge case where the effective parent differs between now and nextSlot.
67
+ const slotConfig = {
68
+ slotDuration: this.slotDuration,
69
+ l1GenesisTime: this.l1GenesisTime
70
+ };
71
+ const currentSlot = await this.rollupContract.getSlotNumber(opts);
72
+ const slotAtNextL1Block = getSlotAtNextL1Block(BigInt(this.dateProvider.nowInSeconds()), {
73
+ l1GenesisTime: this.l1GenesisTime,
74
+ slotDuration: this.slotDuration,
75
+ ethereumSlotDuration: this.ethereumSlotDuration
76
+ });
77
+ const preliminaryNextSlot = SlotNumber(Math.max(currentSlot, slotAtNextL1Block));
78
+ const nextSlotTimestamp = getTimestampForSlot(preliminaryNextSlot, slotConfig);
79
+ // Resolve the effective checkpoint at the prediction start timestamp
80
+ const lastCheckpoint = await this.rollupContract.getEffectivePendingCheckpoint(nextSlotTimestamp, opts);
81
+ const lastSlot = lastCheckpoint.slotNumber;
82
+ // Refine nextSlot: also account for the slot after the last checkpoint
83
+ const nextSlot = SlotNumber(Math.max(SlotNumber.add(lastSlot, 1), preliminaryNextSlot));
84
+ const feeHeader = lastCheckpoint.feeHeader;
85
+ const slotCount = FEE_ORACLE_LAG;
86
+ const timestamps = times(slotCount, (i)=>getTimestampForSlot(SlotNumber.add(nextSlot, i), slotConfig));
87
+ const l1FeesBySlot = await Promise.all(timestamps.map((ts)=>this.rollupContract.getL1FeesAt(ts, opts)));
88
+ return {
89
+ lastSlot,
90
+ excessMana: computeExcessMana(feeHeader.excessMana, feeHeader.manaUsed, manaTarget),
91
+ ethPerFeeAsset: feeHeader.ethPerFeeAsset,
92
+ manaTarget,
93
+ manaLimit,
94
+ provingCostPerManaEth,
95
+ epochDuration: BigInt(epochDuration),
96
+ l1FeesBySlot
97
+ };
98
+ }
99
+ /** Computes per-slot fee predictions given cached state and a mana usage assumption. */ computePredictions(state, manaUsage) {
100
+ const assumedManaUsed = this.getAssumedManaUsed(state, manaUsage);
101
+ const result = [];
102
+ let { excessMana } = state;
103
+ let { ethPerFeeAsset } = state;
104
+ // Slot 0: current state (next available slot after last checkpoint)
105
+ result.push(this.computeGasFees(state, excessMana, ethPerFeeAsset, state.l1FeesBySlot[0]));
106
+ // Slots 1..LAG-1: advance excessMana with the assumed mana usage per checkpoint,
107
+ // and decay ethPerFeeAsset by MAX_FEE_ASSET_PRICE_MODIFIER_BPS per slot for conservative estimates.
108
+ // Lower ethPerFeeAsset means higher fees in fee asset terms.
109
+ for(let i = 1; i < state.l1FeesBySlot.length; i++){
110
+ excessMana = computeExcessMana(excessMana, assumedManaUsed, state.manaTarget);
111
+ const decayed = ethPerFeeAsset * (10000n - MAX_FEE_ASSET_PRICE_MODIFIER_BPS) / 10000n;
112
+ ethPerFeeAsset = decayed < MIN_ETH_PER_FEE_ASSET ? MIN_ETH_PER_FEE_ASSET : decayed;
113
+ result.push(this.computeGasFees(state, excessMana, ethPerFeeAsset, state.l1FeesBySlot[i]));
114
+ }
115
+ return result;
116
+ }
117
+ getAssumedManaUsed(state, manaUsage) {
118
+ switch(manaUsage){
119
+ case ManaUsageEstimate.None:
120
+ return 0n;
121
+ case ManaUsageEstimate.Target:
122
+ return state.manaTarget;
123
+ case ManaUsageEstimate.Limit:
124
+ return state.manaLimit;
125
+ }
126
+ }
127
+ computeGasFees(state, excessMana, ethPerFeeAsset, l1Fees) {
128
+ return new GasFees(0, computeManaMinFee({
129
+ l1BaseFee: l1Fees.baseFee,
130
+ l1BlobFee: l1Fees.blobFee,
131
+ manaTarget: state.manaTarget,
132
+ epochDuration: state.epochDuration,
133
+ provingCostPerManaEth: state.provingCostPerManaEth,
134
+ excessMana,
135
+ ethPerFeeAsset
136
+ }));
137
+ }
138
+ }
@@ -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
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmVlX3Byb3ZpZGVyLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvZ2xvYmFsX3ZhcmlhYmxlX2J1aWxkZXIvZmVlX3Byb3ZpZGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUNBLE9BQU8sS0FBSyxFQUFFLGdCQUFnQixFQUFFLE1BQU0sdUJBQXVCLENBQUM7QUFFOUQsT0FBTyxLQUFLLEVBQUUsWUFBWSxFQUFFLE1BQU0seUJBQXlCLENBQUM7QUFFNUQsT0FBTyxFQUFFLE9BQU8sRUFBRSxpQkFBaUIsRUFBRSxNQUFNLG1CQUFtQixDQUFDO0FBQy9ELE9BQU8sS0FBSyxFQUFFLFdBQVcsRUFBRSxNQ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KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAGpD,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,qBAAqB,CAAC;AAEvE,8EAA8E;AAC9E,qBAAa,eAAgB,YAAW,WAAW;IAU/C,OAAO,CAAC,QAAQ,CAAC,YAAY;IAC7B,OAAO,CAAC,QAAQ,CAAC,YAAY;IAV/B,OAAO,CAAC,cAAc,CAAwD;IAC9E,OAAO,CAAC,oBAAoB,CAAiC;IAE7D,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAiB;IAChD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAe;IAC5C,OAAO,CAAC,QAAQ,CAAC,oBAAoB,CAAS;IAC9C,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAS;IAEvC,YACmB,YAAY,EAAE,YAAY,EAC1B,YAAY,EAAE,gBAAgB,EAC/C,MAAM,EAAE,2BAA2B,EAWpC;YAMa,qBAAqB;IAkBtB,iBAAiB,IAAI,OAAO,CAAC,OAAO,CAAC,CA2BjD;IAEY,mBAAmB,CAAC,SAAS,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,OAAO,EAAE,CAAC,CAOlF;CACF"}
@@ -0,0 +1,80 @@
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
+ cacheTime: 0
49
+ });
50
+ // If the L1 block number has changed then chain a new promise to get the current min fees.
51
+ // We chain off the previous promise's settlement (via a swallowing catch) rather than its
52
+ // fulfillment, so a prior rejection does not short-circuit the new computation. If the new
53
+ // computation fails (e.g. a transient L1 RPC error), reset the cached block number so the
54
+ // next call recomputes instead of permanently replaying the rejected promise — otherwise a
55
+ // single transient failure would wedge fee estimation until the next L1 block arrives. Only
56
+ // clear it if it still points at the block this attempt was for, so a stale rejection from an
57
+ // older block cannot wipe a marker a newer call already advanced (which would also defeat the
58
+ // monotonic block-number guard).
59
+ if (this.currentL1BlockNumber === undefined || blockNumber > this.currentL1BlockNumber) {
60
+ this.currentL1BlockNumber = blockNumber;
61
+ this.currentMinFees = this.currentMinFees.catch(()=>undefined).then(()=>this.computeCurrentMinFees().catch((err)=>{
62
+ if (this.currentL1BlockNumber === blockNumber) {
63
+ this.currentL1BlockNumber = undefined;
64
+ }
65
+ throw err;
66
+ }));
67
+ }
68
+ return this.currentMinFees;
69
+ }
70
+ async getPredictedMinFees(manaUsage) {
71
+ const [currentMinFees, predictedMinFees] = await Promise.all([
72
+ this.getCurrentMinFees(),
73
+ this.feePredictor.getPredictedMinFees(manaUsage ?? ManaUsageEstimate.Target)
74
+ ]);
75
+ return [
76
+ currentMinFees,
77
+ ...predictedMinFees
78
+ ];
79
+ }
80
+ }
@@ -1,37 +1,28 @@
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 type { SlotNumber } from '@aztec/foundation/branded-types';
2
4
  import type { EthAddress } from '@aztec/foundation/eth-address';
3
5
  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';
6
- import { GlobalVariables } from '@aztec/stdlib/tx';
6
+ import { type L1RollupConstants } from '@aztec/stdlib/epoch-helpers';
7
+ import type { CheckpointGlobalVariables, GlobalVariableBuilder as GlobalVariableBuilderInterface } from '@aztec/stdlib/tx';
8
+ /** Configuration for the GlobalVariableBuilder (excludes L1 client config). */
9
+ export type GlobalVariableBuilderConfig = {
10
+ rollupAddress: EthAddress;
11
+ ethereumSlotDuration: number;
12
+ rollupVersion: bigint;
13
+ } & Pick<L1RollupConstants, 'slotDuration' | 'l1GenesisTime'>;
7
14
  /**
8
15
  * Simple global variables builder.
9
16
  */
10
17
  export declare class GlobalVariableBuilder implements GlobalVariableBuilderInterface {
11
- private log;
12
- private currentBaseFees;
13
- private currentL1BlockNumber;
14
- private readonly rollupContract;
15
18
  private readonly publicClient;
16
- 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'>>;
27
- /**
28
- * Simple builder of global variables that use the minimum time possible.
29
- * @param blockNumber - The block number to build global variables for.
30
- * @param coinbase - The address to receive block reward.
31
- * @param feeRecipient - The address to receive fees.
32
- * @param slotNumber - The slot number to use for the global variables, if undefined it will be calculated.
33
- * @returns The global variables for the given block number.
34
- */
35
- buildGlobalVariables(blockNumber: number, coinbase: EthAddress, feeRecipient: AztecAddress, slotNumber?: bigint): Promise<GlobalVariables>;
19
+ private readonly rollupContract;
20
+ private readonly aztecSlotDuration;
21
+ private readonly l1GenesisTime;
22
+ private chainId;
23
+ private version;
24
+ constructor(publicClient: ViemPublicClient, config: GlobalVariableBuilderConfig);
25
+ /** Builds global variables that are constant throughout a checkpoint. */
26
+ buildCheckpointGlobalVariables(coinbase: EthAddress, feeRecipient: AztecAddress, slotNumber: SlotNumber, simulationOverridesPlan?: SimulationOverridesPlan): Promise<CheckpointGlobalVariables>;
36
27
  }
37
- //# sourceMappingURL=global_builder.d.ts.map
28
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZ2xvYmFsX2J1aWxkZXIuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9nbG9iYWxf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,OAAO,CAAC,QAAQ,CAAC,YAAY;IAR/B,OAAO,CAAC,QAAQ,CAAC,cAAc,CAAiB;IAChD,OAAO,CAAC,QAAQ,CAAC,iBAAiB,CAAS;IAC3C,OAAO,CAAC,QAAQ,CAAC,aAAa,CAAS;IAEvC,OAAO,CAAC,OAAO,CAAK;IACpB,OAAO,CAAC,OAAO,CAAK;IAEpB,YACmB,YAAY,EAAE,gBAAgB,EAC/C,MAAM,EAAE,2BAA2B,EASpC;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,40 @@
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 { getTimestampForSlot } from '@aztec/stdlib/epoch-helpers';
4
4
  import { GasFees } from '@aztec/stdlib/gas';
5
- import { GlobalVariables } from '@aztec/stdlib/tx';
6
- import { createPublicClient, fallback, http } from 'viem';
7
5
  /**
8
6
  * Simple global variables builder.
9
7
  */ export class GlobalVariableBuilder {
10
- log = createLogger('sequencer:global_variable_builder');
11
- currentBaseFees = Promise.resolve(new GasFees(0, 0));
12
- currentL1BlockNumber = undefined;
13
- rollupContract;
14
8
  publicClient;
15
- ethereumSlotDuration;
9
+ rollupContract;
10
+ aztecSlotDuration;
11
+ l1GenesisTime;
16
12
  chainId;
17
13
  version;
18
- constructor(config){
19
- const { l1RpcUrls, l1ChainId: chainId, l1Contracts } = config;
20
- const chain = createEthereumChain(l1RpcUrls, chainId);
21
- 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));
14
+ constructor(publicClient, config){
15
+ this.publicClient = publicClient;
16
+ this.version = new Fr(config.rollupVersion);
17
+ this.chainId = new Fr(this.publicClient.chain.id);
18
+ this.aztecSlotDuration = config.slotDuration;
19
+ this.l1GenesisTime = config.l1GenesisTime;
20
+ this.rollupContract = new RollupContract(this.publicClient, config.rollupAddress);
41
21
  }
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
- }
22
+ /** Builds global variables that are constant throughout a checkpoint. */ async buildCheckpointGlobalVariables(coinbase, feeRecipient, slotNumber, simulationOverridesPlan) {
23
+ const { chainId, version } = this;
24
+ const timestamp = getTimestampForSlot(slotNumber, {
25
+ slotDuration: this.aztecSlotDuration,
26
+ l1GenesisTime: this.l1GenesisTime
27
+ });
28
+ const stateOverride = await buildSimulationOverridesStateOverride(this.rollupContract, simulationOverridesPlan);
29
+ const gasFees = new GasFees(0, await this.rollupContract.getManaMinFeeAt(timestamp, true, stateOverride));
59
30
  return {
60
- chainId: this.chainId,
61
- version: this.version
31
+ chainId,
32
+ version,
33
+ slotNumber,
34
+ timestamp,
35
+ coinbase,
36
+ feeRecipient,
37
+ gasFees
62
38
  };
63
39
  }
64
- /**
65
- * Simple builder of global variables that use the minimum time possible.
66
- * @param blockNumber - The block number to build global variables for.
67
- * @param coinbase - The address to receive block reward.
68
- * @param feeRecipient - The address to receive fees.
69
- * @param slotNumber - The slot number to use for the global variables, if undefined it will be calculated.
70
- * @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;
83
- }
84
40
  }
@@ -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 { 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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLG1CQUFtQixDQUFDO0FBQ2xDLGNBQWMsYUFBYSxDQUFDO0FBQzVCLGNBQWMsc0JBQXNCLENBQUM7QUFDckMsT0FBTyxFQUFFLFNBQVMsRUFBRSxjQUFjLEVBQUUsS0FBSyxlQUFlLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUl2RixjQUFjLG9DQUFvQyxDQUFDIn0=
@@ -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,EAAE,SAAS,EAAE,cAAc,EAAE,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAIvF,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 { 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,68 @@
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
+ /** How long to wait for the previous L1 block before sending scheduled publisher txs anyway. */
52
+ sequencerPublisherPreviousL1BlockWaitTimeoutMs: number;
53
+ /** Poll interval while waiting for the previous L1 block before scheduled publisher txs. */
54
+ sequencerPublisherPreviousL1BlockWaitPollIntervalMs: number;
55
+ /** Store for failed L1 transaction inputs (test networks only). Format: gs://bucket/path */
56
+ l1TxFailedStore?: string;
57
+ /** Min ETH balance below which a publisher gets funded. Undefined = funding disabled. */
58
+ publisherFundingThreshold?: bigint;
59
+ /** Amount of ETH to send when funding a publisher. Undefined = funding disabled. */
60
+ publisherFundingAmount?: bigint;
24
61
  };
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
62
+ export declare function getPublisherConfigFromProverConfig(config: ProverPublisherConfig): PublisherConfig;
63
+ export declare function getPublisherConfigFromSequencerConfig(config: SequencerPublisherConfig): PublisherConfig;
64
+ export declare const proverTxSenderConfigMappings: ConfigMappingsType<ProverTxSenderConfig>;
65
+ export declare const sequencerTxSenderConfigMappings: ConfigMappingsType<SequencerTxSenderConfig>;
66
+ export declare const sequencerPublisherConfigMappings: ConfigMappingsType<SequencerPublisherConfig & L1TxUtilsConfig>;
67
+ export declare const proverPublisherConfigMappings: ConfigMappingsType<ProverPublisherConfig & L1TxUtilsConfig>;
68
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlnLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvcHVibGlzaGVyL2NvbmZpZy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsS0FBSyxnQkFBZ0IsRUFBMkIsTUFBTSxrQ0FBa0MsQ0FBQztBQUNsRyxPQUFPLEVBQUUsS0FBSyxjQUFjLEVBQTBCLE1BQU0sMkJBQTJCLENBQUM7QUFDeEYsT0FBTyxFQUFFLEt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