@aztec/sequencer-client 0.0.1-commit.f5d02921e → 0.0.1-commit.f650c0a5c

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.
@@ -70,6 +70,9 @@ export class SequencerTimetable {
70
70
  /** Maximum number of blocks that can be built in this slot configuration */
71
71
  public readonly maxNumberOfBlocks: number;
72
72
 
73
+ /** Whether pipelining is enabled (checkpoint finalization deferred to next slot). */
74
+ public readonly pipelining: boolean;
75
+
73
76
  constructor(
74
77
  opts: {
75
78
  ethereumSlotDuration: number;
@@ -78,6 +81,7 @@ export class SequencerTimetable {
78
81
  p2pPropagationTime?: number;
79
82
  blockDurationMs?: number;
80
83
  enforce: boolean;
84
+ pipelining?: boolean;
81
85
  },
82
86
  private readonly metrics?: SequencerMetrics,
83
87
  private readonly log?: Logger,
@@ -88,6 +92,7 @@ export class SequencerTimetable {
88
92
  this.p2pPropagationTime = opts.p2pPropagationTime ?? DEFAULT_P2P_PROPAGATION_TIME;
89
93
  this.blockDuration = opts.blockDurationMs ? opts.blockDurationMs / 1000 : undefined;
90
94
  this.enforce = opts.enforce;
95
+ this.pipelining = opts.pipelining ?? false;
91
96
 
92
97
  // Assume zero-cost propagation time and faster runs in test environments where L1 slot duration is shortened
93
98
  if (this.ethereumSlotDuration < 8) {
@@ -116,18 +121,23 @@ export class SequencerTimetable {
116
121
  if (!this.blockDuration) {
117
122
  this.maxNumberOfBlocks = 1; // Single block per slot
118
123
  } else {
119
- const timeReservedAtEnd =
120
- this.blockDuration + // Last sub-slot for validator re-execution
121
- this.checkpointFinalizationTime; // Checkpoint finalization
124
+ // When pipelining, finalization is deferred to the next slot, but we still need
125
+ // a sub-slot for validator re-execution so they can produce attestations.
126
+ let timeReservedAtEnd = this.blockDuration; // Validatior re-execution only
127
+ if (!this.pipelining) {
128
+ timeReservedAtEnd += this.checkpointFinalizationTime;
129
+ }
130
+
122
131
  const timeAvailableForBlocks = this.aztecSlotDuration - this.initializationOffset - timeReservedAtEnd;
123
132
  this.maxNumberOfBlocks = Math.floor(timeAvailableForBlocks / this.blockDuration);
124
133
  }
125
134
 
126
- // Minimum work to do within a slot for building a block with the minimum time for execution and publishing its checkpoint
127
- const minWorkToDo =
128
- this.initializationOffset +
129
- this.minExecutionTime * 2 + // Execution and reexecution
130
- this.checkpointFinalizationTime;
135
+ // Minimum work to do within a slot for building a block with the minimum time for execution and publishing its checkpoint.
136
+ // When pipelining, finalization is deferred, but we still need time for execution and validator re-execution.
137
+ let minWorkToDo = this.initializationOffset + this.minExecutionTime * 2;
138
+ if (!this.pipelining) {
139
+ minWorkToDo += this.checkpointFinalizationTime;
140
+ }
131
141
 
132
142
  const initializeDeadline = this.aztecSlotDuration - minWorkToDo;
133
143
  this.initializeDeadline = initializeDeadline;
@@ -144,6 +154,7 @@ export class SequencerTimetable {
144
154
  blockAssembleTime: this.checkpointAssembleTime,
145
155
  initializeDeadline: this.initializeDeadline,
146
156
  enforce: this.enforce,
157
+ pipelining: this.pipelining,
147
158
  minWorkToDo,
148
159
  blockDuration: this.blockDuration,
149
160
  maxNumberOfBlocks: this.maxNumberOfBlocks,