@aztec/sequencer-client 0.0.1-commit.b2a5d0dd1 → 0.0.1-commit.b3d3157a

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 (75) hide show
  1. package/README.md +281 -21
  2. package/dest/client/sequencer-client.d.ts +3 -3
  3. package/dest/client/sequencer-client.d.ts.map +1 -1
  4. package/dest/client/sequencer-client.js +6 -6
  5. package/dest/config.d.ts +6 -3
  6. package/dest/config.d.ts.map +1 -1
  7. package/dest/config.js +33 -10
  8. package/dest/global_variable_builder/fee_provider.js +1 -1
  9. package/dest/global_variable_builder/global_builder.d.ts +2 -3
  10. package/dest/global_variable_builder/global_builder.d.ts.map +1 -1
  11. package/dest/global_variable_builder/global_builder.js +1 -1
  12. package/dest/index.d.ts +2 -2
  13. package/dest/index.d.ts.map +1 -1
  14. package/dest/index.js +1 -1
  15. package/dest/publisher/config.d.ts +3 -3
  16. package/dest/publisher/config.d.ts.map +1 -1
  17. package/dest/publisher/sequencer-bundle-simulator.d.ts +96 -0
  18. package/dest/publisher/sequencer-bundle-simulator.d.ts.map +1 -0
  19. package/dest/publisher/sequencer-bundle-simulator.js +198 -0
  20. package/dest/publisher/sequencer-publisher.d.ts +36 -36
  21. package/dest/publisher/sequencer-publisher.d.ts.map +1 -1
  22. package/dest/publisher/sequencer-publisher.js +271 -500
  23. package/dest/sequencer/automine/automine_factory.d.ts +54 -0
  24. package/dest/sequencer/automine/automine_factory.d.ts.map +1 -0
  25. package/dest/sequencer/automine/automine_factory.js +84 -0
  26. package/dest/sequencer/automine/automine_sequencer.d.ts +151 -0
  27. package/dest/sequencer/automine/automine_sequencer.d.ts.map +1 -0
  28. package/dest/sequencer/automine/automine_sequencer.js +509 -0
  29. package/dest/sequencer/chain_state_overrides.d.ts +52 -16
  30. package/dest/sequencer/chain_state_overrides.d.ts.map +1 -1
  31. package/dest/sequencer/chain_state_overrides.js +86 -27
  32. package/dest/sequencer/checkpoint_proposal_job.d.ts +24 -6
  33. package/dest/sequencer/checkpoint_proposal_job.d.ts.map +1 -1
  34. package/dest/sequencer/checkpoint_proposal_job.js +373 -83
  35. package/dest/sequencer/events.d.ts +42 -2
  36. package/dest/sequencer/events.d.ts.map +1 -1
  37. package/dest/sequencer/index.d.ts +3 -1
  38. package/dest/sequencer/index.d.ts.map +1 -1
  39. package/dest/sequencer/index.js +2 -0
  40. package/dest/sequencer/metrics.d.ts +3 -1
  41. package/dest/sequencer/metrics.d.ts.map +1 -1
  42. package/dest/sequencer/metrics.js +7 -0
  43. package/dest/sequencer/sequencer.d.ts +44 -9
  44. package/dest/sequencer/sequencer.d.ts.map +1 -1
  45. package/dest/sequencer/sequencer.js +256 -79
  46. package/dest/sequencer/timetable.d.ts +3 -6
  47. package/dest/sequencer/timetable.d.ts.map +1 -1
  48. package/dest/sequencer/timetable.js +3 -7
  49. package/dest/sequencer/types.d.ts +2 -2
  50. package/dest/sequencer/types.d.ts.map +1 -1
  51. package/dest/test/utils.d.ts +1 -1
  52. package/dest/test/utils.d.ts.map +1 -1
  53. package/dest/test/utils.js +7 -6
  54. package/package.json +27 -27
  55. package/src/client/sequencer-client.ts +12 -7
  56. package/src/config.ts +38 -10
  57. package/src/global_variable_builder/fee_provider.ts +1 -1
  58. package/src/global_variable_builder/global_builder.ts +2 -3
  59. package/src/index.ts +10 -1
  60. package/src/publisher/config.ts +2 -2
  61. package/src/publisher/sequencer-bundle-simulator.ts +254 -0
  62. package/src/publisher/sequencer-publisher.ts +286 -521
  63. package/src/sequencer/README.md +162 -520
  64. package/src/sequencer/automine/README.md +46 -0
  65. package/src/sequencer/automine/automine_factory.ts +145 -0
  66. package/src/sequencer/automine/automine_sequencer.ts +595 -0
  67. package/src/sequencer/chain_state_overrides.ts +133 -58
  68. package/src/sequencer/checkpoint_proposal_job.ts +420 -100
  69. package/src/sequencer/events.ts +46 -2
  70. package/src/sequencer/index.ts +2 -0
  71. package/src/sequencer/metrics.ts +9 -0
  72. package/src/sequencer/sequencer.ts +284 -95
  73. package/src/sequencer/timetable.ts +2 -9
  74. package/src/sequencer/types.ts +1 -1
  75. package/src/test/utils.ts +28 -10
@@ -74,12 +74,9 @@ export class SequencerTimetable {
74
74
  /** Maximum number of blocks that can be built in this slot configuration */
75
75
  public readonly maxNumberOfBlocks: number;
76
76
 
77
- /** Whether pipelining is enabled (checkpoint finalization deferred to next slot). */
78
- public readonly pipelining: boolean;
79
-
80
77
  /**
81
- * How far into the target slot attestation collection can extend when pipelining.
82
- * Covers validator re-execution (one block duration) plus one-way attestation return.
78
+ * How far into the target slot assembly and attestation collection can start when pipelining.
79
+ * Production-like timing keeps this at zero; fast local publishing profiles can use the attestation window.
83
80
  */
84
81
  public readonly pipeliningAttestationGracePeriod: number;
85
82
 
@@ -91,7 +88,6 @@ export class SequencerTimetable {
91
88
  p2pPropagationTime?: number;
92
89
  blockDurationMs?: number;
93
90
  enforce: boolean;
94
- pipelining?: boolean;
95
91
  },
96
92
  private readonly metrics?: SequencerMetrics,
97
93
  private readonly log?: Logger,
@@ -101,7 +97,6 @@ export class SequencerTimetable {
101
97
  this.l1PublishingTime = opts.l1PublishingTime;
102
98
  this.blockDuration = opts.blockDurationMs ? opts.blockDurationMs / 1000 : undefined;
103
99
  this.enforce = opts.enforce;
104
- this.pipelining = opts.pipelining ?? false;
105
100
 
106
101
  this.checkpointTiming = createCheckpointTimingModel({
107
102
  aztecSlotDuration: this.aztecSlotDuration,
@@ -109,7 +104,6 @@ export class SequencerTimetable {
109
104
  blockDuration: this.blockDuration,
110
105
  l1PublishingTime: this.l1PublishingTime,
111
106
  p2pPropagationTime: opts.p2pPropagationTime ?? DEFAULT_P2P_PROPAGATION_TIME,
112
- pipelining: this.pipelining,
113
107
  });
114
108
 
115
109
  this.p2pPropagationTime = this.checkpointTiming.p2pPropagationTime;
@@ -137,7 +131,6 @@ export class SequencerTimetable {
137
131
  blockAssembleTime: this.checkpointAssembleTime,
138
132
  initializeDeadline: this.initializeDeadline,
139
133
  enforce: this.enforce,
140
- pipelining: this.pipelining,
141
134
  pipeliningAttestationGracePeriod: this.pipeliningAttestationGracePeriod,
142
135
  minWorkToDo: this.checkpointTiming.minimumBuildSlotWork,
143
136
  blockDuration: this.blockDuration,
@@ -2,5 +2,5 @@ import type { L1RollupConstants } from '@aztec/stdlib/epoch-helpers';
2
2
 
3
3
  export type SequencerRollupConstants = Pick<
4
4
  L1RollupConstants,
5
- 'ethereumSlotDuration' | 'l1GenesisTime' | 'slotDuration' | 'rollupManaLimit'
5
+ 'ethereumSlotDuration' | 'l1GenesisTime' | 'slotDuration' | 'rollupManaLimit' | 'epochDuration'
6
6
  >;
package/src/test/utils.ts CHANGED
@@ -10,7 +10,11 @@ import { PublicDataWrite } from '@aztec/stdlib/avm';
10
10
  import { CommitteeAttestation, L2Block } from '@aztec/stdlib/block';
11
11
  import { BlockProposal, CheckpointAttestation, CheckpointProposal, ConsensusPayload } from '@aztec/stdlib/p2p';
12
12
  import { CheckpointHeader } from '@aztec/stdlib/rollup';
13
- import { makeAppendOnlyTreeSnapshot, mockTxForRollup } from '@aztec/stdlib/testing';
13
+ import {
14
+ TEST_COORDINATION_SIGNATURE_CONTEXT,
15
+ makeAppendOnlyTreeSnapshot,
16
+ mockTxForRollup,
17
+ } from '@aztec/stdlib/testing';
14
18
  import { BlockHeader, GlobalVariables, type Tx, makeProcessedTxFromPrivateOnlyTx } from '@aztec/stdlib/tx';
15
19
 
16
20
  import type { MockProxy } from 'jest-mock-extended';
@@ -109,6 +113,7 @@ export function createBlockProposal(block: L2Block, signature: Signature): Block
109
113
  block.archive.root,
110
114
  txHashes,
111
115
  signature,
116
+ TEST_COORDINATION_SIGNATURE_CONTEXT,
112
117
  );
113
118
  }
114
119
 
@@ -123,12 +128,19 @@ export function createCheckpointProposal(
123
128
  ): CheckpointProposal {
124
129
  const txHashes = block.body.txEffects.map(tx => tx.txHash);
125
130
  const checkpointHeader = createCheckpointHeaderFromBlock(block);
126
- return new CheckpointProposal(checkpointHeader, block.archive.root, feeAssetPriceModifier, checkpointSignature, {
127
- blockHeader: block.header,
128
- indexWithinCheckpoint: block.indexWithinCheckpoint,
129
- txHashes,
130
- signature: blockSignature ?? checkpointSignature, // Use checkpoint signature as block signature if not provided
131
- });
131
+ return new CheckpointProposal(
132
+ checkpointHeader,
133
+ block.archive.root,
134
+ feeAssetPriceModifier,
135
+ checkpointSignature,
136
+ TEST_COORDINATION_SIGNATURE_CONTEXT,
137
+ {
138
+ blockHeader: block.header,
139
+ indexWithinCheckpoint: block.indexWithinCheckpoint,
140
+ txHashes,
141
+ signature: blockSignature ?? checkpointSignature, // Use checkpoint signature as block signature if not provided
142
+ },
143
+ );
132
144
  }
133
145
 
134
146
  /**
@@ -143,10 +155,16 @@ export function createCheckpointAttestation(
143
155
  feeAssetPriceModifier: bigint = 0n,
144
156
  ): CheckpointAttestation {
145
157
  const checkpointHeader = createCheckpointHeaderFromBlock(block);
146
- const payload = new ConsensusPayload(checkpointHeader, block.archive.root, feeAssetPriceModifier);
158
+ const payload = new ConsensusPayload(
159
+ checkpointHeader,
160
+ block.archive.root,
161
+ feeAssetPriceModifier,
162
+ TEST_COORDINATION_SIGNATURE_CONTEXT,
163
+ );
147
164
  const attestation = new CheckpointAttestation(payload, signature, signature);
148
- // Set sender directly for testing (bypasses signature recovery)
149
- (attestation as any).sender = sender;
165
+ // Bypass signature recovery for testing since we use random signatures
166
+ (attestation as any).getSender = () => sender;
167
+ (attestation as any).getProposer = () => sender;
150
168
  return attestation;
151
169
  }
152
170