@aztec/ethereum 0.0.1-commit.f504929 → 0.0.1-commit.f5d02921e

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 (46) hide show
  1. package/dest/client.d.ts +10 -2
  2. package/dest/client.d.ts.map +1 -1
  3. package/dest/client.js +13 -7
  4. package/dest/contracts/multicall.d.ts +51 -2
  5. package/dest/contracts/multicall.d.ts.map +1 -1
  6. package/dest/contracts/multicall.js +85 -0
  7. package/dest/contracts/rollup.d.ts +41 -5
  8. package/dest/contracts/rollup.d.ts.map +1 -1
  9. package/dest/contracts/rollup.js +197 -15
  10. package/dest/l1_artifacts.d.ts +69 -69
  11. package/dest/l1_reader.d.ts +3 -1
  12. package/dest/l1_reader.d.ts.map +1 -1
  13. package/dest/l1_reader.js +6 -1
  14. package/dest/l1_tx_utils/l1_tx_utils.d.ts +3 -1
  15. package/dest/l1_tx_utils/l1_tx_utils.d.ts.map +1 -1
  16. package/dest/l1_tx_utils/l1_tx_utils.js +33 -25
  17. package/dest/l1_tx_utils/readonly_l1_tx_utils.d.ts +1 -1
  18. package/dest/l1_tx_utils/readonly_l1_tx_utils.d.ts.map +1 -1
  19. package/dest/l1_tx_utils/readonly_l1_tx_utils.js +8 -4
  20. package/dest/publisher_manager.d.ts +21 -7
  21. package/dest/publisher_manager.d.ts.map +1 -1
  22. package/dest/publisher_manager.js +81 -7
  23. package/dest/test/chain_monitor.d.ts +22 -3
  24. package/dest/test/chain_monitor.d.ts.map +1 -1
  25. package/dest/test/chain_monitor.js +33 -2
  26. package/dest/test/eth_cheat_codes.d.ts +6 -4
  27. package/dest/test/eth_cheat_codes.d.ts.map +1 -1
  28. package/dest/test/eth_cheat_codes.js +6 -4
  29. package/dest/test/start_anvil.d.ts +15 -1
  30. package/dest/test/start_anvil.d.ts.map +1 -1
  31. package/dest/test/start_anvil.js +17 -2
  32. package/dest/utils.d.ts +1 -1
  33. package/dest/utils.d.ts.map +1 -1
  34. package/dest/utils.js +16 -12
  35. package/package.json +5 -5
  36. package/src/client.ts +10 -2
  37. package/src/contracts/multicall.ts +65 -1
  38. package/src/contracts/rollup.ts +224 -23
  39. package/src/l1_reader.ts +13 -1
  40. package/src/l1_tx_utils/l1_tx_utils.ts +23 -13
  41. package/src/l1_tx_utils/readonly_l1_tx_utils.ts +8 -4
  42. package/src/publisher_manager.ts +105 -10
  43. package/src/test/chain_monitor.ts +60 -3
  44. package/src/test/eth_cheat_codes.ts +6 -4
  45. package/src/test/start_anvil.ts +33 -2
  46. package/src/utils.ts +17 -14
@@ -376,12 +376,13 @@ import { Buffer32 } from '@aztec/foundation/buffer';
376
376
  import { Fr } from '@aztec/foundation/curves/bn254';
377
377
  import { memoize } from '@aztec/foundation/decorators';
378
378
  import { EthAddress } from '@aztec/foundation/eth-address';
379
+ import { createLogger } from '@aztec/foundation/log';
379
380
  import { makeBackoff, retry } from '@aztec/foundation/retry';
380
381
  import { EscapeHatchAbi } from '@aztec/l1-artifacts/EscapeHatchAbi';
381
382
  import { RollupAbi } from '@aztec/l1-artifacts/RollupAbi';
382
383
  import { RollupStorage } from '@aztec/l1-artifacts/RollupStorage';
383
384
  import chunk from 'lodash.chunk';
384
- import { encodeFunctionData, getContract, hexToBigInt, keccak256 } from 'viem';
385
+ import { encodeAbiParameters, encodeFunctionData, getContract, hexToBigInt, keccak256 } from 'viem';
385
386
  import { getPublicClient } from '../client.js';
386
387
  import { formatViemError } from '../utils.js';
387
388
  import { EmpireSlashingProposerContract } from './empire_slashing_proposer.js';
@@ -499,6 +500,16 @@ export class RollupContract {
499
500
  2,
500
501
  "getGenesisArchiveTreeRoot"
501
502
  ],
503
+ [
504
+ memoize,
505
+ 2,
506
+ "getVkTreeRoot"
507
+ ],
508
+ [
509
+ memoize,
510
+ 2,
511
+ "getProtocolContractsHash"
512
+ ],
502
513
  [
503
514
  memoize,
504
515
  2,
@@ -507,6 +518,7 @@ export class RollupContract {
507
518
  ], []));
508
519
  }
509
520
  rollup;
521
+ logger;
510
522
  static cachedStfStorageSlot;
511
523
  cachedEscapeHatch;
512
524
  static get checkBlobStorageSlot() {
@@ -530,7 +542,7 @@ export class RollupContract {
530
542
  }
531
543
  constructor(client, address){
532
544
  this.client = client;
533
- _initProto(this);
545
+ this.logger = (_initProto(this), createLogger('ethereum:rollup'));
534
546
  if (address instanceof EthAddress) {
535
547
  address = address.toString();
536
548
  }
@@ -640,18 +652,35 @@ export class RollupContract {
640
652
  0n
641
653
  ]));
642
654
  }
655
+ async getVkTreeRoot() {
656
+ const slot = BigInt(RollupContract.stfStorageSlot) + 3n;
657
+ const value = await this.client.getStorageAt({
658
+ address: this.address,
659
+ slot: `0x${slot.toString(16)}`
660
+ });
661
+ return Fr.fromString(value ?? '0x0');
662
+ }
663
+ async getProtocolContractsHash() {
664
+ const slot = BigInt(RollupContract.stfStorageSlot) + 4n;
665
+ const value = await this.client.getStorageAt({
666
+ address: this.address,
667
+ slot: `0x${slot.toString(16)}`
668
+ });
669
+ return Fr.fromString(value ?? '0x0');
670
+ }
643
671
  /**
644
672
  * Returns rollup constants used for epoch queries.
645
673
  * Return type is `L1RollupConstants` which is defined in stdlib,
646
674
  * so we cant reference it until we move this contract to that package.
647
675
  */ async getRollupConstants() {
648
- const [l1StartBlock, l1GenesisTime, slotDuration, epochDuration, proofSubmissionEpochs, targetCommitteeSize] = await Promise.all([
676
+ const [l1StartBlock, l1GenesisTime, slotDuration, epochDuration, proofSubmissionEpochs, targetCommitteeSize, rollupManaLimit] = await Promise.all([
649
677
  this.getL1StartBlock(),
650
678
  this.getL1GenesisTime(),
651
679
  this.getSlotDuration(),
652
680
  this.getEpochDuration(),
653
681
  this.getProofSubmissionEpochs(),
654
- this.getTargetCommitteeSize()
682
+ this.getTargetCommitteeSize(),
683
+ this.getManaLimit()
655
684
  ]);
656
685
  return {
657
686
  l1StartBlock,
@@ -659,7 +688,8 @@ export class RollupContract {
659
688
  slotDuration,
660
689
  epochDuration: Number(epochDuration),
661
690
  proofSubmissionEpochs: Number(proofSubmissionEpochs),
662
- targetCommitteeSize
691
+ targetCommitteeSize,
692
+ rollupManaLimit: Number(rollupManaLimit)
663
693
  };
664
694
  }
665
695
  async getSlasherAddress() {
@@ -705,7 +735,11 @@ export class RollupContract {
705
735
  BigInt(epoch)
706
736
  ]);
707
737
  return isOpen;
708
- } catch {
738
+ } catch (err) {
739
+ this.logger.warn('isEscapeHatchOpen failed (treating as closed); RPC or contract error may cause liveness risk', {
740
+ epoch: Number(epoch),
741
+ error: err
742
+ });
709
743
  return false;
710
744
  }
711
745
  }
@@ -737,8 +771,9 @@ export class RollupContract {
737
771
  async getCheckpointNumber() {
738
772
  return CheckpointNumber.fromBigInt(await this.rollup.read.getPendingCheckpointNumber());
739
773
  }
740
- async getProvenCheckpointNumber() {
741
- return CheckpointNumber.fromBigInt(await this.rollup.read.getProvenCheckpointNumber());
774
+ async getProvenCheckpointNumber(options) {
775
+ await checkBlockTag(options?.blockNumber, this.client);
776
+ return CheckpointNumber.fromBigInt(await this.rollup.read.getProvenCheckpointNumber(options));
742
777
  }
743
778
  async getSlotNumber() {
744
779
  return SlotNumber.fromBigInt(await this.rollup.read.getCurrentSlot());
@@ -937,10 +972,10 @@ export class RollupContract {
937
972
  * @return [slot, checkpointNumber, timeOfNextL1Slot] - If you can propose, the L2 slot number, checkpoint number and
938
973
  * timestamp of the next L1 block
939
974
  * @throws otherwise
940
- */ async canProposeAtNextEthBlock(archive, account, slotDuration, opts = {}) {
941
- const latestBlock = await this.client.getBlock();
942
- const timeOfNextL1Slot = latestBlock.timestamp + BigInt(slotDuration);
975
+ */ async canProposeAt(archive, account, timestamp, opts = {}) {
976
+ const timeOfNextL1Slot = timestamp;
943
977
  const who = typeof account === 'string' ? account : account.address;
978
+ const stateOverride = RollupContract.mergeStateOverrides(await this.makePendingCheckpointNumberOverride(opts.forcePendingCheckpointNumber), opts.forceArchive ? this.makeArchiveOverride(opts.forceArchive.checkpointNumber, opts.forceArchive.archive) : []);
944
979
  try {
945
980
  const { result: [slot, checkpointNumber] } = await this.client.simulateContract({
946
981
  address: this.address,
@@ -952,7 +987,7 @@ export class RollupContract {
952
987
  who
953
988
  ],
954
989
  account,
955
- stateOverride: await this.makePendingCheckpointNumberOverride(opts.forcePendingCheckpointNumber)
990
+ stateOverride
956
991
  });
957
992
  return {
958
993
  slot: SlotNumber.fromBigInt(slot),
@@ -990,6 +1025,139 @@ export class RollupContract {
990
1025
  }
991
1026
  ];
992
1027
  }
1028
+ /**
1029
+ * Returns a state override that sets tempCheckpointLogs[checkpointNumber].feeHeader to the compressed fee header.
1030
+ * Used when simulating a propose call where the parent checkpoint hasn't landed on L1 yet (pipelining).
1031
+ */ async makeFeeHeaderOverride(checkpointNumber, feeHeader) {
1032
+ const { epochDuration, proofSubmissionEpochs } = await this.getRollupConstants();
1033
+ const roundaboutSize = BigInt(epochDuration * (proofSubmissionEpochs + 1) + 1);
1034
+ const circularIndex = BigInt(checkpointNumber) % roundaboutSize;
1035
+ // tempCheckpointLogs is at offset 2 in RollupStore
1036
+ const tempCheckpointLogsMappingBase = hexToBigInt(RollupContract.stfStorageSlot) + 2n;
1037
+ // Solidity mapping slot: keccak256(abi.encode(key, baseSlot))
1038
+ const structBaseSlot = hexToBigInt(keccak256(encodeAbiParameters([
1039
+ {
1040
+ type: 'uint256'
1041
+ },
1042
+ {
1043
+ type: 'uint256'
1044
+ }
1045
+ ], [
1046
+ circularIndex,
1047
+ tempCheckpointLogsMappingBase
1048
+ ])));
1049
+ // feeHeader is the 7th field (offset 6) in CompressedTempCheckpointLog
1050
+ const feeHeaderSlot = structBaseSlot + 6n;
1051
+ const compressed = RollupContract.compressFeeHeader(feeHeader);
1052
+ return [
1053
+ {
1054
+ address: this.address,
1055
+ stateDiff: [
1056
+ {
1057
+ slot: `0x${feeHeaderSlot.toString(16).padStart(64, '0')}`,
1058
+ value: `0x${compressed.toString(16).padStart(64, '0')}`
1059
+ }
1060
+ ]
1061
+ }
1062
+ ];
1063
+ }
1064
+ /**
1065
+ * Returns a state override that sets archives[checkpointNumber] to the given archive value.
1066
+ * Used when simulating a canProposeAtTime call where the local archive differs from L1
1067
+ * (e.g. pipelining where the parent checkpoint hasn't landed on L1 yet).
1068
+ */ makeArchiveOverride(checkpointNumber, archive) {
1069
+ const archivesMappingBase = hexToBigInt(RollupContract.stfStorageSlot) + 1n;
1070
+ const archiveSlot = hexToBigInt(keccak256(encodeAbiParameters([
1071
+ {
1072
+ type: 'uint256'
1073
+ },
1074
+ {
1075
+ type: 'uint256'
1076
+ }
1077
+ ], [
1078
+ BigInt(checkpointNumber),
1079
+ archivesMappingBase
1080
+ ])));
1081
+ return [
1082
+ {
1083
+ address: this.address,
1084
+ stateDiff: [
1085
+ {
1086
+ slot: `0x${archiveSlot.toString(16).padStart(64, '0')}`,
1087
+ value: archive.toString()
1088
+ }
1089
+ ]
1090
+ }
1091
+ ];
1092
+ }
1093
+ /** Merges multiple StateOverride arrays, combining stateDiff entries for the same address. */ static mergeStateOverrides(...overrides) {
1094
+ const byAddress = new Map();
1095
+ for (const override of overrides){
1096
+ for (const entry of override){
1097
+ const key = entry.address.toLowerCase();
1098
+ const existing = byAddress.get(key);
1099
+ if (existing) {
1100
+ existing.stateDiff.push(...entry.stateDiff ?? []);
1101
+ if (entry.balance !== undefined) {
1102
+ existing.balance = entry.balance;
1103
+ }
1104
+ } else {
1105
+ byAddress.set(key, {
1106
+ address: entry.address,
1107
+ balance: entry.balance,
1108
+ stateDiff: [
1109
+ ...entry.stateDiff ?? []
1110
+ ]
1111
+ });
1112
+ }
1113
+ }
1114
+ }
1115
+ return [
1116
+ ...byAddress.values()
1117
+ ];
1118
+ }
1119
+ /** Compresses a FeeHeader into a uint256 matching FeeHeaderLib.compress() in FeeStructs.sol. */ static compressFeeHeader(feeHeader) {
1120
+ const MASK_48_BITS = (1n << 48n) - 1n;
1121
+ const MASK_64_BITS = (1n << 64n) - 1n;
1122
+ const MASK_63_BITS = (1n << 63n) - 1n;
1123
+ let value = BigInt(feeHeader.manaUsed) & (1n << 32n) - 1n; // bits [0:31]
1124
+ value |= (feeHeader.excessMana < MASK_48_BITS ? feeHeader.excessMana : MASK_48_BITS) << 32n; // bits [32:79]
1125
+ value |= (BigInt(feeHeader.ethPerFeeAsset) & MASK_48_BITS) << 80n; // bits [80:127]
1126
+ value |= (feeHeader.congestionCost < MASK_64_BITS ? feeHeader.congestionCost : MASK_64_BITS) << 128n; // bits [128:191]
1127
+ value |= (feeHeader.proverCost < MASK_63_BITS ? feeHeader.proverCost : MASK_63_BITS) << 192n; // bits [192:254]
1128
+ value |= 1n << 255n; // preheat flag
1129
+ return value;
1130
+ }
1131
+ /** Computes the fee header for a child checkpoint given parent fee header and child data.
1132
+ * Must stay in sync with Solidity FeeLib.sol (computeNewEthPerFeeAsset, clampedAdd). */ static computeChildFeeHeader(parentFeeHeader, childManaUsed, feeAssetPriceModifier, manaTarget) {
1133
+ const MIN_ETH_PER_FEE_ASSET = 100n;
1134
+ const MAX_ETH_PER_FEE_ASSET = 100_000_000_000_000n; // 1e14, matches FeeLib.sol
1135
+ // excessMana = clampedAdd(parent.excessMana + parent.manaUsed, -manaTarget)
1136
+ const sum = parentFeeHeader.excessMana + parentFeeHeader.manaUsed;
1137
+ const excessMana = sum > manaTarget ? sum - manaTarget : 0n;
1138
+ // ethPerFeeAsset = computeNewEthPerFeeAsset(max(parent.ethPerFeeAsset, MIN), modifier)
1139
+ const parentPrice = parentFeeHeader.ethPerFeeAsset > MIN_ETH_PER_FEE_ASSET ? parentFeeHeader.ethPerFeeAsset : MIN_ETH_PER_FEE_ASSET;
1140
+ let newPrice;
1141
+ if (feeAssetPriceModifier >= 0n) {
1142
+ newPrice = parentPrice * (10_000n + feeAssetPriceModifier) / 10_000n;
1143
+ } else {
1144
+ const absMod = -feeAssetPriceModifier;
1145
+ newPrice = parentPrice * (10_000n - absMod) / 10_000n;
1146
+ }
1147
+ if (newPrice < MIN_ETH_PER_FEE_ASSET) {
1148
+ newPrice = MIN_ETH_PER_FEE_ASSET;
1149
+ }
1150
+ if (newPrice > MAX_ETH_PER_FEE_ASSET) {
1151
+ newPrice = MAX_ETH_PER_FEE_ASSET;
1152
+ }
1153
+ return {
1154
+ excessMana,
1155
+ manaUsed: childManaUsed,
1156
+ ethPerFeeAsset: newPrice,
1157
+ congestionCost: 0n,
1158
+ proverCost: 0n
1159
+ };
1160
+ }
993
1161
  /** Creates a request to Rollup#invalidateBadAttestation to be simulated or sent */ buildInvalidateBadAttestationRequest(checkpointNumber, attestationsAndSigners, committee, invalidIndex) {
994
1162
  return {
995
1163
  to: this.address,
@@ -1031,11 +1199,25 @@ export class RollupContract {
1031
1199
  prover
1032
1200
  ]);
1033
1201
  }
1034
- getManaMinFeeAt(timestamp, inFeeAsset) {
1202
+ getManaMinFeeAt(timestamp, inFeeAsset, stateOverride) {
1035
1203
  return this.rollup.read.getManaMinFeeAt([
1036
1204
  timestamp,
1037
1205
  inFeeAsset
1206
+ ], {
1207
+ stateOverride
1208
+ });
1209
+ }
1210
+ async getManaMinFeeComponentsAt(timestamp, inFeeAsset) {
1211
+ const result = await this.rollup.read.getManaMinFeeComponentsAt([
1212
+ timestamp,
1213
+ inFeeAsset
1038
1214
  ]);
1215
+ return {
1216
+ sequencerCost: result.sequencerCost,
1217
+ proverCost: result.proverCost,
1218
+ congestionCost: result.congestionCost,
1219
+ congestionMultiplier: result.congestionMultiplier
1220
+ };
1039
1221
  }
1040
1222
  async getSlotAt(timestamp) {
1041
1223
  return SlotNumber.fromBigInt(await this.rollup.read.getSlotAt([
@@ -1086,10 +1268,10 @@ export class RollupContract {
1086
1268
  prover
1087
1269
  ]);
1088
1270
  }
1089
- async getAttesters() {
1271
+ async getAttesters(timestamp) {
1090
1272
  const attesterSize = await this.getActiveAttesterCount();
1091
1273
  const gse = new GSEContract(this.client, await this.getGSE());
1092
- const ts = (await this.client.getBlock()).timestamp;
1274
+ const ts = timestamp ?? (await this.client.getBlock()).timestamp;
1093
1275
  const indices = Array.from({
1094
1276
  length: attesterSize
1095
1277
  }, (_, i)=>BigInt(i));
@@ -12032,100 +12032,100 @@ export declare const RollupArtifact: {
12032
12032
  readonly start: 1538;
12033
12033
  readonly length: 20;
12034
12034
  }, {
12035
- readonly start: 11838;
12035
+ readonly start: 11069;
12036
12036
  readonly length: 20;
12037
12037
  }, {
12038
- readonly start: 12451;
12038
+ readonly start: 11670;
12039
12039
  readonly length: 20;
12040
12040
  }, {
12041
- readonly start: 12689;
12041
+ readonly start: 11916;
12042
12042
  readonly length: 20;
12043
12043
  }, {
12044
- readonly start: 13139;
12044
+ readonly start: 12333;
12045
12045
  readonly length: 20;
12046
12046
  }, {
12047
- readonly start: 13375;
12047
+ readonly start: 12607;
12048
12048
  readonly length: 20;
12049
12049
  }, {
12050
- readonly start: 13548;
12050
+ readonly start: 12801;
12051
12051
  readonly length: 20;
12052
12052
  }, {
12053
- readonly start: 13631;
12053
+ readonly start: 12884;
12054
12054
  readonly length: 20;
12055
12055
  }, {
12056
- readonly start: 13884;
12056
+ readonly start: 13131;
12057
12057
  readonly length: 20;
12058
12058
  }, {
12059
- readonly start: 13921;
12059
+ readonly start: 13168;
12060
12060
  readonly length: 20;
12061
12061
  }, {
12062
- readonly start: 14024;
12062
+ readonly start: 13271;
12063
12063
  readonly length: 20;
12064
12064
  }, {
12065
- readonly start: 14258;
12065
+ readonly start: 13518;
12066
12066
  readonly length: 20;
12067
12067
  }, {
12068
- readonly start: 14451;
12068
+ readonly start: 13711;
12069
12069
  readonly length: 20;
12070
12070
  }, {
12071
- readonly start: 14783;
12071
+ readonly start: 14043;
12072
12072
  readonly length: 20;
12073
12073
  }, {
12074
- readonly start: 14954;
12074
+ readonly start: 14201;
12075
12075
  readonly length: 20;
12076
12076
  }, {
12077
- readonly start: 15236;
12077
+ readonly start: 14483;
12078
12078
  readonly length: 20;
12079
12079
  }, {
12080
- readonly start: 15603;
12080
+ readonly start: 14885;
12081
12081
  readonly length: 20;
12082
12082
  }, {
12083
- readonly start: 15704;
12083
+ readonly start: 14971;
12084
12084
  readonly length: 20;
12085
12085
  }, {
12086
- readonly start: 15811;
12086
+ readonly start: 15133;
12087
12087
  readonly length: 20;
12088
12088
  }, {
12089
- readonly start: 17559;
12089
+ readonly start: 16923;
12090
12090
  readonly length: 20;
12091
12091
  }, {
12092
- readonly start: 17678;
12092
+ readonly start: 17048;
12093
12093
  readonly length: 20;
12094
12094
  }, {
12095
- readonly start: 17774;
12095
+ readonly start: 17171;
12096
12096
  readonly length: 20;
12097
12097
  }, {
12098
- readonly start: 17905;
12098
+ readonly start: 17302;
12099
12099
  readonly length: 20;
12100
12100
  }, {
12101
- readonly start: 18029;
12101
+ readonly start: 17411;
12102
12102
  readonly length: 20;
12103
12103
  }, {
12104
- readonly start: 18993;
12104
+ readonly start: 18353;
12105
12105
  readonly length: 20;
12106
12106
  }, {
12107
- readonly start: 19332;
12107
+ readonly start: 18710;
12108
12108
  readonly length: 20;
12109
12109
  }];
12110
12110
  };
12111
12111
  readonly "src/core/libraries/rollup/RollupOperationsExtLib.sol": {
12112
12112
  readonly RollupOperationsExtLib: readonly [{
12113
- readonly start: 12840;
12113
+ readonly start: 12067;
12114
12114
  readonly length: 20;
12115
12115
  }, {
12116
- readonly start: 15491;
12116
+ readonly start: 14773;
12117
12117
  readonly length: 20;
12118
12118
  }, {
12119
- readonly start: 15970;
12119
+ readonly start: 15292;
12120
12120
  readonly length: 20;
12121
12121
  }, {
12122
- readonly start: 16321;
12122
+ readonly start: 15632;
12123
12123
  readonly length: 20;
12124
12124
  }, {
12125
- readonly start: 16445;
12125
+ readonly start: 15756;
12126
12126
  readonly length: 20;
12127
12127
  }, {
12128
- readonly start: 17841;
12128
+ readonly start: 17238;
12129
12129
  readonly length: 20;
12130
12130
  }];
12131
12131
  };
@@ -12140,118 +12140,118 @@ export declare const RollupArtifact: {
12140
12140
  readonly start: 1052;
12141
12141
  readonly length: 20;
12142
12142
  }, {
12143
- readonly start: 11438;
12143
+ readonly start: 10605;
12144
12144
  readonly length: 20;
12145
12145
  }, {
12146
- readonly start: 11554;
12146
+ readonly start: 10749;
12147
12147
  readonly length: 20;
12148
12148
  }, {
12149
- readonly start: 11659;
12149
+ readonly start: 10890;
12150
12150
  readonly length: 20;
12151
12151
  }, {
12152
- readonly start: 11954;
12152
+ readonly start: 11185;
12153
12153
  readonly length: 20;
12154
12154
  }, {
12155
- readonly start: 12050;
12155
+ readonly start: 11281;
12156
12156
  readonly length: 20;
12157
12157
  }, {
12158
- readonly start: 12155;
12158
+ readonly start: 11386;
12159
12159
  readonly length: 20;
12160
12160
  }, {
12161
- readonly start: 12488;
12161
+ readonly start: 11715;
12162
12162
  readonly length: 20;
12163
12163
  }, {
12164
- readonly start: 12617;
12164
+ readonly start: 11844;
12165
12165
  readonly length: 20;
12166
12166
  }, {
12167
- readonly start: 12788;
12167
+ readonly start: 12015;
12168
12168
  readonly length: 20;
12169
12169
  }, {
12170
- readonly start: 13001;
12170
+ readonly start: 12213;
12171
12171
  readonly length: 20;
12172
12172
  }, {
12173
- readonly start: 13279;
12173
+ readonly start: 12473;
12174
12174
  readonly length: 20;
12175
12175
  }, {
12176
- readonly start: 14127;
12176
+ readonly start: 13376;
12177
12177
  readonly length: 20;
12178
12178
  }, {
12179
- readonly start: 14372;
12179
+ readonly start: 13632;
12180
12180
  readonly length: 20;
12181
12181
  }, {
12182
- readonly start: 14559;
12182
+ readonly start: 13819;
12183
12183
  readonly length: 20;
12184
12184
  }, {
12185
- readonly start: 14686;
12185
+ readonly start: 13946;
12186
12186
  readonly length: 20;
12187
12187
  }, {
12188
- readonly start: 15132;
12188
+ readonly start: 14379;
12189
12189
  readonly length: 20;
12190
12190
  }, {
12191
- readonly start: 15301;
12191
+ readonly start: 14548;
12192
12192
  readonly length: 20;
12193
12193
  }, {
12194
- readonly start: 15337;
12194
+ readonly start: 14584;
12195
12195
  readonly length: 20;
12196
12196
  }, {
12197
- readonly start: 16202;
12197
+ readonly start: 15513;
12198
12198
  readonly length: 20;
12199
12199
  }, {
12200
- readonly start: 16512;
12200
+ readonly start: 15847;
12201
12201
  readonly length: 20;
12202
12202
  }, {
12203
- readonly start: 16661;
12203
+ readonly start: 16023;
12204
12204
  readonly length: 20;
12205
12205
  }, {
12206
- readonly start: 16816;
12206
+ readonly start: 16170;
12207
12207
  readonly length: 20;
12208
12208
  }, {
12209
- readonly start: 16898;
12209
+ readonly start: 16214;
12210
12210
  readonly length: 20;
12211
12211
  }, {
12212
- readonly start: 17016;
12212
+ readonly start: 16360;
12213
12213
  readonly length: 20;
12214
12214
  }, {
12215
- readonly start: 17127;
12215
+ readonly start: 16471;
12216
12216
  readonly length: 20;
12217
12217
  }, {
12218
- readonly start: 17326;
12218
+ readonly start: 16677;
12219
12219
  readonly length: 20;
12220
12220
  }, {
12221
- readonly start: 17391;
12221
+ readonly start: 16742;
12222
12222
  readonly length: 20;
12223
12223
  }, {
12224
- readonly start: 17458;
12224
+ readonly start: 16809;
12225
12225
  readonly length: 20;
12226
12226
  }, {
12227
- readonly start: 17606;
12227
+ readonly start: 16976;
12228
12228
  readonly length: 20;
12229
12229
  }, {
12230
- readonly start: 18067;
12230
+ readonly start: 17489;
12231
12231
  readonly length: 20;
12232
12232
  }, {
12233
- readonly start: 18152;
12233
+ readonly start: 17574;
12234
12234
  readonly length: 20;
12235
12235
  }, {
12236
- readonly start: 18188;
12236
+ readonly start: 17610;
12237
12237
  readonly length: 20;
12238
12238
  }, {
12239
- readonly start: 18255;
12239
+ readonly start: 17677;
12240
12240
  readonly length: 20;
12241
12241
  }, {
12242
- readonly start: 18388;
12242
+ readonly start: 17791;
12243
12243
  readonly length: 20;
12244
12244
  }, {
12245
- readonly start: 18518;
12245
+ readonly start: 17917;
12246
12246
  readonly length: 20;
12247
12247
  }, {
12248
- readonly start: 19101;
12248
+ readonly start: 18488;
12249
12249
  readonly length: 20;
12250
12250
  }, {
12251
- readonly start: 19173;
12251
+ readonly start: 18560;
12252
12252
  readonly length: 20;
12253
12253
  }, {
12254
- readonly start: 19295;
12254
+ readonly start: 18667;
12255
12255
  readonly length: 20;
12256
12256
  }];
12257
12257
  };
@@ -12,7 +12,9 @@ export interface L1ReaderConfig {
12
12
  l1Contracts: L1ContractAddresses;
13
13
  /** The polling interval viem uses in ms */
14
14
  viemPollingIntervalMS: number;
15
+ /** Timeout for HTTP requests to the L1 RPC node in ms. */
16
+ l1HttpTimeoutMS?: number;
15
17
  }
16
18
  export declare const l1ReaderConfigMappings: ConfigMappingsType<L1ReaderConfig>;
17
19
  export declare function getL1ReaderConfigFromEnv(): L1ReaderConfig;
18
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibDFfcmVhZGVyLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvbDFfcmVhZGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFBRSxLQUFLLGtCQUFrQixFQUE2QyxNQUFNLDBCQUEwQixDQUFDO0FBRTlHLE9BQU8sRUFBRSxLQUFLLG1CQUFtQixFQUE4QixNQUFNLDRCQUE0QixDQUFDO0FBRWxHLDJDQUEyQztBQUMzQyxNQUFNLFdBQVcsY0FBYztJQUM3QiwwRkFBMEY7SUFDMUYsU0FBUyxFQUFFLE1BQU0sRUFBRSxDQUFDO0lBQ3BCLDBFQUEwRTtJQUMxRSxjQUFjLEVBQUUsTUFBTSxFQUFFLENBQUM7SUFDekIseUNBQXlDO0lBQ3pDLFNBQVMsRUFBRSxNQUFNLENBQUM7SUFDbEIseUNBQXlDO0lBQ3pDLFdBQVcsRUFBRSxtQkFBbUIsQ0FBQztJQUNqQywyQ0FBMkM7SUFDM0MscUJBQXFCLEVBQUUsTUFBTSxDQUFDO0NBQy9CO0FBRUQsZUFBTyxNQUFNLHNCQUFzQixFQUFFLGtCQUFrQixDQUFDLGNBQWMsQ0EyQnJFLENBQUM7QUFFRix3QkFBZ0Isd0JBQXdCLElBQUksY0FBYyxDQUV6RCJ9
20
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibDFfcmVhZGVyLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvbDFfcmVhZGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8sRUFDTCxLQUFLLGtCQUFrQixFQUl4QixNQUFNLDBCQUEwQixDQUFDO0FBRWxDLE9BQU8sRUFBRSxLQUFLLG1CQUFtQixFQUE4QixNQUFNLDRCQUE0QixDQUFDO0FBRWxHLDJDQUEyQztBQUMzQyxNQUFNLFdBQVcsY0FBYztJQUM3QiwwRkFBMEY7SUFDMUYsU0FBUyxFQUFFLE1BQU0sRUFBRSxDQUFDO0lBQ3BCLDBFQUEwRTtJQUMxRSxjQUFjLEVBQUUsTUFBTSxFQUFFLENBQUM7SUFDekIseUNBQXlDO0lBQ3pDLFNBQVMsRUFBRSxNQUFNLENBQUM7SUFDbEIseUNBQXlDO0lBQ3pDLFdBQVcsRUFBRSxtQkFBbUIsQ0FBQztJQUNqQywyQ0FBMkM7SUFDM0MscUJBQXFCLEVBQUUsTUFBTSxDQUFDO0lBQzlCLDBEQUEwRDtJQUMxRCxlQUFlLENBQUMsRUFBRSxNQUFNLENBQUM7Q0FDMUI7QUFFRCxlQUFPLE1BQU0sc0JBQXNCLEVBQUUsa0JBQWtCLENBQUMsY0FBYyxDQWdDckUsQ0FBQztBQUVGLHdCQUFnQix3QkFBd0IsSUFBSSxjQUFjLENBRXpEIn0=
@@ -1 +1 @@
1
- {"version":3,"file":"l1_reader.d.ts","sourceRoot":"","sources":["../src/l1_reader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,kBAAkB,EAA6C,MAAM,0BAA0B,CAAC;AAE9G,OAAO,EAAE,KAAK,mBAAmB,EAA8B,MAAM,4BAA4B,CAAC;AAElG,2CAA2C;AAC3C,MAAM,WAAW,cAAc;IAC7B,0FAA0F;IAC1F,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,0EAA0E;IAC1E,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,yCAAyC;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,yCAAyC;IACzC,WAAW,EAAE,mBAAmB,CAAC;IACjC,2CAA2C;IAC3C,qBAAqB,EAAE,MAAM,CAAC;CAC/B;AAED,eAAO,MAAM,sBAAsB,EAAE,kBAAkB,CAAC,cAAc,CA2BrE,CAAC;AAEF,wBAAgB,wBAAwB,IAAI,cAAc,CAEzD"}
1
+ {"version":3,"file":"l1_reader.d.ts","sourceRoot":"","sources":["../src/l1_reader.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,EAIxB,MAAM,0BAA0B,CAAC;AAElC,OAAO,EAAE,KAAK,mBAAmB,EAA8B,MAAM,4BAA4B,CAAC;AAElG,2CAA2C;AAC3C,MAAM,WAAW,cAAc;IAC7B,0FAA0F;IAC1F,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB,0EAA0E;IAC1E,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,yCAAyC;IACzC,SAAS,EAAE,MAAM,CAAC;IAClB,yCAAyC;IACzC,WAAW,EAAE,mBAAmB,CAAC;IACjC,2CAA2C;IAC3C,qBAAqB,EAAE,MAAM,CAAC;IAC9B,0DAA0D;IAC1D,eAAe,CAAC,EAAE,MAAM,CAAC;CAC1B;AAED,eAAO,MAAM,sBAAsB,EAAE,kBAAkB,CAAC,cAAc,CAgCrE,CAAC;AAEF,wBAAgB,wBAAwB,IAAI,cAAc,CAEzD"}
package/dest/l1_reader.js CHANGED
@@ -1,4 +1,4 @@
1
- import { getConfigFromMappings, numberConfigHelper } from '@aztec/foundation/config';
1
+ import { getConfigFromMappings, numberConfigHelper, optionalNumberConfigHelper } from '@aztec/foundation/config';
2
2
  import { l1ContractAddressesMapping } from './l1_contract_addresses.js';
3
3
  export const l1ReaderConfigMappings = {
4
4
  l1Contracts: {
@@ -26,6 +26,11 @@ export const l1ReaderConfigMappings = {
26
26
  env: 'L1_READER_VIEM_POLLING_INTERVAL_MS',
27
27
  description: 'The polling interval viem uses in ms',
28
28
  ...numberConfigHelper(1_000)
29
+ },
30
+ l1HttpTimeoutMS: {
31
+ env: 'ETHEREUM_HTTP_TIMEOUT_MS',
32
+ description: 'Timeout for HTTP requests to the L1 RPC node in ms.',
33
+ ...optionalNumberConfigHelper()
29
34
  }
30
35
  };
31
36
  export function getL1ReaderConfigFromEnv() {