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

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 (54) hide show
  1. package/dest/client/index.d.ts +1 -1
  2. package/dest/client/sequencer-client.d.ts +1 -1
  3. package/dest/client/sequencer-client.d.ts.map +1 -1
  4. package/dest/client/sequencer-client.js +2 -1
  5. package/dest/config.d.ts +1 -1
  6. package/dest/config.d.ts.map +1 -1
  7. package/dest/config.js +9 -0
  8. package/dest/global_variable_builder/global_builder.d.ts +3 -6
  9. package/dest/global_variable_builder/global_builder.d.ts.map +1 -1
  10. package/dest/global_variable_builder/global_builder.js +9 -6
  11. package/dest/global_variable_builder/index.d.ts +1 -1
  12. package/dest/index.d.ts +1 -1
  13. package/dest/publisher/config.d.ts +3 -1
  14. package/dest/publisher/config.d.ts.map +1 -1
  15. package/dest/publisher/config.js +5 -0
  16. package/dest/publisher/index.d.ts +1 -1
  17. package/dest/publisher/sequencer-publisher-factory.d.ts +1 -1
  18. package/dest/publisher/sequencer-publisher-factory.d.ts.map +1 -1
  19. package/dest/publisher/sequencer-publisher-metrics.d.ts +1 -1
  20. package/dest/publisher/sequencer-publisher-metrics.d.ts.map +1 -1
  21. package/dest/publisher/sequencer-publisher.d.ts +29 -23
  22. package/dest/publisher/sequencer-publisher.d.ts.map +1 -1
  23. package/dest/publisher/sequencer-publisher.js +108 -57
  24. package/dest/sequencer/block_builder.d.ts +1 -1
  25. package/dest/sequencer/block_builder.d.ts.map +1 -1
  26. package/dest/sequencer/block_builder.js +10 -6
  27. package/dest/sequencer/config.d.ts +1 -1
  28. package/dest/sequencer/errors.d.ts +1 -1
  29. package/dest/sequencer/errors.d.ts.map +1 -1
  30. package/dest/sequencer/index.d.ts +1 -1
  31. package/dest/sequencer/metrics.d.ts +11 -2
  32. package/dest/sequencer/metrics.d.ts.map +1 -1
  33. package/dest/sequencer/metrics.js +38 -0
  34. package/dest/sequencer/sequencer.d.ts +17 -25
  35. package/dest/sequencer/sequencer.d.ts.map +1 -1
  36. package/dest/sequencer/sequencer.js +169 -46
  37. package/dest/sequencer/timetable.d.ts +1 -1
  38. package/dest/sequencer/timetable.d.ts.map +1 -1
  39. package/dest/sequencer/utils.d.ts +1 -1
  40. package/dest/test/index.d.ts +1 -1
  41. package/dest/tx_validator/nullifier_cache.d.ts +1 -1
  42. package/dest/tx_validator/nullifier_cache.d.ts.map +1 -1
  43. package/dest/tx_validator/tx_validator_factory.d.ts +2 -2
  44. package/dest/tx_validator/tx_validator_factory.d.ts.map +1 -1
  45. package/package.json +31 -30
  46. package/src/client/sequencer-client.ts +2 -2
  47. package/src/config.ts +10 -0
  48. package/src/global_variable_builder/global_builder.ts +12 -8
  49. package/src/publisher/config.ts +8 -0
  50. package/src/publisher/sequencer-publisher-factory.ts +2 -1
  51. package/src/publisher/sequencer-publisher.ts +125 -70
  52. package/src/sequencer/block_builder.ts +10 -6
  53. package/src/sequencer/metrics.ts +51 -2
  54. package/src/sequencer/sequencer.ts +204 -60
@@ -1,8 +1,9 @@
1
1
  import { Blob, getBlobsPerL1Block, getPrefixedEthBlobCommitments } from '@aztec/blob-lib';
2
2
  import { createBlobSinkClient } from '@aztec/blob-sink/client';
3
- import { FormattedViemError, MULTI_CALL_3_ADDRESS, Multicall3, RollupContract, formatViemError, tryExtractEvent } from '@aztec/ethereum';
3
+ import { FormattedViemError, MULTI_CALL_3_ADDRESS, Multicall3, RollupContract, WEI_CONST, formatViemError, tryExtractEvent } from '@aztec/ethereum';
4
4
  import { sumBigint } from '@aztec/foundation/bigint';
5
5
  import { toHex as toPaddedHex } from '@aztec/foundation/bigint-buffer';
6
+ import { SlotNumber } from '@aztec/foundation/branded-types';
6
7
  import { EthAddress } from '@aztec/foundation/eth-address';
7
8
  import { Signature } from '@aztec/foundation/eth-signature';
8
9
  import { createLogger } from '@aztec/foundation/log';
@@ -38,6 +39,7 @@ export class SequencerPublisher {
38
39
  log;
39
40
  ethereumSlotDuration;
40
41
  blobSinkClient;
42
+ /** Address to use for simulations in fisherman mode (actual proposer's address) */ proposerAddressForSimulation;
41
43
  // @note - with blobs, the below estimate seems too large.
42
44
  // Total used for full block from int_l1_pub e2e test: 1m (of which 86k is 1x blob)
43
45
  // Total used for emptier block from above test: 429k (of which 84k is 1x blob)
@@ -85,6 +87,12 @@ export class SequencerPublisher {
85
87
  getSenderAddress() {
86
88
  return this.l1TxUtils.getSenderAddress();
87
89
  }
90
+ /**
91
+ * Sets the proposer address to use for simulations in fisherman mode.
92
+ * @param proposerAddress - The actual proposer's address to use for balance lookups in simulations
93
+ */ setProposerAddressForSimulation(proposerAddress) {
94
+ this.proposerAddressForSimulation = proposerAddress;
95
+ }
88
96
  addRequest(request) {
89
97
  this.requests.push(request);
90
98
  }
@@ -92,6 +100,15 @@ export class SequencerPublisher {
92
100
  return this.epochCache.getEpochAndSlotNow().slot;
93
101
  }
94
102
  /**
103
+ * Clears all pending requests without sending them.
104
+ */ clearPendingRequests() {
105
+ const count = this.requests.length;
106
+ this.requests = [];
107
+ if (count > 0) {
108
+ this.log.debug(`Cleared ${count} pending request(s)`);
109
+ }
110
+ }
111
+ /**
95
112
  * Sends all requests that are still valid.
96
113
  * @returns one of:
97
114
  * - A receipt and stats if the tx succeeded
@@ -211,7 +228,9 @@ export class SequencerPublisher {
211
228
  'InvalidProposer',
212
229
  'InvalidArchive'
213
230
  ];
214
- return this.rollupContract.canProposeAtNextEthBlock(tipArchive.toBuffer(), msgSender.toString(), this.ethereumSlotDuration, opts).catch((err)=>{
231
+ return this.rollupContract.canProposeAtNextEthBlock(tipArchive.toBuffer(), msgSender.toString(), Number(this.ethereumSlotDuration), {
232
+ forcePendingCheckpointNumber: opts.forcePendingBlockNumber
233
+ }).catch((err)=>{
215
234
  if (err instanceof FormattedViemError && ignoredErrors.find((e)=>err.message.includes(e))) {
216
235
  this.log.warn(`Failed canProposeAtTime check with ${ignoredErrors.find((e)=>err.message.includes(e))}`, {
217
236
  error: err.message
@@ -242,9 +261,19 @@ export class SequencerPublisher {
242
261
  flags
243
262
  ];
244
263
  const ts = BigInt((await this.l1TxUtils.getBlock()).timestamp + this.ethereumSlotDuration);
245
- // use sender balance to simulate
246
- const balance = await this.l1TxUtils.getSenderBalance();
247
- this.log.debug(`Simulating validateHeader with balance: ${balance}`);
264
+ const stateOverrides = await this.rollupContract.makePendingCheckpointNumberOverride(opts?.forcePendingBlockNumber);
265
+ let balance = 0n;
266
+ if (this.config.fishermanMode) {
267
+ // In fisherman mode, we can't know where the proposer is publishing from
268
+ // so we just add sufficient balance to the multicall3 address
269
+ balance = 10n * WEI_CONST * WEI_CONST; // 10 ETH
270
+ } else {
271
+ balance = await this.l1TxUtils.getSenderBalance();
272
+ }
273
+ stateOverrides.push({
274
+ address: MULTI_CALL_3_ADDRESS,
275
+ balance
276
+ });
248
277
  await this.l1TxUtils.simulate({
249
278
  to: this.rollupContract.address,
250
279
  data: encodeFunctionData({
@@ -255,13 +284,7 @@ export class SequencerPublisher {
255
284
  from: MULTI_CALL_3_ADDRESS
256
285
  }, {
257
286
  time: ts + 1n
258
- }, [
259
- {
260
- address: MULTI_CALL_3_ADDRESS,
261
- balance
262
- },
263
- ...await this.rollupContract.makePendingBlockNumberOverride(opts?.forcePendingBlockNumber)
264
- ]);
287
+ }, stateOverrides);
265
288
  this.log.debug(`Simulated validateHeader`);
266
289
  }
267
290
  /**
@@ -277,7 +300,7 @@ export class SequencerPublisher {
277
300
  ...block,
278
301
  reason
279
302
  };
280
- const currentBlockNumber = await this.rollupContract.getBlockNumber();
303
+ const currentBlockNumber = await this.rollupContract.getCheckpointNumber();
281
304
  if (currentBlockNumber < validationResult.block.blockNumber) {
282
305
  this.log.verbose(`Skipping block ${blockNumber} invalidation since it has already been removed from the pending chain`, {
283
306
  currentBlockNumber,
@@ -314,7 +337,7 @@ export class SequencerPublisher {
314
337
  request,
315
338
  error: viemError.message
316
339
  });
317
- const latestPendingBlockNumber = await this.rollupContract.getBlockNumber();
340
+ const latestPendingBlockNumber = await this.rollupContract.getCheckpointNumber();
318
341
  if (latestPendingBlockNumber < blockNumber) {
319
342
  this.log.verbose(`Block number ${blockNumber} has already been invalidated`, {
320
343
  ...logData
@@ -368,10 +391,10 @@ export class SequencerPublisher {
368
391
  // so that the committee is recalculated correctly
369
392
  const ignoreSignatures = attestationsAndSigners.attestations.length === 0;
370
393
  if (ignoreSignatures) {
371
- const { committee } = await this.epochCache.getCommittee(block.header.globalVariables.slotNumber.toBigInt());
394
+ const { committee } = await this.epochCache.getCommittee(block.header.globalVariables.slotNumber);
372
395
  if (!committee) {
373
- this.log.warn(`No committee found for slot ${block.header.globalVariables.slotNumber.toBigInt()}`);
374
- throw new Error(`No committee found for slot ${block.header.globalVariables.slotNumber.toBigInt()}`);
396
+ this.log.warn(`No committee found for slot ${block.header.globalVariables.slotNumber}`);
397
+ throw new Error(`No committee found for slot ${block.header.globalVariables.slotNumber}`);
375
398
  }
376
399
  attestationsAndSigners.attestations = committee.map((committeeMember)=>CommitteeAttestation.fromAddress(committeeMember));
377
400
  }
@@ -382,7 +405,6 @@ export class SequencerPublisher {
382
405
  {
383
406
  header: block.getCheckpointHeader().toViem(),
384
407
  archive: toHex(block.archive.root.toBuffer()),
385
- stateReference: block.header.state.toViem(),
386
408
  oracleInput: {
387
409
  feeAssetPriceModifier: 0n
388
410
  }
@@ -568,7 +590,6 @@ export class SequencerPublisher {
568
590
  const proposeTxArgs = {
569
591
  header: checkpointHeader,
570
592
  archive: block.archive.root.toBuffer(),
571
- stateReference: block.header.state,
572
593
  body: block.body.toBuffer(),
573
594
  blobs,
574
595
  attestationsAndSigners,
@@ -585,7 +606,7 @@ export class SequencerPublisher {
585
606
  } catch (err) {
586
607
  this.log.error(`Block validation failed. ${err instanceof Error ? err.message : 'No error message'}`, err, {
587
608
  ...block.getStats(),
588
- slotNumber: block.header.globalVariables.slotNumber.toBigInt(),
609
+ slotNumber: block.header.globalVariables.slotNumber,
589
610
  forcePendingBlockNumber: opts.forcePendingBlockNumber
590
611
  });
591
612
  throw err;
@@ -618,9 +639,9 @@ export class SequencerPublisher {
618
639
  gasLimit,
619
640
  txTimeoutAt: opts.txTimeoutAt
620
641
  },
621
- lastValidL2Slot: this.getCurrentL2Slot() + 2n,
642
+ lastValidL2Slot: SlotNumber(this.getCurrentL2Slot() + 2),
622
643
  checkSuccess: (_req, result)=>{
623
- const success = result && result.receipt && result.receipt.status === 'success' && tryExtractEvent(result.receipt.logs, this.rollupContract.address, RollupAbi, 'BlockInvalidated');
644
+ const success = result && result.receipt && result.receipt.status === 'success' && tryExtractEvent(result.receipt.logs, this.rollupContract.address, RollupAbi, 'CheckpointInvalidated');
624
645
  if (!success) {
625
646
  this.log.warn(`Invalidate block ${request.blockNumber} failed`, {
626
647
  ...result,
@@ -713,31 +734,40 @@ export class SequencerPublisher {
713
734
  this.log.debug('Validating blob input', {
714
735
  blobInput
715
736
  });
716
- const blobEvaluationGas = await this.l1TxUtils.estimateGas(this.getSenderAddress().toString(), {
717
- to: this.rollupContract.address,
718
- data: encodeFunctionData({
719
- abi: RollupAbi,
720
- functionName: 'validateBlobs',
721
- args: [
722
- blobInput
723
- ]
724
- })
725
- }, {}, {
726
- blobs: encodedData.blobs.map((b)=>b.data),
727
- kzg
728
- }).catch((err)=>{
729
- const { message, metaMessages } = formatViemError(err);
730
- this.log.error(`Failed to validate blobs`, message, {
731
- metaMessages
737
+ // Get blob evaluation gas
738
+ let blobEvaluationGas;
739
+ if (this.config.fishermanMode) {
740
+ // In fisherman mode, we can't estimate blob gas because estimateGas doesn't support state overrides
741
+ // Use a fixed estimate.
742
+ blobEvaluationGas = BigInt(encodedData.blobs.length) * 21_000n;
743
+ this.log.debug(`Using fixed blob evaluation gas estimate in fisherman mode: ${blobEvaluationGas}`);
744
+ } else {
745
+ // Normal mode - use estimateGas with blob inputs
746
+ blobEvaluationGas = await this.l1TxUtils.estimateGas(this.getSenderAddress().toString(), {
747
+ to: this.rollupContract.address,
748
+ data: encodeFunctionData({
749
+ abi: RollupAbi,
750
+ functionName: 'validateBlobs',
751
+ args: [
752
+ blobInput
753
+ ]
754
+ })
755
+ }, {}, {
756
+ blobs: encodedData.blobs.map((b)=>b.data),
757
+ kzg
758
+ }).catch((err)=>{
759
+ const { message, metaMessages } = formatViemError(err);
760
+ this.log.error(`Failed to validate blobs`, message, {
761
+ metaMessages
762
+ });
763
+ throw new Error('Failed to validate blobs');
732
764
  });
733
- throw new Error('Failed to validate blobs');
734
- });
765
+ }
735
766
  const signers = encodedData.attestationsAndSigners.getSigners().map((signer)=>signer.toString());
736
767
  const args = [
737
768
  {
738
769
  header: encodedData.header.toViem(),
739
770
  archive: toHex(encodedData.archive),
740
- stateReference: encodedData.stateReference.toViem(),
741
771
  oracleInput: {
742
772
  // We are currently not modifying these. See #9963
743
773
  feeAssetPriceModifier: 0n
@@ -768,17 +798,8 @@ export class SequencerPublisher {
768
798
  args
769
799
  });
770
800
  // override the pending block number if requested
771
- const forcePendingBlockNumberStateDiff = (options.forcePendingBlockNumber !== undefined ? await this.rollupContract.makePendingBlockNumberOverride(options.forcePendingBlockNumber) : []).flatMap((override)=>override.stateDiff ?? []);
772
- const simulationResult = await this.l1TxUtils.simulate({
773
- to: this.rollupContract.address,
774
- data: rollupData,
775
- gas: SequencerPublisher.PROPOSE_GAS_GUESS
776
- }, {
777
- // @note we add 1n to the timestamp because geth implementation doesn't like simulation timestamp to be equal to the current block timestamp
778
- time: timestamp + 1n,
779
- // @note reth should have a 30m gas limit per block but throws errors that this tx is beyond limit so we increase here
780
- gasLimit: SequencerPublisher.PROPOSE_GAS_GUESS * 2n
781
- }, [
801
+ const forcePendingBlockNumberStateDiff = (options.forcePendingBlockNumber !== undefined ? await this.rollupContract.makePendingCheckpointNumberOverride(options.forcePendingBlockNumber) : []).flatMap((override)=>override.stateDiff ?? []);
802
+ const stateOverrides = [
782
803
  {
783
804
  address: this.rollupContract.address,
784
805
  // @note we override checkBlob to false since blobs are not part simulate()
@@ -790,11 +811,41 @@ export class SequencerPublisher {
790
811
  ...forcePendingBlockNumberStateDiff
791
812
  ]
792
813
  }
793
- ], RollupAbi, {
814
+ ];
815
+ // In fisherman mode, simulate as the proposer but with sufficient balance
816
+ if (this.proposerAddressForSimulation) {
817
+ stateOverrides.push({
818
+ address: this.proposerAddressForSimulation.toString(),
819
+ balance: 10n * WEI_CONST * WEI_CONST
820
+ });
821
+ }
822
+ const simulationResult = await this.l1TxUtils.simulate({
823
+ to: this.rollupContract.address,
824
+ data: rollupData,
825
+ gas: SequencerPublisher.PROPOSE_GAS_GUESS,
826
+ ...this.proposerAddressForSimulation && {
827
+ from: this.proposerAddressForSimulation.toString()
828
+ }
829
+ }, {
830
+ // @note we add 1n to the timestamp because geth implementation doesn't like simulation timestamp to be equal to the current block timestamp
831
+ time: timestamp + 1n,
832
+ // @note reth should have a 30m gas limit per block but throws errors that this tx is beyond limit so we increase here
833
+ gasLimit: SequencerPublisher.PROPOSE_GAS_GUESS * 2n
834
+ }, stateOverrides, RollupAbi, {
794
835
  // @note fallback gas estimate to use if the node doesn't support simulation API
795
836
  fallbackGasEstimate: SequencerPublisher.PROPOSE_GAS_GUESS
796
837
  }).catch((err)=>{
797
- this.log.error(`Failed to simulate propose tx`, err);
838
+ // In fisherman mode, we expect ValidatorSelection__MissingProposerSignature since fisherman doesn't have proposer signature
839
+ const viemError = formatViemError(err);
840
+ if (this.config.fishermanMode && viemError.message?.includes('ValidatorSelection__MissingProposerSignature')) {
841
+ this.log.debug(`Ignoring expected ValidatorSelection__MissingProposerSignature error in fisherman mode`);
842
+ // Return a minimal simulation result with the fallback gas estimate
843
+ return {
844
+ gasUsed: SequencerPublisher.PROPOSE_GAS_GUESS,
845
+ logs: []
846
+ };
847
+ }
848
+ this.log.error(`Failed to simulate propose tx`, viemError);
798
849
  throw err;
799
850
  });
800
851
  return {
@@ -819,7 +870,7 @@ export class SequencerPublisher {
819
870
  to: this.rollupContract.address,
820
871
  data: rollupData
821
872
  },
822
- lastValidL2Slot: block.header.globalVariables.slotNumber.toBigInt(),
873
+ lastValidL2Slot: block.header.globalVariables.slotNumber,
823
874
  gasConfig: {
824
875
  ...opts,
825
876
  gasLimit
@@ -833,7 +884,7 @@ export class SequencerPublisher {
833
884
  return false;
834
885
  }
835
886
  const { receipt, stats, errorMsg } = result;
836
- const success = receipt && receipt.status === 'success' && tryExtractEvent(receipt.logs, this.rollupContract.address, RollupAbi, 'L2BlockProposed');
887
+ const success = receipt && receipt.status === 'success' && tryExtractEvent(receipt.logs, this.rollupContract.address, RollupAbi, 'CheckpointProposed');
837
888
  if (success) {
838
889
  const endBlock = receipt.blockNumber;
839
890
  const inclusionBlocks = Number(endBlock - startBlock);
@@ -865,7 +916,7 @@ export class SequencerPublisher {
865
916
  ...block.getStats(),
866
917
  receipt,
867
918
  txHash: receipt.transactionHash,
868
- slotNumber: block.header.globalVariables.slotNumber.toBigInt()
919
+ slotNumber: block.header.globalVariables.slotNumber
869
920
  });
870
921
  return false;
871
922
  }
@@ -24,4 +24,4 @@ export declare class FullNodeBlockBuilder implements IFullNodeBlockBuilder {
24
24
  buildBlock(pendingTxs: Iterable<Tx> | AsyncIterable<Tx>, l1ToL2Messages: Fr[], globalVariables: GlobalVariables, opts: PublicProcessorLimits, suppliedFork?: MerkleTreeWriteOperations): Promise<BuildBlockResult>;
25
25
  getFork(blockNumber: number): Promise<MerkleTreeWriteOperations>;
26
26
  }
27
- //# sourceMappingURL=block_builder.d.ts.map
27
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYmxvY2tfYnVpbGRlci5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3NlcXVlbmNlci9ibG9ja19idWlsZGVyLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUVBLE9BQU8sS0FBSyxFQUFFLEVBQUUsRUFBRSxNQUFNLDBCQUEwQixDQUFDO0FBSW5ELE9BQU8s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AI,mCAA4B,EAChC,cAAc,EAAE,yBAAyB,EACzC,SAAS,EAAE,eAAe,EAC1B,SAAS,EAAE,wBAAwB,EACnC,WAAW,EAAE,IAAI,CAAC,iBAAiB,EAAE,eAAe,GAAG,cAAc,CAAC,EACtE,YAAY,EAAE,YAAY,EAC1B,eAAe,GAAE,eAAsC,GACtD,OAAO,CAAC,gBAAgB,CAAC,CA4C3B;AAWD,qBAAa,oBAAqB,YAAW,qBAAqB;IAE9D,OAAO,CAAC,MAAM;IACd,OAAO,CAAC,UAAU;IAClB,OAAO,CAAC,kBAAkB;IAC1B,OAAO,CAAC,YAAY;IACpB,OAAO,CAAC,eAAe;IALzB,YACU,MAAM,EAAE,0BAA0B,EAClC,UAAU,EAAE,sBAAsB,EAClC,kBAAkB,EAAE,kBAAkB,EACtC,YAAY,EAAE,YAAY,EAC1B,eAAe,GAAE,eAAsC,EAC7D;IAEG,SAAS,IAAI,0BAA0B,CAE7C;IAEM,YAAY,CAAC,MAAM,EAAE,OAAO,CAAC,0BAA0B,CAAC,QAE9D;IAEY,oBAAoB,CAAC,eAAe,EAAE,eAAe,EAAE,IAAI,EAAE,yBAAyB;;;OA0ClG;YAEa,mBAAmB;IAU3B,UAAU,CACd,UAAU,EAAE,QAAQ,CAAC,EAAE,CAAC,GAAG,aAAa,CAAC,EAAE,CAAC,EAC5C,cAAc,EAAE,EAAE,EAAE,EACpB,eAAe,EAAE,eAAe,EAChC,IAAI,EAAE,qBAAqB,EAC3B,YAAY,CAAC,EAAE,yBAAyB,GACvC,OAAO,CAAC,gBAAgB,CAAC,CAsC3B;IAED,OAAO,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,yBAAyB,CAAC,CAE/D;CACF"}
@@ -7,6 +7,7 @@ import { Timer, elapsed } from '@aztec/foundation/timer';
7
7
  import { getDefaultAllowedSetupFunctions } from '@aztec/p2p/msg_validators';
8
8
  import { LightweightBlockFactory } from '@aztec/prover-client/block-factory';
9
9
  import { GuardedMerkleTreeOperations, PublicContractsDB, PublicProcessor, TelemetryPublicTxSimulator } from '@aztec/simulator/server';
10
+ import { PublicSimulatorConfig } from '@aztec/stdlib/avm';
10
11
  import { getTimestampForSlot } from '@aztec/stdlib/epoch-helpers';
11
12
  import { Gas } from '@aztec/stdlib/gas';
12
13
  import { getTelemetryClient } from '@aztec/telemetry-client';
@@ -15,7 +16,7 @@ const log = createLogger('block-builder');
15
16
  export async function buildBlock(pendingTxs, l1ToL2Messages, newGlobalVariables, opts = {}, worldStateFork, processor, validator, l1Constants, dateProvider, telemetryClient = getTelemetryClient()) {
16
17
  const blockBuildingTimer = new Timer();
17
18
  const blockNumber = newGlobalVariables.blockNumber;
18
- const slot = newGlobalVariables.slotNumber.toBigInt();
19
+ const slot = newGlobalVariables.slotNumber;
19
20
  const msgCount = l1ToL2Messages.length;
20
21
  const stateReference = await worldStateFork.getStateReference();
21
22
  const archiveTree = await worldStateFork.getTreeInfo(MerkleTreeId.ARCHIVE);
@@ -81,11 +82,14 @@ export class FullNodeBlockBuilder {
81
82
  const txPublicSetupAllowList = this.config.txPublicSetupAllowList ?? await getDefaultAllowedSetupFunctions();
82
83
  const contractsDB = new PublicContractsDB(this.contractDataSource);
83
84
  const guardedFork = new GuardedMerkleTreeOperations(fork);
84
- const publicTxSimulator = new TelemetryPublicTxSimulator(guardedFork, contractsDB, globalVariables, this.telemetryClient, {
85
- doMerkleOperations: true,
86
- skipFeeEnforcement: true,
87
- clientInitiatedSimulation: false
88
- });
85
+ const publicTxSimulator = new TelemetryPublicTxSimulator(guardedFork, contractsDB, globalVariables, this.telemetryClient, PublicSimulatorConfig.from({
86
+ skipFeeEnforcement: false,
87
+ collectDebugLogs: false,
88
+ collectHints: false,
89
+ maxDebugLogMemoryReads: 0,
90
+ collectStatistics: false,
91
+ collectCallMetadata: false
92
+ }));
89
93
  const processor = new PublicProcessor(globalVariables, guardedFork, contractsDB, publicTxSimulator, this.dateProvider, this.telemetryClient, undefined, this.config);
90
94
  const validator = createValidatorForBlockBuilding(fork, this.contractDataSource, globalVariables, txPublicSetupAllowList);
91
95
  return {
@@ -4,4 +4,4 @@ export type SequencerContracts = {
4
4
  rollupContract: RollupContract;
5
5
  governanceProposerContract: GovernanceProposerContract;
6
6
  };
7
- //# sourceMappingURL=config.d.ts.map
7
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY29uZmlnLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvc2VxdWVuY2VyL2NvbmZpZy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSwwQkFBMEIsRUFBRSxjQUFjLEVBQUUsTUFBTSxpQkFBaUIsQ0FBQztBQUVsRixPQUFPLEVBQUUsS0FBSyxlQUFlLEVBQUUsTUFBTSxzQkFBc0IsQ0FBQztBQUU1RCxNQUFNLE1BQU0sa0JBQWtCLEdBQUc7SUFDL0IsY0FBYyxFQUFFLGNBQWMsQ0FBQztJQUMvQiwwQkFBMEIsRUFBRSwwQkFBMEIsQ0FBQztDQUN4RCxDQUFDIn0=
@@ -8,4 +8,4 @@ export declare class SequencerTooSlowError extends Error {
8
8
  export declare class SequencerInterruptedError extends Error {
9
9
  constructor();
10
10
  }
11
- //# sourceMappingURL=errors.d.ts.map
11
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiZXJyb3JzLmQudHMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvc2VxdWVuY2VyL2Vycm9ycy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLEtBQUssRUFBRSxjQUFjLEVBQUUsTUFBTSxZQUFZLENBQUM7QUFFakQscUJBQWEscUJBQXNCLFNBQVEsS0FBSzthQUU1QixhQUFhLEVBQUUsY0FBYzthQUM3QixjQUFjLEVBQUUsTUFBTTthQUN0QixXQUFXLEVBQUUsTUFBTTtJQUhyQyxZQUNrQixhQUFhLEVBQUUsY0FBYyxFQUM3QixjQUFjLEVBQUUsTUFBTSxFQUN0QixXQUFXLEVBQUUsTUFBTSxFQU1wQztDQUNGO0FBRUQscUJBQWEseUJBQTBCLFNBQVEsS0FBSztJQUNsRCxjQUdDO0NBQ0YifQ==
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/sequencer/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,qBAAa,qBAAsB,SAAQ,KAAK;aAE5B,aAAa,EAAE,cAAc;aAC7B,cAAc,EAAE,MAAM;aACtB,WAAW,EAAE,MAAM;gBAFnB,aAAa,EAAE,cAAc,EAC7B,cAAc,EAAE,MAAM,EACtB,WAAW,EAAE,MAAM;CAOtC;AAED,qBAAa,yBAA0B,SAAQ,KAAK;;CAKnD"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/sequencer/errors.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAEjD,qBAAa,qBAAsB,SAAQ,KAAK;aAE5B,aAAa,EAAE,cAAc;aAC7B,cAAc,EAAE,MAAM;aACtB,WAAW,EAAE,MAAM;IAHrC,YACkB,aAAa,EAAE,cAAc,EAC7B,cAAc,EAAE,MAAM,EACtB,WAAW,EAAE,MAAM,EAMpC;CACF;AAED,qBAAa,yBAA0B,SAAQ,KAAK;IAClD,cAGC;CACF"}
@@ -1,4 +1,4 @@
1
1
  export * from './block_builder.js';
2
2
  export * from './config.js';
3
3
  export * from './sequencer.js';
4
- //# sourceMappingURL=index.d.ts.map
4
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uL3NyYy9zZXF1ZW5jZXIvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxvQkFBb0IsQ0FBQztBQUNuQyxjQUFjLGFBQWEsQ0FBQztBQUM1QixjQUFjLGdCQUFnQixDQUFDIn0=
@@ -1,5 +1,6 @@
1
1
  import { EthAddress } from '@aztec/aztec.js/addresses';
2
2
  import type { RollupContract } from '@aztec/ethereum';
3
+ import type { SlotNumber } from '@aztec/foundation/branded-types';
3
4
  import { type TelemetryClient, type Tracer } from '@aztec/telemetry-client';
4
5
  import { type Hex } from 'viem';
5
6
  import type { SequencerState } from './utils.js';
@@ -18,6 +19,10 @@ export declare class SequencerMetrics {
18
19
  private rewards;
19
20
  private slots;
20
21
  private filledSlots;
22
+ private blockProposalFailed;
23
+ private blockProposalSuccess;
24
+ private blockProposalPrecheckFailed;
25
+ private slashingAttempts;
21
26
  private lastSeenSlot?;
22
27
  constructor(client: TelemetryClient, rollup: RollupContract, name?: string);
23
28
  recordRequiredAttestations(requiredAttestationsCount: number, allowanceMs: number): void;
@@ -25,7 +30,11 @@ export declare class SequencerMetrics {
25
30
  recordBuiltBlock(buildDurationMs: number, totalMana: number): void;
26
31
  recordFailedBlock(): void;
27
32
  recordStateTransitionBufferMs(durationMs: number, state: SequencerState): void;
28
- incOpenSlot(slot: bigint, proposer: string): void;
33
+ incOpenSlot(slot: SlotNumber, proposer: string): void;
29
34
  incFilledSlot(proposer: string, coinbase: Hex | EthAddress | undefined): Promise<void>;
35
+ recordBlockProposalFailed(reason?: string): void;
36
+ recordBlockProposalSuccess(): void;
37
+ recordBlockProposalPrecheckFailed(checkType: string): void;
38
+ recordSlashingAttempt(actionCount: number): void;
30
39
  }
31
- //# sourceMappingURL=metrics.d.ts.map
40
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWV0cmljcy5kLnRzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vc3JjL3NlcXV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ACE,MAAM,EAAE,eAAe,EACf,MAAM,EAAE,cAAc,EAC9B,IAAI,SAAc,EAuGnB;IAEM,0BAA0B,CAAC,yBAAyB,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,QAOvF;IAEM,2BAA2B,CAAC,KAAK,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,QAGnE;IAED,gBAAgB,CAAC,eAAe,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,QAM1D;IAED,iBAAiB,SAIhB;IAED,6BAA6B,CAAC,UAAU,EAAE,MAAM,EAAE,KAAK,EAAE,cAAc,QAItE;IAED,WAAW,CAAC,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,QAW7C;IAEK,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,GAAG,UAAU,GAAG,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAiB3F;IAED,yBAAyB,CAAC,MAAM,CAAC,EAAE,MAAM,QAIxC;IAED,0BAA0B,SAEzB;IAED,iCAAiC,CAAC,SAAS,EAAE,MAAM,QAIlD;IAED,qBAAqB,CAAC,WAAW,EAAE,MAAM,QAExC;CACF"}
@@ -16,6 +16,10 @@ export class SequencerMetrics {
16
16
  rewards;
17
17
  slots;
18
18
  filledSlots;
19
+ blockProposalFailed;
20
+ blockProposalSuccess;
21
+ blockProposalPrecheckFailed;
22
+ slashingAttempts;
19
23
  lastSeenSlot;
20
24
  constructor(client, rollup, name = 'Sequencer'){
21
25
  this.rollup = rollup;
@@ -77,6 +81,22 @@ export class SequencerMetrics {
77
81
  valueType: ValueType.INT,
78
82
  description: 'The minimum number of attestations required to publish a block'
79
83
  });
84
+ this.blockProposalFailed = this.meter.createUpDownCounter(Metrics.SEQUENCER_BLOCK_PROPOSAL_FAILED_COUNT, {
85
+ valueType: ValueType.INT,
86
+ description: 'The number of times block proposal failed (including validation builds)'
87
+ });
88
+ this.blockProposalSuccess = this.meter.createUpDownCounter(Metrics.SEQUENCER_BLOCK_PROPOSAL_SUCCESS_COUNT, {
89
+ valueType: ValueType.INT,
90
+ description: 'The number of times block proposal succeeded (including validation builds)'
91
+ });
92
+ this.blockProposalPrecheckFailed = this.meter.createUpDownCounter(Metrics.SEQUENCER_BLOCK_PROPOSAL_PRECHECK_FAILED_COUNT, {
93
+ valueType: ValueType.INT,
94
+ description: 'The number of times block proposal pre-build checks failed'
95
+ });
96
+ this.slashingAttempts = this.meter.createUpDownCounter(Metrics.SEQUENCER_SLASHING_ATTEMPTS_COUNT, {
97
+ valueType: ValueType.INT,
98
+ description: 'The number of slashing action attempts'
99
+ });
80
100
  }
81
101
  recordRequiredAttestations(requiredAttestationsCount, allowanceMs) {
82
102
  this.requiredAttestions.record(requiredAttestationsCount);
@@ -133,4 +153,22 @@ export class SequencerMetrics {
133
153
  }
134
154
  }
135
155
  }
156
+ recordBlockProposalFailed(reason) {
157
+ this.blockProposalFailed.add(1, {
158
+ ...reason && {
159
+ [Attributes.ERROR_TYPE]: reason
160
+ }
161
+ });
162
+ }
163
+ recordBlockProposalSuccess() {
164
+ this.blockProposalSuccess.add(1);
165
+ }
166
+ recordBlockProposalPrecheckFailed(checkType) {
167
+ this.blockProposalPrecheckFailed.add(1, {
168
+ [Attributes.ERROR_TYPE]: checkType
169
+ });
170
+ }
171
+ recordSlashingAttempt(actionCount) {
172
+ this.slashingAttempts.add(actionCount);
173
+ }
136
174
  }