@aztec/sequencer-client 0.0.1-commit.87a0206 → 0.0.1-commit.88e6f9396

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 (77) hide show
  1. package/dest/client/sequencer-client.d.ts +12 -7
  2. package/dest/client/sequencer-client.d.ts.map +1 -1
  3. package/dest/client/sequencer-client.js +56 -17
  4. package/dest/config.d.ts +26 -7
  5. package/dest/config.d.ts.map +1 -1
  6. package/dest/config.js +47 -28
  7. package/dest/global_variable_builder/global_builder.d.ts +2 -4
  8. package/dest/global_variable_builder/global_builder.d.ts.map +1 -1
  9. package/dest/global_variable_builder/global_builder.js +5 -4
  10. package/dest/publisher/config.d.ts +35 -17
  11. package/dest/publisher/config.d.ts.map +1 -1
  12. package/dest/publisher/config.js +106 -42
  13. package/dest/publisher/index.d.ts +2 -1
  14. package/dest/publisher/index.d.ts.map +1 -1
  15. package/dest/publisher/l1_tx_failed_store/factory.d.ts +11 -0
  16. package/dest/publisher/l1_tx_failed_store/factory.d.ts.map +1 -0
  17. package/dest/publisher/l1_tx_failed_store/factory.js +22 -0
  18. package/dest/publisher/l1_tx_failed_store/failed_tx_store.d.ts +59 -0
  19. package/dest/publisher/l1_tx_failed_store/failed_tx_store.d.ts.map +1 -0
  20. package/dest/publisher/l1_tx_failed_store/failed_tx_store.js +1 -0
  21. package/dest/publisher/l1_tx_failed_store/file_store_failed_tx_store.d.ts +15 -0
  22. package/dest/publisher/l1_tx_failed_store/file_store_failed_tx_store.d.ts.map +1 -0
  23. package/dest/publisher/l1_tx_failed_store/file_store_failed_tx_store.js +34 -0
  24. package/dest/publisher/l1_tx_failed_store/index.d.ts +4 -0
  25. package/dest/publisher/l1_tx_failed_store/index.d.ts.map +1 -0
  26. package/dest/publisher/l1_tx_failed_store/index.js +2 -0
  27. package/dest/publisher/sequencer-publisher-factory.d.ts +11 -3
  28. package/dest/publisher/sequencer-publisher-factory.d.ts.map +1 -1
  29. package/dest/publisher/sequencer-publisher-factory.js +27 -2
  30. package/dest/publisher/sequencer-publisher.d.ts +30 -9
  31. package/dest/publisher/sequencer-publisher.d.ts.map +1 -1
  32. package/dest/publisher/sequencer-publisher.js +323 -38
  33. package/dest/sequencer/checkpoint_proposal_job.d.ts +13 -7
  34. package/dest/sequencer/checkpoint_proposal_job.d.ts.map +1 -1
  35. package/dest/sequencer/checkpoint_proposal_job.js +236 -138
  36. package/dest/sequencer/events.d.ts +2 -1
  37. package/dest/sequencer/events.d.ts.map +1 -1
  38. package/dest/sequencer/metrics.d.ts +21 -5
  39. package/dest/sequencer/metrics.d.ts.map +1 -1
  40. package/dest/sequencer/metrics.js +97 -15
  41. package/dest/sequencer/sequencer.d.ts +28 -15
  42. package/dest/sequencer/sequencer.d.ts.map +1 -1
  43. package/dest/sequencer/sequencer.js +91 -82
  44. package/dest/sequencer/timetable.d.ts +4 -6
  45. package/dest/sequencer/timetable.d.ts.map +1 -1
  46. package/dest/sequencer/timetable.js +7 -11
  47. package/dest/sequencer/types.d.ts +2 -2
  48. package/dest/sequencer/types.d.ts.map +1 -1
  49. package/dest/test/index.d.ts +3 -5
  50. package/dest/test/index.d.ts.map +1 -1
  51. package/dest/test/mock_checkpoint_builder.d.ts +11 -11
  52. package/dest/test/mock_checkpoint_builder.d.ts.map +1 -1
  53. package/dest/test/mock_checkpoint_builder.js +45 -34
  54. package/dest/test/utils.d.ts +3 -3
  55. package/dest/test/utils.d.ts.map +1 -1
  56. package/dest/test/utils.js +5 -4
  57. package/package.json +27 -28
  58. package/src/client/sequencer-client.ts +77 -18
  59. package/src/config.ts +65 -38
  60. package/src/global_variable_builder/global_builder.ts +4 -3
  61. package/src/publisher/config.ts +121 -43
  62. package/src/publisher/index.ts +3 -0
  63. package/src/publisher/l1_tx_failed_store/factory.ts +32 -0
  64. package/src/publisher/l1_tx_failed_store/failed_tx_store.ts +55 -0
  65. package/src/publisher/l1_tx_failed_store/file_store_failed_tx_store.ts +46 -0
  66. package/src/publisher/l1_tx_failed_store/index.ts +3 -0
  67. package/src/publisher/sequencer-publisher-factory.ts +38 -6
  68. package/src/publisher/sequencer-publisher.ts +327 -52
  69. package/src/sequencer/checkpoint_proposal_job.ts +321 -149
  70. package/src/sequencer/events.ts +1 -1
  71. package/src/sequencer/metrics.ts +106 -18
  72. package/src/sequencer/sequencer.ts +125 -94
  73. package/src/sequencer/timetable.ts +13 -12
  74. package/src/sequencer/types.ts +1 -1
  75. package/src/test/index.ts +2 -4
  76. package/src/test/mock_checkpoint_builder.ts +63 -49
  77. package/src/test/utils.ts +5 -2
@@ -1 +1 @@
1
- {"version":3,"file":"sequencer-publisher.d.ts","sourceRoot":"","sources":["../../src/publisher/sequencer-publisher.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAErE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAChE,OAAO,EACL,KAAK,8BAA8B,EACnC,KAAK,0BAA0B,EAI/B,cAAc,EACd,KAAK,6BAA6B,EAGnC,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,KAAK,mBAAmB,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAC1F,OAAO,EACL,KAAK,YAAY,EACjB,KAAK,UAAU,EACf,KAAK,WAAW,EAEhB,KAAK,gBAAgB,EAEtB,MAAM,6BAA6B,CAAC;AACrC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wCAAwC,CAAC;AACjF,OAAO,EAAE,kBAAkB,EAA+C,MAAM,uBAAuB,CAAC;AAGxG,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,iCAAiC,CAAC;AAE/E,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,gCAAgC,CAAC;AACzD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,EAAE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UAAU,EACtB,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,UAAU,EACzB,MAAM,EAAE,CAAC,GAAG,EAAE,mBAAmB,KAAK,OAAO,CAAC,KAAK,MAAM,EAAE,CAAC,GAC3D,OAAO,CAAC,OAAO,CAAC,CAUlB;IAED,uEAAuE;IAC1D,sBAAsB,CACjC,OAAO,EAAE,mBAAmB,EAAE,EAC9B,UAAU,EAAE,UAAU,EACtB,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,UAAU,EACzB,MAAM,EAAE,CAAC,GAAG,EAAE,mBAAmB,KAAK,OAAO,CAAC,KAAK,MAAM,EAAE,CAAC,GAC3D,OAAO,CAAC,OAAO,CAAC,CAkHlB;IAED,+DAA+D;IAClD,wBAAwB,CACnC,UAAU,EAAE,UAAU,EACtB,sBAAsB,EAAE,+BAA+B,EACvD,+BAA+B,EAAE,SAAS,EAC1C,IAAI,GAAE;QAAE,WAAW,CAAC,EAAE,IAAI,CAAC;QAAC,4BAA4B,CAAC,EAAE,gBAAgB,CAAA;KAAO,GACjF,OAAO,CAAC,IAAI,CAAC,CAwCf;IAEM,2BAA2B,CAChC,OAAO,EAAE,2BAA2B,GAAG,SAAS,EAChD,IAAI,GAAE;QAAE,WAAW,CAAC,EAAE,IAAI,CAAA;KAAO,QA+BlC;YAEa,yBAAyB;IAyEvC;;;;;OAKG;IACI,SAAS,SAGf;IAED,wDAAwD;IACjD,OAAO,SAGb;YAEa,gBAAgB;YAsFhB,iBAAiB;YAqGjB,YAAY;CAyF3B"}
@@ -372,24 +372,28 @@ function _apply_decs_2203_r(targetClass, memberDecs, classDecs, parentClass) {
372
372
  }
373
373
  var _dec, _dec1, _dec2, _initProto;
374
374
  import { Blob, getBlobsPerL1Block, getPrefixedEthBlobCommitments } from '@aztec/blob-lib';
375
- import { MULTI_CALL_3_ADDRESS, Multicall3, RollupContract } from '@aztec/ethereum/contracts';
375
+ import { FeeAssetPriceOracle, MULTI_CALL_3_ADDRESS, Multicall3, RollupContract } from '@aztec/ethereum/contracts';
376
376
  import { L1FeeAnalyzer } from '@aztec/ethereum/l1-fee-analysis';
377
377
  import { MAX_L1_TX_LIMIT, WEI_CONST } from '@aztec/ethereum/l1-tx-utils';
378
378
  import { FormattedViemError, formatViemError, mergeAbis, tryExtractEvent } from '@aztec/ethereum/utils';
379
379
  import { sumBigint } from '@aztec/foundation/bigint';
380
380
  import { toHex as toPaddedHex } from '@aztec/foundation/bigint-buffer';
381
381
  import { CheckpointNumber, SlotNumber } from '@aztec/foundation/branded-types';
382
+ import { trimmedBytesLength } from '@aztec/foundation/buffer';
382
383
  import { pick } from '@aztec/foundation/collection';
384
+ import { TimeoutError } from '@aztec/foundation/error';
383
385
  import { EthAddress } from '@aztec/foundation/eth-address';
384
386
  import { Signature } from '@aztec/foundation/eth-signature';
385
387
  import { createLogger } from '@aztec/foundation/log';
388
+ import { makeBackoff, retry } from '@aztec/foundation/retry';
386
389
  import { bufferToHex } from '@aztec/foundation/string';
387
390
  import { Timer } from '@aztec/foundation/timer';
388
391
  import { EmpireBaseAbi, ErrorsAbi, RollupAbi } from '@aztec/l1-artifacts';
389
392
  import { encodeSlashConsensusVotes } from '@aztec/slasher';
390
393
  import { CommitteeAttestationsAndSigners } from '@aztec/stdlib/block';
391
394
  import { getTelemetryClient, trackSpan } from '@aztec/telemetry-client';
392
- import { encodeFunctionData, toHex } from 'viem';
395
+ import { encodeFunctionData, keccak256, multicall3Abi, toHex } from 'viem';
396
+ import { createL1TxFailedStore } from './l1_tx_failed_store/index.js';
393
397
  import { SequencerPublisherMetrics } from './sequencer-publisher-metrics.js';
394
398
  export const Actions = [
395
399
  'invalidate-by-invalid-attestation',
@@ -429,15 +433,20 @@ export class SequencerPublisher {
429
433
  interrupted;
430
434
  metrics;
431
435
  epochCache;
436
+ failedTxStore;
432
437
  governanceLog;
433
438
  slashingLog;
434
439
  lastActions;
435
440
  isPayloadEmptyCache;
441
+ payloadProposedCache;
436
442
  log;
437
443
  ethereumSlotDuration;
444
+ aztecSlotDuration;
438
445
  blobClient;
439
446
  /** Address to use for simulations in fisherman mode (actual proposer's address) */ proposerAddressForSimulation;
447
+ /** Optional callback to obtain a replacement publisher when the current one fails to send. */ getNextPublisher;
440
448
  /** L1 fee analyzer for fisherman mode */ l1FeeAnalyzer;
449
+ /** Fee asset price oracle for computing price modifiers from Uniswap V4 */ feeAssetPriceOracle;
441
450
  // A CALL to a cold address is 2700 gas
442
451
  static MULTICALL_OVERHEAD_GAS_GUESS = 5000n;
443
452
  // Gas report for VotingWithSigTest shows a max gas of 100k, but we've seen it cost 700k+ in testnet
@@ -456,9 +465,11 @@ export class SequencerPublisher {
456
465
  this.slashingLog = createLogger('sequencer:publisher:slashing');
457
466
  this.lastActions = {};
458
467
  this.isPayloadEmptyCache = new Map();
468
+ this.payloadProposedCache = new Set();
459
469
  this.requests = [];
460
470
  this.log = deps.log ?? createLogger('sequencer:publisher');
461
471
  this.ethereumSlotDuration = BigInt(config.ethereumSlotDuration);
472
+ this.aztecSlotDuration = BigInt(config.aztecSlotDuration);
462
473
  this.epochCache = deps.epochCache;
463
474
  this.lastActions = deps.lastActions;
464
475
  this.blobClient = deps.blobClient;
@@ -466,6 +477,7 @@ export class SequencerPublisher {
466
477
  this.metrics = deps.metrics ?? new SequencerPublisherMetrics(telemetry, 'SequencerPublisher');
467
478
  this.tracer = telemetry.getTracer('SequencerPublisher');
468
479
  this.l1TxUtils = deps.l1TxUtils;
480
+ this.getNextPublisher = deps.getNextPublisher;
469
481
  this.rollupContract = deps.rollupContract;
470
482
  this.govProposerContract = deps.governanceProposerContract;
471
483
  this.slashingProposerContract = deps.slashingProposerContract;
@@ -479,10 +491,36 @@ export class SequencerPublisher {
479
491
  if (config.fishermanMode) {
480
492
  this.l1FeeAnalyzer = new L1FeeAnalyzer(this.l1TxUtils.client, deps.dateProvider, createLogger('sequencer:publisher:fee-analyzer'));
481
493
  }
494
+ // Initialize fee asset price oracle
495
+ this.feeAssetPriceOracle = new FeeAssetPriceOracle(this.l1TxUtils.client, this.rollupContract, createLogger('sequencer:publisher:price-oracle'));
496
+ // Initialize failed L1 tx store (optional, for test networks)
497
+ this.failedTxStore = createL1TxFailedStore(config.l1TxFailedStore, this.log);
498
+ }
499
+ /**
500
+ * Backs up a failed L1 transaction to the configured store for debugging.
501
+ * Does nothing if no store is configured.
502
+ */ backupFailedTx(failedTx) {
503
+ if (!this.failedTxStore) {
504
+ return;
505
+ }
506
+ const tx = {
507
+ ...failedTx,
508
+ timestamp: Date.now()
509
+ };
510
+ // Fire and forget - don't block on backup
511
+ void this.failedTxStore.then((store)=>store?.saveFailedTx(tx)).catch((err)=>{
512
+ this.log.warn(`Failed to backup failed L1 tx to store`, err);
513
+ });
482
514
  }
483
515
  getRollupContract() {
484
516
  return this.rollupContract;
485
517
  }
518
+ /**
519
+ * Gets the fee asset price modifier from the oracle.
520
+ * Returns 0n if the oracle query fails.
521
+ */ getFeeAssetPriceModifier() {
522
+ return this.feeAssetPriceOracle.computePriceModifier();
523
+ }
486
524
  getSenderAddress() {
487
525
  return this.l1TxUtils.getSenderAddress();
488
526
  }
@@ -501,7 +539,7 @@ export class SequencerPublisher {
501
539
  this.requests.push(request);
502
540
  }
503
541
  getCurrentL2Slot() {
504
- return this.epochCache.getEpochAndSlotNow().slot;
542
+ return this.epochCache.getSlotNow();
505
543
  }
506
544
  /**
507
545
  * Clears all pending requests without sending them.
@@ -590,8 +628,8 @@ export class SequencerPublisher {
590
628
  // @note - we can only have one blob config per bundle
591
629
  // find requests with gas and blob configs
592
630
  // See https://github.com/AztecProtocol/aztec-packages/issues/11513
593
- const gasConfigs = requestsToProcess.filter((request)=>request.gasConfig).map((request)=>request.gasConfig);
594
- const blobConfigs = requestsToProcess.filter((request)=>request.blobConfig).map((request)=>request.blobConfig);
631
+ const gasConfigs = validRequests.filter((request)=>request.gasConfig).map((request)=>request.gasConfig);
632
+ const blobConfigs = validRequests.filter((request)=>request.blobConfig).map((request)=>request.blobConfig);
595
633
  if (blobConfigs.length > 1) {
596
634
  throw new Error('Multiple blob configs found');
597
635
  }
@@ -618,12 +656,34 @@ export class SequencerPublisher {
618
656
  // This ensures the committee gets precomputed correctly
619
657
  validRequests.sort((a, b)=>compareActions(a.action, b.action));
620
658
  try {
659
+ // Capture context for failed tx backup before sending
660
+ const l1BlockNumber = await this.l1TxUtils.getBlockNumber();
661
+ const multicallData = encodeFunctionData({
662
+ abi: multicall3Abi,
663
+ functionName: 'aggregate3',
664
+ args: [
665
+ validRequests.map((r)=>({
666
+ target: r.request.to,
667
+ callData: r.request.data,
668
+ allowFailure: true
669
+ }))
670
+ ]
671
+ });
672
+ const blobDataHex = blobConfig?.blobs?.map((b)=>toHex(b));
673
+ const txContext = {
674
+ multicallData,
675
+ blobData: blobDataHex,
676
+ l1BlockNumber
677
+ };
621
678
  this.log.debug('Forwarding transactions', {
622
679
  validRequests: validRequests.map((request)=>request.action),
623
680
  txConfig
624
681
  });
625
- const result = await Multicall3.forward(validRequests.map((request)=>request.request), this.l1TxUtils, txConfig, blobConfig, this.rollupContract.address, this.log);
626
- const { successfulActions = [], failedActions = [] } = this.callbackBundledTransactions(validRequests, result);
682
+ const result = await this.forwardWithPublisherRotation(validRequests, txConfig, blobConfig);
683
+ if (result === undefined) {
684
+ return undefined;
685
+ }
686
+ const { successfulActions = [], failedActions = [] } = this.callbackBundledTransactions(validRequests, result, txContext);
627
687
  return {
628
688
  result,
629
689
  expiredActions,
@@ -643,17 +703,83 @@ export class SequencerPublisher {
643
703
  }
644
704
  }
645
705
  }
646
- callbackBundledTransactions(requests, result) {
706
+ /**
707
+ * Forwards transactions via Multicall3, rotating to the next available publisher if a send
708
+ * failure occurs (i.e. the tx never reached the chain).
709
+ * On-chain reverts and simulation errors are returned as-is without rotation.
710
+ */ async forwardWithPublisherRotation(validRequests, txConfig, blobConfig) {
711
+ const triedAddresses = [];
712
+ let currentPublisher = this.l1TxUtils;
713
+ while(true){
714
+ triedAddresses.push(currentPublisher.getSenderAddress());
715
+ try {
716
+ const result = await Multicall3.forward(validRequests.map((r)=>r.request), currentPublisher, txConfig, blobConfig, this.rollupContract.address, this.log);
717
+ this.l1TxUtils = currentPublisher;
718
+ return result;
719
+ } catch (err) {
720
+ if (err instanceof TimeoutError) {
721
+ throw err;
722
+ }
723
+ const viemError = formatViemError(err);
724
+ if (!this.getNextPublisher) {
725
+ this.log.error('Failed to publish bundled transactions', viemError);
726
+ return undefined;
727
+ }
728
+ this.log.warn(`Publisher ${currentPublisher.getSenderAddress()} failed to send, rotating to next publisher`, viemError);
729
+ const nextPublisher = await this.getNextPublisher([
730
+ ...triedAddresses
731
+ ]);
732
+ if (!nextPublisher) {
733
+ this.log.error('All available publishers exhausted, failed to publish bundled transactions');
734
+ return undefined;
735
+ }
736
+ currentPublisher = nextPublisher;
737
+ }
738
+ }
739
+ }
740
+ callbackBundledTransactions(requests, result, txContext) {
647
741
  const actionsListStr = requests.map((r)=>r.action).join(', ');
648
742
  if (result instanceof FormattedViemError) {
649
743
  this.log.error(`Failed to publish bundled transactions (${actionsListStr})`, result);
744
+ this.backupFailedTx({
745
+ id: keccak256(txContext.multicallData),
746
+ failureType: 'send-error',
747
+ request: {
748
+ to: MULTI_CALL_3_ADDRESS,
749
+ data: txContext.multicallData
750
+ },
751
+ blobData: txContext.blobData,
752
+ l1BlockNumber: txContext.l1BlockNumber.toString(),
753
+ error: {
754
+ message: result.message,
755
+ name: result.name
756
+ },
757
+ context: {
758
+ actions: requests.map((r)=>r.action),
759
+ requests: requests.map((r)=>({
760
+ action: r.action,
761
+ to: r.request.to,
762
+ data: r.request.data
763
+ })),
764
+ sender: this.getSenderAddress().toString()
765
+ }
766
+ });
650
767
  return {
651
768
  failedActions: requests.map((r)=>r.action)
652
769
  };
653
770
  } else {
654
771
  this.log.verbose(`Published bundled transactions (${actionsListStr})`, {
655
772
  result,
656
- requests
773
+ requests: requests.map((r)=>({
774
+ ...r,
775
+ // Avoid logging large blob data
776
+ blobConfig: r.blobConfig ? {
777
+ ...r.blobConfig,
778
+ blobs: r.blobConfig.blobs.map((b)=>({
779
+ size: trimmedBytesLength(b)
780
+ }))
781
+ } : undefined
782
+ }))
657
783
  });
658
784
  const successfulActions = [];
659
785
  const failedActions = [];
@@ -664,6 +790,37 @@ export class SequencerPublisher {
664
790
  failedActions.push(request.action);
665
791
  }
666
792
  }
793
+ // Single backup for the whole reverted tx
794
+ if (failedActions.length > 0 && result?.receipt?.status === 'reverted') {
795
+ this.backupFailedTx({
796
+ id: result.receipt.transactionHash,
797
+ failureType: 'revert',
798
+ request: {
799
+ to: MULTI_CALL_3_ADDRESS,
800
+ data: txContext.multicallData
801
+ },
802
+ blobData: txContext.blobData,
803
+ l1BlockNumber: result.receipt.blockNumber.toString(),
804
+ receipt: {
805
+ transactionHash: result.receipt.transactionHash,
806
+ blockNumber: result.receipt.blockNumber.toString(),
807
+ gasUsed: (result.receipt.gasUsed ?? 0n).toString(),
808
+ status: 'reverted'
809
+ },
810
+ error: {
811
+ message: result.errorMsg ?? 'Transaction reverted'
812
+ },
813
+ context: {
814
+ actions: failedActions,
815
+ requests: requests.filter((r)=>failedActions.includes(r.action)).map((r)=>({
816
+ action: r.action,
817
+ to: r.request.to,
818
+ data: r.request.data
819
+ })),
820
+ sender: this.getSenderAddress().toString()
821
+ }
822
+ });
823
+ }
667
824
  return {
668
825
  successfulActions,
669
826
  failedActions
@@ -671,17 +828,19 @@ export class SequencerPublisher {
671
828
  }
672
829
  }
673
830
  /**
674
- * @notice Will call `canProposeAtNextEthBlock` to make sure that it is possible to propose
831
+ * @notice Will call `canProposeAt` to make sure that it is possible to propose
675
832
  * @param tipArchive - The archive to check
676
833
  * @returns The slot and block number if it is possible to propose, undefined otherwise
677
- */ canProposeAtNextEthBlock(tipArchive, msgSender, opts = {}) {
834
+ */ canProposeAt(tipArchive, msgSender, opts = {}) {
678
835
  // TODO: #14291 - should loop through multiple keys to check if any of them can propose
679
836
  const ignoredErrors = [
680
837
  'SlotAlreadyInChain',
681
838
  'InvalidProposer',
682
839
  'InvalidArchive'
683
840
  ];
684
- return this.rollupContract.canProposeAtNextEthBlock(tipArchive.toBuffer(), msgSender.toString(), Number(this.ethereumSlotDuration), {
841
+ const pipelined = opts.pipelined ?? this.epochCache.isProposerPipeliningEnabled();
842
+ const slotOffset = pipelined ? this.aztecSlotDuration : 0n;
843
+ return this.rollupContract.canProposeAt(tipArchive.toBuffer(), msgSender.toString(), this.ethereumSlotDuration, slotOffset, {
685
844
  forcePendingCheckpointNumber: opts.forcePendingCheckpointNumber
686
845
  }).catch((err)=>{
687
846
  if (err instanceof FormattedViemError && ignoredErrors.find((e)=>err.message.includes(e))) {
@@ -766,6 +925,7 @@ export class SequencerPublisher {
766
925
  ...logData,
767
926
  request
768
927
  });
928
+ const l1BlockNumber = await this.l1TxUtils.getBlockNumber();
769
929
  try {
770
930
  const { gasUsed } = await this.l1TxUtils.simulate(request, undefined, undefined, mergeAbis([
771
931
  request.abi ?? [],
@@ -808,6 +968,27 @@ export class SequencerPublisher {
808
968
  }
809
969
  // Otherwise, throw. We cannot build the next checkpoint if we cannot invalidate the previous one.
810
970
  this.log.error(`Simulation for invalidate checkpoint ${checkpointNumber} failed`, viemError, logData);
971
+ this.backupFailedTx({
972
+ id: keccak256(request.data),
973
+ failureType: 'simulation',
974
+ request: {
975
+ to: request.to,
976
+ data: request.data,
977
+ value: request.value?.toString()
978
+ },
979
+ l1BlockNumber: l1BlockNumber.toString(),
980
+ error: {
981
+ message: viemError.message,
982
+ name: viemError.name
983
+ },
984
+ context: {
985
+ actions: [
986
+ `invalidate-${reason}`
987
+ ],
988
+ checkpointNumber,
989
+ sender: this.getSenderAddress().toString()
990
+ }
991
+ });
811
992
  throw new Error(`Failed to simulate invalidate checkpoint ${checkpointNumber}`, {
812
993
  cause: viemError
813
994
  });
@@ -834,30 +1015,18 @@ export class SequencerPublisher {
834
1015
  }
835
1016
  }
836
1017
  /** Simulates `propose` to make sure that the checkpoint is valid for submission */ async validateCheckpointForSubmission(checkpoint, attestationsAndSigners, attestationsAndSignersSignature, options) {
837
- const ts = BigInt((await this.l1TxUtils.getBlock()).timestamp + this.ethereumSlotDuration);
838
- // TODO(palla/mbps): This should not be needed, there's no flow where we propose with zero attestations. Or is there?
839
- // If we have no attestations, we still need to provide the empty attestations
840
- // so that the committee is recalculated correctly
841
- // const ignoreSignatures = attestationsAndSigners.attestations.length === 0;
842
- // if (ignoreSignatures) {
843
- // const { committee } = await this.epochCache.getCommittee(block.header.globalVariables.slotNumber);
844
- // if (!committee) {
845
- // this.log.warn(`No committee found for slot ${block.header.globalVariables.slotNumber}`);
846
- // throw new Error(`No committee found for slot ${block.header.globalVariables.slotNumber}`);
847
- // }
848
- // attestationsAndSigners.attestations = committee.map(committeeMember =>
849
- // CommitteeAttestation.fromAddress(committeeMember),
850
- // );
851
- // }
1018
+ // Anchor the simulation timestamp to the checkpoint's own slot start time
1019
+ // rather than the current L1 block timestamp, which may overshoot into the next slot if the build ran late.
1020
+ const ts = checkpoint.header.timestamp;
852
1021
  const blobFields = checkpoint.toBlobFields();
853
- const blobs = getBlobsPerL1Block(blobFields);
1022
+ const blobs = await getBlobsPerL1Block(blobFields);
854
1023
  const blobInput = getPrefixedEthBlobCommitments(blobs);
855
1024
  const args = [
856
1025
  {
857
1026
  header: checkpoint.header.toViem(),
858
1027
  archive: toHex(checkpoint.archive.root.toBuffer()),
859
1028
  oracleInput: {
860
- feeAssetPriceModifier: 0n
1029
+ feeAssetPriceModifier: checkpoint.feeAssetPriceModifier
861
1030
  }
862
1031
  },
863
1032
  attestationsAndSigners.getPackedAttestations(),
@@ -892,6 +1061,28 @@ export class SequencerPublisher {
892
1061
  this.log.warn(`Skipping vote cast for payload with empty code`);
893
1062
  return false;
894
1063
  }
1064
+ // Check if payload was already submitted to governance
1065
+ const cacheKey = payload.toString();
1066
+ if (!this.payloadProposedCache.has(cacheKey)) {
1067
+ try {
1068
+ const l1StartBlock = await this.rollupContract.getL1StartBlock();
1069
+ const proposed = await retry(()=>base.hasPayloadBeenProposed(payload.toString(), l1StartBlock), 'Check if payload was proposed', makeBackoff([
1070
+ 0,
1071
+ 1,
1072
+ 2
1073
+ ]), this.log, true);
1074
+ if (proposed) {
1075
+ this.payloadProposedCache.add(cacheKey);
1076
+ }
1077
+ } catch (err) {
1078
+ this.log.warn(`Failed to check if payload ${payload} was proposed after retries, skipping signal`, err);
1079
+ return false;
1080
+ }
1081
+ }
1082
+ if (this.payloadProposedCache.has(cacheKey)) {
1083
+ this.log.info(`Payload ${payload} was already proposed to governance, stopping signals`);
1084
+ return false;
1085
+ }
895
1086
  const cachedLastVote = this.lastActions[signalType];
896
1087
  this.lastActions[signalType] = slotNumber;
897
1088
  const action = signalType;
@@ -902,6 +1093,7 @@ export class SequencerPublisher {
902
1093
  signer: this.l1TxUtils.client.account?.address,
903
1094
  lastValidL2Slot: slotNumber
904
1095
  });
1096
+ const l1BlockNumber = await this.l1TxUtils.getBlockNumber();
905
1097
  try {
906
1098
  await this.l1TxUtils.simulate(request, {
907
1099
  time: timestamp
@@ -913,7 +1105,29 @@ export class SequencerPublisher {
913
1105
  request
914
1106
  });
915
1107
  } catch (err) {
916
- this.log.error(`Failed simulation for ${action} at slot ${slotNumber} (enqueuing the action anyway)`, err);
1108
+ const viemError = formatViemError(err);
1109
+ this.log.error(`Failed simulation for ${action} at slot ${slotNumber} (enqueuing the action anyway)`, viemError);
1110
+ this.backupFailedTx({
1111
+ id: keccak256(request.data),
1112
+ failureType: 'simulation',
1113
+ request: {
1114
+ to: request.to,
1115
+ data: request.data,
1116
+ value: request.value?.toString()
1117
+ },
1118
+ l1BlockNumber: l1BlockNumber.toString(),
1119
+ error: {
1120
+ message: viemError.message,
1121
+ name: viemError.name
1122
+ },
1123
+ context: {
1124
+ actions: [
1125
+ action
1126
+ ],
1127
+ slot: slotNumber,
1128
+ sender: this.getSenderAddress().toString()
1129
+ }
1130
+ });
917
1131
  // Yes, we enqueue the request anyway, in case there was a bug with the simulation itself
918
1132
  }
919
1133
  // TODO(palla/slash): All votes (governance and slashing) should txTimeoutAt at the end of the slot.
@@ -1052,13 +1266,14 @@ export class SequencerPublisher {
1052
1266
  /** Simulates and enqueues a proposal for a checkpoint on L1 */ async enqueueProposeCheckpoint(checkpoint, attestationsAndSigners, attestationsAndSignersSignature, opts = {}) {
1053
1267
  const checkpointHeader = checkpoint.header;
1054
1268
  const blobFields = checkpoint.toBlobFields();
1055
- const blobs = getBlobsPerL1Block(blobFields);
1269
+ const blobs = await getBlobsPerL1Block(blobFields);
1056
1270
  const proposeTxArgs = {
1057
1271
  header: checkpointHeader,
1058
1272
  archive: checkpoint.archive.root.toBuffer(),
1059
1273
  blobs,
1060
1274
  attestationsAndSigners,
1061
- attestationsAndSignersSignature
1275
+ attestationsAndSignersSignature,
1276
+ feeAssetPriceModifier: checkpoint.feeAssetPriceModifier
1062
1277
  };
1063
1278
  let ts;
1064
1279
  try {
@@ -1134,6 +1349,7 @@ export class SequencerPublisher {
1134
1349
  const cachedLastActionSlot = this.lastActions[action];
1135
1350
  this.lastActions[action] = slotNumber;
1136
1351
  this.log.debug(`Simulating ${action} for slot ${slotNumber}`, logData);
1352
+ const l1BlockNumber = await this.l1TxUtils.getBlockNumber();
1137
1353
  let gasUsed;
1138
1354
  const simulateAbi = mergeAbis([
1139
1355
  request.abi ?? [],
@@ -1151,6 +1367,27 @@ export class SequencerPublisher {
1151
1367
  } catch (err) {
1152
1368
  const viemError = formatViemError(err, simulateAbi);
1153
1369
  this.log.error(`Simulation for ${action} at ${slotNumber} failed`, viemError, logData);
1370
+ this.backupFailedTx({
1371
+ id: keccak256(request.data),
1372
+ failureType: 'simulation',
1373
+ request: {
1374
+ to: request.to,
1375
+ data: request.data,
1376
+ value: request.value?.toString()
1377
+ },
1378
+ l1BlockNumber: l1BlockNumber.toString(),
1379
+ error: {
1380
+ message: viemError.message,
1381
+ name: viemError.name
1382
+ },
1383
+ context: {
1384
+ actions: [
1385
+ action
1386
+ ],
1387
+ slot: slotNumber,
1388
+ sender: this.getSenderAddress().toString()
1389
+ }
1390
+ });
1154
1391
  return false;
1155
1392
  }
1156
1393
  // We issued the simulation against the rollup contract, so we need to account for the overhead of the multicall3
@@ -1229,10 +1466,38 @@ export class SequencerPublisher {
1229
1466
  }, {}, {
1230
1467
  blobs: encodedData.blobs.map((b)=>b.data),
1231
1468
  kzg
1232
- }).catch((err)=>{
1233
- const { message, metaMessages } = formatViemError(err);
1234
- this.log.error(`Failed to validate blobs`, message, {
1235
- metaMessages
1469
+ }).catch(async (err)=>{
1470
+ const viemError = formatViemError(err);
1471
+ this.log.error(`Failed to validate blobs`, viemError.message, {
1472
+ metaMessages: viemError.metaMessages
1473
+ });
1474
+ const validateBlobsData = encodeFunctionData({
1475
+ abi: RollupAbi,
1476
+ functionName: 'validateBlobs',
1477
+ args: [
1478
+ blobInput
1479
+ ]
1480
+ });
1481
+ const l1BlockNumber = await this.l1TxUtils.getBlockNumber();
1482
+ this.backupFailedTx({
1483
+ id: keccak256(validateBlobsData),
1484
+ failureType: 'simulation',
1485
+ request: {
1486
+ to: this.rollupContract.address,
1487
+ data: validateBlobsData
1488
+ },
1489
+ blobData: encodedData.blobs.map((b)=>toHex(b.data)),
1490
+ l1BlockNumber: l1BlockNumber.toString(),
1491
+ error: {
1492
+ message: viemError.message,
1493
+ name: viemError.name
1494
+ },
1495
+ context: {
1496
+ actions: [
1497
+ 'validate-blobs'
1498
+ ],
1499
+ sender: this.getSenderAddress().toString()
1500
+ }
1236
1501
  });
1237
1502
  throw new Error('Failed to validate blobs');
1238
1503
  });
@@ -1243,8 +1508,7 @@ export class SequencerPublisher {
1243
1508
  header: encodedData.header.toViem(),
1244
1509
  archive: toHex(encodedData.archive),
1245
1510
  oracleInput: {
1246
- // We are currently not modifying these. See #9963
1247
- feeAssetPriceModifier: 0n
1511
+ feeAssetPriceModifier: encodedData.feeAssetPriceModifier
1248
1512
  }
1249
1513
  },
1250
1514
  encodedData.attestationsAndSigners.getPackedAttestations(),
@@ -1293,6 +1557,7 @@ export class SequencerPublisher {
1293
1557
  balance: 10n * WEI_CONST * WEI_CONST
1294
1558
  });
1295
1559
  }
1560
+ const l1BlockNumber = await this.l1TxUtils.getBlockNumber();
1296
1561
  const simulationResult = await this.l1TxUtils.simulate({
1297
1562
  to: this.rollupContract.address,
1298
1563
  data: rollupData,
@@ -1320,6 +1585,26 @@ export class SequencerPublisher {
1320
1585
  };
1321
1586
  }
1322
1587
  this.log.error(`Failed to simulate propose tx`, viemError);
1588
+ this.backupFailedTx({
1589
+ id: keccak256(rollupData),
1590
+ failureType: 'simulation',
1591
+ request: {
1592
+ to: this.rollupContract.address,
1593
+ data: rollupData
1594
+ },
1595
+ l1BlockNumber: l1BlockNumber.toString(),
1596
+ error: {
1597
+ message: viemError.message,
1598
+ name: viemError.name
1599
+ },
1600
+ context: {
1601
+ actions: [
1602
+ 'propose'
1603
+ ],
1604
+ slot: Number(args[0].header.slotNumber),
1605
+ sender: this.getSenderAddress().toString()
1606
+ }
1607
+ });
1323
1608
  throw err;
1324
1609
  });
1325
1610
  return {