@aztec-labs/sequencer-client 6.0.0-nightly.20260829

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 +307 -0
  2. package/dest/client/index.d.ts +2 -0
  3. package/dest/client/index.d.ts.map +1 -0
  4. package/dest/client/index.js +1 -0
  5. package/dest/client/sequencer-client.d.ts +94 -0
  6. package/dest/client/sequencer-client.d.ts.map +1 -0
  7. package/dest/client/sequencer-client.js +177 -0
  8. package/dest/config.d.ts +56 -0
  9. package/dest/config.d.ts.map +1 -0
  10. package/dest/config.js +251 -0
  11. package/dest/global_variable_builder/fee_predictor.d.ts +49 -0
  12. package/dest/global_variable_builder/fee_predictor.d.ts.map +1 -0
  13. package/dest/global_variable_builder/fee_predictor.js +127 -0
  14. package/dest/global_variable_builder/fee_provider.d.ts +28 -0
  15. package/dest/global_variable_builder/fee_provider.d.ts.map +1 -0
  16. package/dest/global_variable_builder/fee_provider.js +87 -0
  17. package/dest/global_variable_builder/global_builder.d.ts +28 -0
  18. package/dest/global_variable_builder/global_builder.d.ts.map +1 -0
  19. package/dest/global_variable_builder/global_builder.js +40 -0
  20. package/dest/global_variable_builder/index.d.ts +4 -0
  21. package/dest/global_variable_builder/index.d.ts.map +1 -0
  22. package/dest/global_variable_builder/index.js +3 -0
  23. package/dest/index.d.ts +7 -0
  24. package/dest/index.d.ts.map +1 -0
  25. package/dest/index.js +8 -0
  26. package/dest/publisher/config.d.ts +68 -0
  27. package/dest/publisher/config.d.ts.map +1 -0
  28. package/dest/publisher/config.js +137 -0
  29. package/dest/publisher/index.d.ts +5 -0
  30. package/dest/publisher/index.d.ts.map +1 -0
  31. package/dest/publisher/index.js +4 -0
  32. package/dest/publisher/l1_to_l2_messaging.d.ts +21 -0
  33. package/dest/publisher/l1_to_l2_messaging.d.ts.map +1 -0
  34. package/dest/publisher/l1_to_l2_messaging.js +70 -0
  35. package/dest/publisher/l1_tx_failed_store/factory.d.ts +11 -0
  36. package/dest/publisher/l1_tx_failed_store/factory.d.ts.map +1 -0
  37. package/dest/publisher/l1_tx_failed_store/factory.js +22 -0
  38. package/dest/publisher/l1_tx_failed_store/failed_tx_store.d.ts +101 -0
  39. package/dest/publisher/l1_tx_failed_store/failed_tx_store.d.ts.map +1 -0
  40. package/dest/publisher/l1_tx_failed_store/failed_tx_store.js +68 -0
  41. package/dest/publisher/l1_tx_failed_store/file_store_failed_tx_store.d.ts +15 -0
  42. package/dest/publisher/l1_tx_failed_store/file_store_failed_tx_store.d.ts.map +1 -0
  43. package/dest/publisher/l1_tx_failed_store/file_store_failed_tx_store.js +36 -0
  44. package/dest/publisher/l1_tx_failed_store/index.d.ts +4 -0
  45. package/dest/publisher/l1_tx_failed_store/index.d.ts.map +1 -0
  46. package/dest/publisher/l1_tx_failed_store/index.js +3 -0
  47. package/dest/publisher/sequencer-bundle-simulator.d.ts +96 -0
  48. package/dest/publisher/sequencer-bundle-simulator.d.ts.map +1 -0
  49. package/dest/publisher/sequencer-bundle-simulator.js +198 -0
  50. package/dest/publisher/sequencer-publisher-factory.d.ts +50 -0
  51. package/dest/publisher/sequencer-publisher-factory.d.ts.map +1 -0
  52. package/dest/publisher/sequencer-publisher-factory.js +75 -0
  53. package/dest/publisher/sequencer-publisher-metrics.d.ts +26 -0
  54. package/dest/publisher/sequencer-publisher-metrics.d.ts.map +1 -0
  55. package/dest/publisher/sequencer-publisher-metrics.js +101 -0
  56. package/dest/publisher/sequencer-publisher.d.ts +254 -0
  57. package/dest/publisher/sequencer-publisher.d.ts.map +1 -0
  58. package/dest/publisher/sequencer-publisher.js +1784 -0
  59. package/dest/publisher/write_json.d.ts +11 -0
  60. package/dest/publisher/write_json.d.ts.map +1 -0
  61. package/dest/publisher/write_json.js +57 -0
  62. package/dest/sequencer/automine/automine_factory.d.ts +56 -0
  63. package/dest/sequencer/automine/automine_factory.d.ts.map +1 -0
  64. package/dest/sequencer/automine/automine_factory.js +85 -0
  65. package/dest/sequencer/automine/automine_sequencer.d.ts +189 -0
  66. package/dest/sequencer/automine/automine_sequencer.d.ts.map +1 -0
  67. package/dest/sequencer/automine/automine_sequencer.js +732 -0
  68. package/dest/sequencer/automine/index.d.ts +3 -0
  69. package/dest/sequencer/automine/index.d.ts.map +1 -0
  70. package/dest/sequencer/automine/index.js +2 -0
  71. package/dest/sequencer/checkpoint_proposal_job.d.ts +169 -0
  72. package/dest/sequencer/checkpoint_proposal_job.d.ts.map +1 -0
  73. package/dest/sequencer/checkpoint_proposal_job.js +1961 -0
  74. package/dest/sequencer/checkpoint_proposal_job_metrics.d.ts +34 -0
  75. package/dest/sequencer/checkpoint_proposal_job_metrics.d.ts.map +1 -0
  76. package/dest/sequencer/checkpoint_proposal_job_metrics.js +72 -0
  77. package/dest/sequencer/checkpoint_voter.d.ts +34 -0
  78. package/dest/sequencer/checkpoint_voter.d.ts.map +1 -0
  79. package/dest/sequencer/checkpoint_voter.js +106 -0
  80. package/dest/sequencer/config.d.ts +8 -0
  81. package/dest/sequencer/config.d.ts.map +1 -0
  82. package/dest/sequencer/config.js +1 -0
  83. package/dest/sequencer/errors.d.ts +11 -0
  84. package/dest/sequencer/errors.d.ts.map +1 -0
  85. package/dest/sequencer/errors.js +15 -0
  86. package/dest/sequencer/events.d.ts +103 -0
  87. package/dest/sequencer/events.d.ts.map +1 -0
  88. package/dest/sequencer/events.js +1 -0
  89. package/dest/sequencer/inbox_bucket_selector.d.ts +88 -0
  90. package/dest/sequencer/inbox_bucket_selector.d.ts.map +1 -0
  91. package/dest/sequencer/inbox_bucket_selector.js +80 -0
  92. package/dest/sequencer/index.d.ts +6 -0
  93. package/dest/sequencer/index.d.ts.map +1 -0
  94. package/dest/sequencer/index.js +5 -0
  95. package/dest/sequencer/metrics.d.ts +75 -0
  96. package/dest/sequencer/metrics.d.ts.map +1 -0
  97. package/dest/sequencer/metrics.js +343 -0
  98. package/dest/sequencer/missing_committee.d.ts +72 -0
  99. package/dest/sequencer/missing_committee.d.ts.map +1 -0
  100. package/dest/sequencer/missing_committee.js +139 -0
  101. package/dest/sequencer/requests_tracker.d.ts +22 -0
  102. package/dest/sequencer/requests_tracker.d.ts.map +1 -0
  103. package/dest/sequencer/requests_tracker.js +33 -0
  104. package/dest/sequencer/sequencer.d.ts +326 -0
  105. package/dest/sequencer/sequencer.d.ts.map +1 -0
  106. package/dest/sequencer/sequencer.js +1495 -0
  107. package/dest/sequencer/types.d.ts +3 -0
  108. package/dest/sequencer/types.d.ts.map +1 -0
  109. package/dest/sequencer/types.js +1 -0
  110. package/dest/sequencer/utils.d.ts +30 -0
  111. package/dest/sequencer/utils.d.ts.map +1 -0
  112. package/dest/sequencer/utils.js +18 -0
  113. package/dest/test/index.d.ts +23 -0
  114. package/dest/test/index.d.ts.map +1 -0
  115. package/dest/test/index.js +6 -0
  116. package/dest/test/mock_checkpoint_builder.d.ts +95 -0
  117. package/dest/test/mock_checkpoint_builder.d.ts.map +1 -0
  118. package/dest/test/mock_checkpoint_builder.js +230 -0
  119. package/dest/test/utils.d.ts +67 -0
  120. package/dest/test/utils.d.ts.map +1 -0
  121. package/dest/test/utils.js +121 -0
  122. package/package.json +118 -0
  123. package/src/client/index.ts +1 -0
  124. package/src/client/sequencer-client.ts +281 -0
  125. package/src/config.ts +309 -0
  126. package/src/global_variable_builder/README.md +44 -0
  127. package/src/global_variable_builder/fee_predictor.ts +176 -0
  128. package/src/global_variable_builder/fee_provider.ts +104 -0
  129. package/src/global_variable_builder/global_builder.ts +68 -0
  130. package/src/global_variable_builder/index.ts +3 -0
  131. package/src/index.ts +15 -0
  132. package/src/publisher/config.ts +220 -0
  133. package/src/publisher/index.ts +8 -0
  134. package/src/publisher/l1_to_l2_messaging.ts +85 -0
  135. package/src/publisher/l1_tx_failed_store/factory.ts +32 -0
  136. package/src/publisher/l1_tx_failed_store/failed_tx_store.ts +166 -0
  137. package/src/publisher/l1_tx_failed_store/file_store_failed_tx_store.ts +47 -0
  138. package/src/publisher/l1_tx_failed_store/index.ts +3 -0
  139. package/src/publisher/sequencer-bundle-simulator.ts +253 -0
  140. package/src/publisher/sequencer-publisher-factory.ts +121 -0
  141. package/src/publisher/sequencer-publisher-metrics.ts +145 -0
  142. package/src/publisher/sequencer-publisher.ts +1719 -0
  143. package/src/publisher/write_json.ts +77 -0
  144. package/src/sequencer/README.md +243 -0
  145. package/src/sequencer/automine/README.md +60 -0
  146. package/src/sequencer/automine/automine_factory.ts +156 -0
  147. package/src/sequencer/automine/automine_sequencer.ts +841 -0
  148. package/src/sequencer/automine/index.ts +6 -0
  149. package/src/sequencer/checkpoint_proposal_job.ts +1889 -0
  150. package/src/sequencer/checkpoint_proposal_job_metrics.ts +128 -0
  151. package/src/sequencer/checkpoint_voter.ts +118 -0
  152. package/src/sequencer/config.ts +9 -0
  153. package/src/sequencer/errors.ts +21 -0
  154. package/src/sequencer/events.ts +93 -0
  155. package/src/sequencer/inbox_bucket_selector.ts +160 -0
  156. package/src/sequencer/index.ts +5 -0
  157. package/src/sequencer/metrics.ts +463 -0
  158. package/src/sequencer/missing_committee.ts +192 -0
  159. package/src/sequencer/requests_tracker.ts +43 -0
  160. package/src/sequencer/sequencer.ts +1401 -0
  161. package/src/sequencer/types.ts +6 -0
  162. package/src/sequencer/utils.ts +42 -0
  163. package/src/test/index.ts +26 -0
  164. package/src/test/mock_checkpoint_builder.ts +324 -0
  165. package/src/test/utils.ts +215 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"global_builder.d.ts","sourceRoot":"","sources":["../../src/global_variable_builder/global_builder.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,uBAAuB,EAE7B,MAAM,gCAAgC,CAAC;AACxC,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,4BAA4B,CAAC;AACnE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sCAAsC,CAAC;AAEvE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oCAAoC,CAAC;AACrE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AACrE,OAAO,EAAE,KAAK,iBAAiB,EAAuB,MAAM,kCAAkC,CAAC;AAE/F,OAAO,KAAK,EACV,yBAAyB,EACzB,qBAAqB,IAAI,8BAA8B,EACxD,MAAM,uBAAuB,CAAC;AAE/B,+EAA+E;AAC/E,MAAM,MAAM,2BAA2B,GAAG;IACxC,aAAa,EAAE,UAAU,CAAC;IAC1B,oBAAoB,EAAE,MAAM,CAAC;IAC7B,aAAa,EAAE,MAAM,CAAC;CACvB,GAAG,IAAI,CAAC,iBAAiB,EAAE,cAAc,GAAG,eAAe,CAAC,CAAC;AAE9D;;GAEG;AACH,qBAAa,qBAAsB,YAAW,8BAA8B;IASxE,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"}
@@ -0,0 +1,40 @@
1
+ import { RollupContract, buildSimulationOverridesStateOverride } from '@aztec-labs/ethereum/contracts';
2
+ import { Fr } from '@aztec-labs/foundation/curves/bn254';
3
+ import { getTimestampForSlot } from '@aztec-labs/stdlib/epoch-helpers';
4
+ import { GasFees } from '@aztec-labs/stdlib/gas';
5
+ /**
6
+ * Simple global variables builder.
7
+ */ export class GlobalVariableBuilder {
8
+ publicClient;
9
+ rollupContract;
10
+ aztecSlotDuration;
11
+ l1GenesisTime;
12
+ chainId;
13
+ version;
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);
21
+ }
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));
30
+ return {
31
+ chainId,
32
+ version,
33
+ slotNumber,
34
+ timestamp,
35
+ coinbase,
36
+ feeRecipient,
37
+ gasFees
38
+ };
39
+ }
40
+ }
@@ -0,0 +1,4 @@
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==
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,3 @@
1
+ export { FeeProviderImpl } from './fee_provider.js';
2
+ export { GlobalVariableBuilder } from './global_builder.js';
3
+ export { FeePredictor } from './fee_predictor.js';
@@ -0,0 +1,7 @@
1
+ export * from './client/index.js';
2
+ export * from './config.js';
3
+ export * from './publisher/index.js';
4
+ export { Sequencer, SequencerState, type SequencerEvents } from './sequencer/index.js';
5
+ export * from './global_variable_builder/index.js';
6
+ export { type ConsumedBucketCursor, type InboxBucketSelection, type InboxBucketSource, type SelectInboxBucketInput, selectInboxBucketForBlock, } from './sequencer/inbox_bucket_selector.js';
7
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxjQUFjLG1CQUFtQixDQUFDO0FBQ2xDLGNBQWMsYUFBYSxDQUFDO0FBQzVCLGNBQWMsc0JBQXNCLENBQUM7QUFDckMsT0FBTyxFQUFFLFNBQVMsRUFBRSxjQUFjLEVBQUUsS0FBSyxlQUFlLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUl2RixjQUFjLG9DQUFvQyxDQUFDO0FBQ25ELE9BQU8sRUFDTCxLQUFLLG9CQUFvQixFQUN6QixLQUFLLG9CQUFvQixFQUN6QixLQUFLLGlCQUFpQixFQUN0QixLQUFLLHNCQUFzQixFQUMzQix5QkFBeUIsR0FDMUIsTUFBTSxzQ0FBc0MsQ0FBQyJ9
@@ -0,0 +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,EAAE,SAAS,EAAE,cAAc,EAAE,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAIvF,cAAc,oCAAoC,CAAC;AACnD,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,iBAAiB,EACtB,KAAK,sBAAsB,EAC3B,yBAAyB,GAC1B,MAAM,sCAAsC,CAAC"}
package/dest/index.js ADDED
@@ -0,0 +1,8 @@
1
+ export * from './client/index.js';
2
+ export * from './config.js';
3
+ export * from './publisher/index.js';
4
+ export { Sequencer, SequencerState } from './sequencer/index.js';
5
+ // Used by the node to simulate public parts of transactions. Should these be moved to a shared library?
6
+ // ISSUE(#9832)
7
+ export * from './global_variable_builder/index.js';
8
+ export { selectInboxBucketForBlock } from './sequencer/inbox_bucket_selector.js';
@@ -0,0 +1,68 @@
1
+ import { type BlobClientConfig } from '@aztec-labs/blob-client/client/config';
2
+ import { type L1ReaderConfig } from '@aztec-labs/ethereum/l1-reader';
3
+ import { type L1TxUtilsConfig } from '@aztec-labs/ethereum/l1-tx-utils/config';
4
+ import { type ConfigMappingsType, SecretValue } from '@aztec-labs/foundation/config';
5
+ import { EthAddress } from '@aztec-labs/foundation/eth-address';
6
+ /** Configuration of the transaction publisher. */
7
+ export type TxSenderConfig = L1ReaderConfig & {
8
+ /** The private key to be used by the publisher. */
9
+ publisherPrivateKeys?: SecretValue<`0x${string}`>[];
10
+ /** Publisher addresses to be used with a remote signer */
11
+ publisherAddresses?: EthAddress[];
12
+ };
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 & {
25
+ /** True to use publishers in invalid states (timed out, cancelled, etc) if no other is available */
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;
61
+ };
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,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlnLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvcHVibGlzaGVyL2NvbmZpZy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsS0FBSyxnQkFBZ0IsRUFBMkIsTUFBTSx1Q0FBdUMsQ0FBQztBQUN2RyxPQUFPLEVBQUUsS0FBSyxjQUFjLEVBQTBCLE1BQU0sZ0NBQWdDLENBQUM7QUFDN0YsT0FBTyxFQUFFLEtBQUssZUFBZSxFQUEyQixNQUFNLHlDQUF5QyxDQUFDO0FBQ3hHLE9BQU8sRUFDTCxLQUFLLGtCQUFrQixFQUN2QixXQUFXLEVBR1os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EAAE,MAAM,CAAC;CACjC,CAAC;AAEJ,MAAM,MAAM,wBAAwB,GAAG,eAAe,GACpD,gBAAgB,GAAG;IACjB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,oCAAoC,CAAC,EAAE,OAAO,CAAC;IAC/C,kCAAkC,CAAC,EAAE,UAAU,CAAC;IAChD,gGAAgG;IAChG,8CAA8C,EAAE,MAAM,CAAC;IACvD,4FAA4F;IAC5F,mDAAmD,EAAE,MAAM,CAAC;IAC5D,4FAA4F;IAC5F,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,yFAAyF;IACzF,yBAAyB,CAAC,EAAE,MAAM,CAAC;IACnC,oFAAoF;IACpF,sBAAsB,CAAC,EAAE,MAAM,CAAC;CACjC,CAAC;AAEJ,wBAAgB,kCAAkC,CAAC,MAAM,EAAE,qBAAqB,GAAG,eAAe,CAMjG;AAED,wBAAgB,qCAAqC,CAAC,MAAM,EAAE,wBAAwB,GAAG,eAAe,CAOvG;AAED,eAAO,MAAM,4BAA4B,EAAE,kBAAkB,CAAC,oBAAoB,CAgBjF,CAAC;AAEF,eAAO,MAAM,+BAA+B,EAAE,kBAAkB,CAAC,uBAAuB,CAgBvF,CAAC;AAEF,eAAO,MAAM,gCAAgC,EAAE,kBAAkB,CAAC,wBAAwB,GAAG,eAAe,CAoC3G,CAAC;AAEF,eAAO,MAAM,6BAA6B,EAAE,kBAAkB,CAAC,qBAAqB,GAAG,eAAe,CAoBrG,CAAC"}
@@ -0,0 +1,137 @@
1
+ import { blobClientConfigMapping } from '@aztec-labs/blob-client/client/config';
2
+ import { l1ReaderConfigMappings } from '@aztec-labs/ethereum/l1-reader';
3
+ import { l1TxUtilsConfigMappings } from '@aztec-labs/ethereum/l1-tx-utils/config';
4
+ import { SecretValue, booleanConfigHelper, numberConfigHelper } from '@aztec-labs/foundation/config';
5
+ import { EthAddress } from '@aztec-labs/foundation/eth-address';
6
+ import { parseEther } from 'viem';
7
+ export function getTxSenderConfigFromProverConfig(config) {
8
+ return {
9
+ ...config,
10
+ publisherPrivateKeys: config.proverPublisherPrivateKeys,
11
+ publisherAddresses: config.proverPublisherAddresses
12
+ };
13
+ }
14
+ export function getTxSenderConfigFromSequencerConfig(config) {
15
+ return {
16
+ ...config,
17
+ publisherPrivateKeys: config.sequencerPublisherPrivateKeys,
18
+ publisherAddresses: config.sequencerPublisherAddresses
19
+ };
20
+ }
21
+ /** Shared config mappings for publisher funding, used by both sequencer and prover publisher configs. */ const publisherFundingConfigMappings = {
22
+ publisherFundingThreshold: {
23
+ env: 'PUBLISHER_FUNDING_THRESHOLD',
24
+ description: 'Min ETH balance below which a publisher gets funded. Specified in ether (e.g. 0.1). Unset = funding disabled.',
25
+ parseEnv: (val)=>parseEther(val)
26
+ },
27
+ publisherFundingAmount: {
28
+ env: 'PUBLISHER_FUNDING_AMOUNT',
29
+ description: 'Amount of ETH to send when funding a publisher. Specified in ether (e.g. 0.5). Unset = funding disabled.',
30
+ parseEnv: (val)=>parseEther(val)
31
+ }
32
+ };
33
+ export function getPublisherConfigFromProverConfig(config) {
34
+ return {
35
+ ...config,
36
+ publisherAllowInvalidStates: config.proverPublisherAllowInvalidStates,
37
+ publisherForwarderAddress: config.proverPublisherForwarderAddress
38
+ };
39
+ }
40
+ export function getPublisherConfigFromSequencerConfig(config) {
41
+ return {
42
+ ...config,
43
+ publisherAllowInvalidStates: config.sequencerPublisherAllowInvalidStates,
44
+ publisherForwarderAddress: config.sequencerPublisherForwarderAddress,
45
+ l1TxFailedStore: config.l1TxFailedStore
46
+ };
47
+ }
48
+ export const proverTxSenderConfigMappings = {
49
+ ...l1ReaderConfigMappings,
50
+ proverPublisherPrivateKeys: {
51
+ env: `PROVER_PUBLISHER_PRIVATE_KEYS`,
52
+ description: 'The private keys to be used by the prover publisher.',
53
+ parseEnv: (val)=>val.split(',').map((key)=>new SecretValue(`0x${key.replace('0x', '')}`)),
54
+ defaultValue: [],
55
+ fallback: [
56
+ `PROVER_PUBLISHER_PRIVATE_KEY`
57
+ ]
58
+ },
59
+ proverPublisherAddresses: {
60
+ env: `PROVER_PUBLISHER_ADDRESSES`,
61
+ description: 'The addresses of the publishers to use with remote signers',
62
+ parseEnv: (val)=>val.split(',').map((address)=>EthAddress.fromString(address)),
63
+ defaultValue: []
64
+ }
65
+ };
66
+ export const sequencerTxSenderConfigMappings = {
67
+ ...l1ReaderConfigMappings,
68
+ sequencerPublisherPrivateKeys: {
69
+ env: `SEQ_PUBLISHER_PRIVATE_KEYS`,
70
+ description: 'The private keys to be used by the sequencer publisher.',
71
+ parseEnv: (val)=>val.split(',').map((key)=>new SecretValue(`0x${key.replace('0x', '')}`)),
72
+ defaultValue: [],
73
+ fallback: [
74
+ `SEQ_PUBLISHER_PRIVATE_KEY`
75
+ ]
76
+ },
77
+ sequencerPublisherAddresses: {
78
+ env: `SEQ_PUBLISHER_ADDRESSES`,
79
+ description: 'The addresses of the publishers to use with remote signers',
80
+ parseEnv: (val)=>val.split(',').map((address)=>EthAddress.fromString(address)),
81
+ defaultValue: []
82
+ }
83
+ };
84
+ export const sequencerPublisherConfigMappings = {
85
+ ...l1TxUtilsConfigMappings,
86
+ ...blobClientConfigMapping,
87
+ sequencerPublisherAllowInvalidStates: {
88
+ env: `SEQ_PUBLISHER_ALLOW_INVALID_STATES`,
89
+ description: 'True to use publishers in invalid states (timed out, cancelled, etc) if no other is available',
90
+ ...booleanConfigHelper(true)
91
+ },
92
+ fishermanMode: {
93
+ env: 'FISHERMAN_MODE',
94
+ description: 'Whether to run in fisherman mode: builds blocks on every slot for validation without publishing to L1',
95
+ ...booleanConfigHelper(false)
96
+ },
97
+ sequencerPublisherForwarderAddress: {
98
+ env: `SEQ_PUBLISHER_FORWARDER_ADDRESS`,
99
+ description: 'Address of the forwarder contract to wrap all L1 transactions through (for testing purposes only)',
100
+ parseEnv: (val)=>EthAddress.fromString(val)
101
+ },
102
+ sequencerPublisherPreviousL1BlockWaitTimeoutMs: {
103
+ env: `SEQ_PUBLISHER_PREVIOUS_L1_BLOCK_WAIT_TIMEOUT_MS`,
104
+ description: 'How long to wait for the previous L1 block before sending scheduled publisher txs anyway, in milliseconds.',
105
+ ...numberConfigHelper(8_000)
106
+ },
107
+ sequencerPublisherPreviousL1BlockWaitPollIntervalMs: {
108
+ env: `SEQ_PUBLISHER_PREVIOUS_L1_BLOCK_WAIT_POLL_INTERVAL_MS`,
109
+ description: 'Poll interval while waiting for the previous L1 block before scheduled publisher txs, in milliseconds.',
110
+ ...numberConfigHelper(500)
111
+ },
112
+ l1TxFailedStore: {
113
+ env: 'L1_TX_FAILED_STORE',
114
+ description: 'Store for failed L1 transaction inputs (test networks only). Format: gs://bucket/path'
115
+ },
116
+ ...publisherFundingConfigMappings
117
+ };
118
+ export const proverPublisherConfigMappings = {
119
+ ...l1TxUtilsConfigMappings,
120
+ ...blobClientConfigMapping,
121
+ proverPublisherAllowInvalidStates: {
122
+ env: `PROVER_PUBLISHER_ALLOW_INVALID_STATES`,
123
+ description: 'True to use publishers in invalid states (timed out, cancelled, etc) if no other is available',
124
+ ...booleanConfigHelper(true)
125
+ },
126
+ fishermanMode: {
127
+ env: 'FISHERMAN_MODE',
128
+ description: 'Whether to run in fisherman mode: builds blocks on every slot for validation without publishing to L1',
129
+ ...booleanConfigHelper(false)
130
+ },
131
+ proverPublisherForwarderAddress: {
132
+ env: `PROVER_PUBLISHER_FORWARDER_ADDRESS`,
133
+ description: 'Address of the forwarder contract to wrap all L1 transactions through (for testing purposes only)',
134
+ parseEnv: (val)=>EthAddress.fromString(val)
135
+ },
136
+ ...publisherFundingConfigMappings
137
+ };
@@ -0,0 +1,5 @@
1
+ export { SequencerPublisher } from './sequencer-publisher.js';
2
+ export { SequencerPublisherFactory } from './sequencer-publisher-factory.js';
3
+ export { SequencerPublisherMetrics } from './sequencer-publisher-metrics.js';
4
+ export { type FailedL1Tx, type FailedL1TxUri, type L1TxFailedStore } from './l1_tx_failed_store/index.js';
5
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9wdWJsaXNoZXIvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxFQUFFLGtCQUFrQixFQUFFLE1BQU0sMEJBQTBCLENBQUM7QUFDOUQsT0FBTyxFQUFFLHlCQUF5QixFQUFFLE1BQU0sa0NBQWtDLENBQUM7QUFHN0UsT0FBTyxFQUFFLHlCQUF5QixFQUFFLE1BQU0sa0NBQWtDLENBQUM7QUFHN0UsT0FBTyxFQUFFLEtBQUssVUFBVSxFQUFFLEtBQUssYUFBYSxFQUFFLEtBQUssZUFBZSxFQUFFLE1BQU0sK0JBQStCLENBQUMifQ==
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/publisher/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAG7E,OAAO,EAAE,yBAAyB,EAAE,MAAM,kCAAkC,CAAC;AAG7E,OAAO,EAAE,KAAK,UAAU,EAAE,KAAK,aAAa,EAAE,KAAK,eAAe,EAAE,MAAM,+BAA+B,CAAC"}
@@ -0,0 +1,4 @@
1
+ export { SequencerPublisher } from './sequencer-publisher.js';
2
+ export { SequencerPublisherFactory } from './sequencer-publisher-factory.js';
3
+ // Used for tests
4
+ export { SequencerPublisherMetrics } from './sequencer-publisher-metrics.js';
@@ -0,0 +1,21 @@
1
+ import type { L1ContractAddresses } from '@aztec-labs/ethereum/l1-contract-addresses';
2
+ import type { ExtendedViemWalletClient } from '@aztec-labs/ethereum/types';
3
+ import { Fr } from '@aztec-labs/foundation/curves/bn254';
4
+ import type { AztecAddress } from '@aztec-labs/stdlib/aztec-address';
5
+ /**
6
+ * Sends an L1-to-L2 message via the Inbox contract and returns its hash and global leaf index.
7
+ * Test helper copied from the end-to-end fixtures so this integration test can live in sequencer-client.
8
+ */
9
+ export declare function sendL1ToL2Message(message: {
10
+ recipient: AztecAddress;
11
+ content: Fr;
12
+ secretHash: Fr;
13
+ }, ctx: {
14
+ l1Client: ExtendedViemWalletClient;
15
+ l1ContractAddresses: Pick<L1ContractAddresses, 'inboxAddress' | 'rollupAddress'>;
16
+ }): Promise<{
17
+ msgHash: Fr;
18
+ globalLeafIndex: Fr;
19
+ txReceipt: import("viem").TransactionReceipt;
20
+ }>;
21
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibDFfdG9fbDJfbWVzc2FnaW5nLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvcHVibGlzaGVyL2wxX3RvX2wyX21lc3NhZ2luZy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFHQSxPQUFPLEtBQUssRUFBRSxtQkFBbUIsRUFBRSxNQUFNLDRDQUE0QyxDQUFDO0FBQ3RGLE9BQU8sS0FBSyxFQUFFLHdCQUF3QixFQUFFLE1BQU0sNEJBQTRCLENBQUM7QUFDM0UsT0FBTyxFQUFFLEVBQUUsRUFBRSxNQUFNLHFDQUFxQyxDQUFDO0FBR3pELE9BQU8sS0FBSyxFQUFFLFlBQVksRUFBRSxNQUFNLGtDQUFrQyxDQUFDO0FBR3JFOzs7R0FHRztBQUNILHdCQUFzQixpQkFBaUIsQ0FDckMsT0FBTyxFQUFFO0lBQUUsU0FBUyxFQUFFLFlBQVksQ0FBQztJQUFDLE9BQU8sRUFBRSxFQUFFLENBQUM7SUFBQyxVQUFVLEVBQUUsRUFBRSxDQUFBO0NBQUUsRUFDakUsR0FBRyxFQUFFO0lBQ0gsUUFBUSxFQUFFLHdCQUF3QixDQUFDO0lBQ25DLG1CQUFtQixFQUFFLElBQUksQ0FBQyxtQkFBbUIsRUFBRSxjQUFjLEdBQUcsZUFBZSxDQUFDLENBQUM7Q0FDbEY7Ozs7R0FnRUYifQ==
@@ -0,0 +1 @@
1
+ {"version":3,"file":"l1_to_l2_messaging.d.ts","sourceRoot":"","sources":["../../src/publisher/l1_to_l2_messaging.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AACtF,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AAC3E,OAAO,EAAE,EAAE,EAAE,MAAM,qCAAqC,CAAC;AAGzD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kCAAkC,CAAC;AAGrE;;;GAGG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE;IAAE,SAAS,EAAE,YAAY,CAAC;IAAC,OAAO,EAAE,EAAE,CAAC;IAAC,UAAU,EAAE,EAAE,CAAA;CAAE,EACjE,GAAG,EAAE;IACH,QAAQ,EAAE,wBAAwB,CAAC;IACnC,mBAAmB,EAAE,IAAI,CAAC,mBAAmB,EAAE,cAAc,GAAG,eAAe,CAAC,CAAC;CAClF;;;;GAgEF"}
@@ -0,0 +1,70 @@
1
+ import { InboxAbi } from '@aztec/l1-artifacts';
2
+ import { RollupContract } from '@aztec-labs/ethereum/contracts';
3
+ import { Fr } from '@aztec-labs/foundation/curves/bn254';
4
+ import { tryJsonStringify } from '@aztec-labs/foundation/json-rpc';
5
+ import { createLogger } from '@aztec-labs/foundation/log';
6
+ import { decodeEventLog, getContract } from 'viem';
7
+ /**
8
+ * Sends an L1-to-L2 message via the Inbox contract and returns its hash and global leaf index.
9
+ * Test helper copied from the end-to-end fixtures so this integration test can live in sequencer-client.
10
+ */ export async function sendL1ToL2Message(message, ctx) {
11
+ const logger = createLogger('sequencer-client:l1_to_l2_messaging');
12
+ const inbox = getContract({
13
+ address: ctx.l1ContractAddresses.inboxAddress.toString(),
14
+ abi: InboxAbi,
15
+ client: ctx.l1Client
16
+ });
17
+ const { recipient, content, secretHash } = message;
18
+ const version = await new RollupContract(ctx.l1Client, ctx.l1ContractAddresses.rollupAddress.toString()).getVersion();
19
+ // We inject the message to Inbox
20
+ const txHash = await inbox.write.sendL2Message([
21
+ {
22
+ actor: recipient.toString(),
23
+ version: BigInt(version)
24
+ },
25
+ content.toString(),
26
+ secretHash.toString()
27
+ ], {
28
+ gas: 1_000_000n
29
+ });
30
+ logger.info(`L1 to L2 message sent in tx ${txHash}`);
31
+ // We check that the message was correctly injected by checking the emitted event
32
+ const txReceipt = await ctx.l1Client.waitForTransactionReceipt({
33
+ hash: txHash
34
+ });
35
+ if (txReceipt.status !== 'success') {
36
+ throw new Error(`L1 to L2 message failed to be sent in tx ${txHash}. Status: ${txReceipt.status}`);
37
+ }
38
+ logger.info(`L1 to L2 message receipt retrieved for tx ${txReceipt.transactionHash}`, txReceipt);
39
+ if (txReceipt.transactionHash !== txHash) {
40
+ throw new Error(`Receipt transaction hash mismatch: ${txReceipt.transactionHash} !== ${txHash}`);
41
+ }
42
+ // Filter for MessageSent events from the Inbox contract by trying to decode each log
43
+ const messageSentLogs = txReceipt.logs.filter((log)=>log.address.toLowerCase() === ctx.l1ContractAddresses.inboxAddress.toString().toLowerCase()).map((log)=>{
44
+ try {
45
+ const decoded = decodeEventLog({
46
+ abi: InboxAbi,
47
+ data: log.data,
48
+ topics: log.topics
49
+ });
50
+ return {
51
+ log,
52
+ decoded
53
+ };
54
+ } catch {
55
+ return null; // Not a decodable event from this ABI
56
+ }
57
+ }).filter((item)=>item !== null && item.decoded.eventName === 'MessageSent');
58
+ if (messageSentLogs.length !== 1) {
59
+ throw new Error(`Wrong number of MessageSent logs found in ${txHash} transaction (got ${messageSentLogs.length} expected 1)\n${tryJsonStringify(messageSentLogs.map((item)=>item.log))}`);
60
+ }
61
+ // We already have the decoded event
62
+ const topics = messageSentLogs[0].decoded;
63
+ const receivedMsgHash = topics.args.hash;
64
+ const receivedGlobalLeafIndex = topics.args.message.index;
65
+ return {
66
+ msgHash: Fr.fromHexString(receivedMsgHash),
67
+ globalLeafIndex: new Fr(receivedGlobalLeafIndex),
68
+ txReceipt
69
+ };
70
+ }
@@ -0,0 +1,11 @@
1
+ import { type Logger } from '@aztec-labs/foundation/log';
2
+ import type { L1TxFailedStore } from './failed_tx_store.js';
3
+ /**
4
+ * Creates an L1TxFailedStore from a config string.
5
+ * Supports any backend that FileStore supports (GCS, S3, R2, local filesystem).
6
+ * @param config - Config string (e.g., 'gs://bucket/path', 's3://bucket/path', 'file:///path'). If undefined, returns undefined.
7
+ * @param logger - Optional logger.
8
+ * @returns The store instance, or undefined if config is not provided.
9
+ */
10
+ export declare function createL1TxFailedStore(config: string | undefined, logger?: Logger): Promise<L1TxFailedStore | undefined>;
11
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmFjdG9yeS5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL3B1Ymxpc2hlci9sMV90eF9mYWlsZWRfc3RvcmUvZmFjdG9yeS50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEVBQUUsS0FBSyxNQUFNLEVBQWdCLE1BQU0sNEJBQTRCLENBQUM7QUFHdkUsT0FBTyxLQUFLLEVBQUUsZUFBZSxFQUFFLE1BQU0sc0JBQXNCLENBQUM7QUFHNUQ7Ozs7OztHQU1HO0FBQ0gsd0JBQXNCLHFCQUFxQixDQUN6QyxNQUFNLEVBQUUsTUFBTSxHQUFHLFNBQVMsRUFDMUIsTUFBTSxHQUFFLE1BQXFELEdBQzVELE9BQU8sQ0FBQyxlQUFlLEdBQUcsU0FBUyxDQUFDLENBZXRDIn0=
@@ -0,0 +1 @@
1
+ {"version":3,"file":"factory.d.ts","sourceRoot":"","sources":["../../../src/publisher/l1_tx_failed_store/factory.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAgB,MAAM,4BAA4B,CAAC;AAGvE,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAG5D;;;;;;GAMG;AACH,wBAAsB,qBAAqB,CACzC,MAAM,EAAE,MAAM,GAAG,SAAS,EAC1B,MAAM,GAAE,MAAqD,GAC5D,OAAO,CAAC,eAAe,GAAG,SAAS,CAAC,CAetC"}
@@ -0,0 +1,22 @@
1
+ import { createLogger } from '@aztec-labs/foundation/log';
2
+ import { createFileStore } from '@aztec-labs/stdlib/file-store';
3
+ import { FileStoreL1TxFailedStore } from './file_store_failed_tx_store.js';
4
+ /**
5
+ * Creates an L1TxFailedStore from a config string.
6
+ * Supports any backend that FileStore supports (GCS, S3, R2, local filesystem).
7
+ * @param config - Config string (e.g., 'gs://bucket/path', 's3://bucket/path', 'file:///path'). If undefined, returns undefined.
8
+ * @param logger - Optional logger.
9
+ * @returns The store instance, or undefined if config is not provided.
10
+ */ export async function createL1TxFailedStore(config, logger = createLogger('sequencer:l1-tx-failed-store')) {
11
+ if (!config) {
12
+ return undefined;
13
+ }
14
+ const fileStore = await createFileStore(config, logger);
15
+ if (!fileStore) {
16
+ throw new Error(`Failed to create file store from config: '${config}'. ` + `Supported formats: 'gs://bucket/path', 's3://bucket/path', 'file:///path'.`);
17
+ }
18
+ logger.info(`Created L1 tx failed store`, {
19
+ config
20
+ });
21
+ return new FileStoreL1TxFailedStore(fileStore, logger);
22
+ }
@@ -0,0 +1,101 @@
1
+ import type { WindowBlockFees } from '@aztec-labs/ethereum/l1-fee-analysis';
2
+ import type { FeesPerGas } from '@aztec-labs/ethereum/l1-tx-utils';
3
+ import type { Branded } from '@aztec-labs/foundation/branded-types';
4
+ import { type ZodFor } from '@aztec-labs/foundation/schemas';
5
+ import type { Hex } from 'viem';
6
+ /** URI pointing to a stored failed L1 transaction. */
7
+ export type FailedL1TxUri = Branded<string, 'FailedL1TxUri'>;
8
+ /**
9
+ * A failed L1 transaction captured for debugging and replay. Serialized with jsonStringify (bigints
10
+ * become decimal strings on disk) and parsed back via FailedL1TxSchema.
11
+ */
12
+ export type FailedL1Tx = {
13
+ /** Tx hash (for reverts) or keccak256(request.data) (for simulation/send failures). */
14
+ id: Hex;
15
+ /** Unix timestamp (ms) when failure occurred. */
16
+ timestamp: number;
17
+ /** How the failure occurred. */
18
+ failureType: 'simulation' | 'revert' | 'send-error' | 'timeout';
19
+ /** The actual L1 transaction for replay (multicall-encoded for bundled txs). */
20
+ request: {
21
+ to: Hex;
22
+ data: Hex;
23
+ value?: bigint;
24
+ };
25
+ /** Raw blob data as hex for replay. */
26
+ blobData?: Hex[];
27
+ /** L1 block number at time of failure (simulation target or receipt block). */
28
+ l1BlockNumber: bigint;
29
+ /** Receipt info (present only for on-chain reverts). */
30
+ receipt?: {
31
+ transactionHash: Hex;
32
+ blockNumber: bigint;
33
+ gasUsed: bigint;
34
+ status: 'reverted';
35
+ };
36
+ /** Error information. */
37
+ error: {
38
+ message: string;
39
+ /** Decoded error name (e.g., 'Rollup__InvalidProposer'). */
40
+ name?: string;
41
+ };
42
+ /** Context metadata. */
43
+ context: {
44
+ /** Actions involved (e.g., ['propose', 'governance-signal']). */
45
+ actions: string[];
46
+ /** Individual request data for each action (metadata, not used for replay). */
47
+ requests?: Array<{
48
+ action: string;
49
+ to: Hex;
50
+ data: Hex;
51
+ }>;
52
+ checkpointNumber?: number;
53
+ slot?: number;
54
+ sender: Hex;
55
+ };
56
+ /** Gas pricing info at time of failure for underpricing diagnosis. */
57
+ gasInfo?: {
58
+ /**
59
+ * Fees per gas the tx was sent with (present for revert/send-error/timeout, not simulation). Records written before
60
+ * this field was renamed spell it `sentGasPrice`, and parse back without it.
61
+ */
62
+ sentFeesPerGas?: FeesPerGas;
63
+ /** Gas limit used or estimated. */
64
+ gasLimit?: bigint;
65
+ /** Nonce used for the sent tx. */
66
+ nonce?: number;
67
+ /**
68
+ * For timeouts: the escalating fees per gas used across the initial send and each speed-up retry, in order.
69
+ * Compare against windowBlocks[].minIncludedPriorityFee to see if any attempt cleared the bar.
70
+ */
71
+ sentFeesPerGasLadder?: FeesPerGas[];
72
+ /** Number of send attempts (initial send + speed-ups). */
73
+ attempts?: number;
74
+ /**
75
+ * Per-block fee data for the L1 blocks the tx could have been included in (the target L2 slot's
76
+ * inclusion window), in chronological order. Compare sentFeesPerGas against these to see whether
77
+ * the tx was underpriced for each block it competed for. May be a partial or empty list if the
78
+ * window was not yet mined when the failure was recorded (e.g. an early send failure).
79
+ */
80
+ windowBlocks?: WindowBlockFees[];
81
+ };
82
+ /** Timing info relative to the L2 slot. */
83
+ timing?: {
84
+ /** The target L2 slot this tx was for. */
85
+ targetL2Slot?: number;
86
+ /** Unix timestamp (seconds) when the target slot ends. */
87
+ slotDeadlineTimestampS?: bigint;
88
+ /** Milliseconds remaining until the slot deadline. Negative = past deadline. */
89
+ msUntilSlotDeadline?: number;
90
+ };
91
+ };
92
+ /** Parses a stored failed-tx record, coercing the on-disk decimal strings back to bigints. */
93
+ export declare const FailedL1TxSchema: ZodFor<FailedL1Tx>;
94
+ /** Store for failed L1 transactions for debugging purposes. */
95
+ export interface L1TxFailedStore {
96
+ /** Saves a failed transaction and returns its URI. */
97
+ saveFailedTx(tx: FailedL1Tx): Promise<FailedL1TxUri>;
98
+ /** Retrieves a failed transaction by its URI. */
99
+ getFailedTx(uri: FailedL1TxUri): Promise<FailedL1Tx>;
100
+ }
101
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZmFpbGVkX3R4X3N0b3JlLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvcHVibGlzaGVyL2wxX3R4X2ZhaWxlZF9zdG9yZS9mYWlsZWRfdHhfc3RvcmUudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsT0FBTyxLQUFLLEVBQUUsZUFBZSxFQUFFLE1BQU0sc0NBQXNDLENBQUM7QUFDNUUsT0FBTyxLQUFLLEVBQUUsVUFBVSxFQUFFLE1BQU0sa0NBQWtDLENBQUM7QUF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A0D;QAC1D,QAAQ,CAAC,EAAE,MAAM,CAAC;QAClB;;;;;WAKG;QACH,YAAY,CAAC,EAAE,eAAe,EAAE,CAAC;KAClC,CAAC;IACF,2CAA2C;IAC3C,MAAM,CAAC,EAAE;QACP,0CAA0C;QAC1C,YAAY,CAAC,EAAE,MAAM,CAAC;QACtB,0DAA0D;QAC1D,sBAAsB,CAAC,EAAE,MAAM,CAAC;QAChC,gFAAgF;QAChF,mBAAmB,CAAC,EAAE,MAAM,CAAC;KAC9B,CAAC;CACH,CAAC;AAoBF,8FAA8F;AAC9F,eAAO,MAAM,gBAAgB,EAAE,MAAM,CAAC,UAAU,CA+C9C,CAAC;AAEH,+DAA+D;AAC/D,MAAM,WAAW,eAAe;IAC9B,sDAAsD;IACtD,YAAY,CAAC,EAAE,EAAE,UAAU,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;IACrD,iDAAiD;IACjD,WAAW,CAAC,GAAG,EAAE,aAAa,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC;CACtD"}
@@ -0,0 +1,68 @@
1
+ import { schemas } from '@aztec-labs/foundation/schemas';
2
+ import { z } from 'zod';
3
+ const hexSchema = schemas.HexStringWith0x;
4
+ const feesPerGasSchema = z.object({
5
+ maxFeePerGas: schemas.BigInt,
6
+ maxPriorityFeePerGas: schemas.BigInt,
7
+ maxFeePerBlobGas: schemas.BigInt.optional()
8
+ });
9
+ const windowBlockFeesSchema = z.object({
10
+ blockNumber: schemas.BigInt,
11
+ timestamp: schemas.BigInt,
12
+ baseFeePerGas: schemas.BigInt,
13
+ p75PriorityFee: schemas.BigInt,
14
+ minIncludedPriorityFee: schemas.BigInt,
15
+ blockBlobsFull: z.boolean(),
16
+ includedBlobCount: z.number()
17
+ });
18
+ /** Parses a stored failed-tx record, coercing the on-disk decimal strings back to bigints. */ export const FailedL1TxSchema = z.object({
19
+ id: hexSchema,
20
+ timestamp: z.number(),
21
+ failureType: z.enum([
22
+ 'simulation',
23
+ 'revert',
24
+ 'send-error',
25
+ 'timeout'
26
+ ]),
27
+ request: z.object({
28
+ to: hexSchema,
29
+ data: hexSchema,
30
+ value: schemas.BigInt.optional()
31
+ }),
32
+ blobData: z.array(hexSchema).optional(),
33
+ l1BlockNumber: schemas.BigInt,
34
+ receipt: z.object({
35
+ transactionHash: hexSchema,
36
+ blockNumber: schemas.BigInt,
37
+ gasUsed: schemas.BigInt,
38
+ status: z.literal('reverted')
39
+ }).optional(),
40
+ error: z.object({
41
+ message: z.string(),
42
+ name: z.string().optional()
43
+ }),
44
+ context: z.object({
45
+ actions: z.array(z.string()),
46
+ requests: z.array(z.object({
47
+ action: z.string(),
48
+ to: hexSchema,
49
+ data: hexSchema
50
+ })).optional(),
51
+ checkpointNumber: z.number().optional(),
52
+ slot: z.number().optional(),
53
+ sender: hexSchema
54
+ }),
55
+ gasInfo: z.object({
56
+ sentFeesPerGas: feesPerGasSchema.optional(),
57
+ gasLimit: schemas.BigInt.optional(),
58
+ nonce: z.number().optional(),
59
+ sentFeesPerGasLadder: z.array(feesPerGasSchema).optional(),
60
+ attempts: z.number().optional(),
61
+ windowBlocks: z.array(windowBlockFeesSchema).optional()
62
+ }).optional(),
63
+ timing: z.object({
64
+ targetL2Slot: z.number().optional(),
65
+ slotDeadlineTimestampS: schemas.BigInt.optional(),
66
+ msUntilSlotDeadline: z.number().optional()
67
+ }).optional()
68
+ });