@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.
- package/dest/client/sequencer-client.d.ts +1 -1
- package/dest/client/sequencer-client.d.ts.map +1 -1
- package/dest/client/sequencer-client.js +0 -4
- package/dest/publisher/sequencer-publisher-factory.d.ts +1 -3
- package/dest/publisher/sequencer-publisher-factory.d.ts.map +1 -1
- package/dest/publisher/sequencer-publisher-factory.js +0 -1
- package/dest/publisher/sequencer-publisher.d.ts +8 -9
- package/dest/publisher/sequencer-publisher.d.ts.map +1 -1
- package/dest/publisher/sequencer-publisher.js +41 -54
- package/dest/sequencer/checkpoint_proposal_job.d.ts +4 -2
- package/dest/sequencer/checkpoint_proposal_job.d.ts.map +1 -1
- package/dest/sequencer/checkpoint_proposal_job.js +32 -36
- package/dest/sequencer/sequencer.d.ts +1 -1
- package/dest/sequencer/sequencer.d.ts.map +1 -1
- package/dest/sequencer/sequencer.js +16 -12
- package/dest/sequencer/timetable.d.ts +4 -1
- package/dest/sequencer/timetable.d.ts.map +1 -1
- package/dest/sequencer/timetable.js +15 -5
- package/package.json +27 -27
- package/src/client/sequencer-client.ts +0 -7
- package/src/publisher/sequencer-publisher-factory.ts +0 -3
- package/src/publisher/sequencer-publisher.ts +62 -74
- package/src/sequencer/README.md +81 -12
- package/src/sequencer/checkpoint_proposal_job.ts +37 -43
- package/src/sequencer/sequencer.ts +22 -15
- package/src/sequencer/timetable.ts +19 -8
|
@@ -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
|
-
|
|
120
|
-
|
|
121
|
-
|
|
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
|
-
|
|
128
|
-
|
|
129
|
-
|
|
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,
|