@aztec/sequencer-client 0.0.1-commit.2b2662070 → 0.0.1-commit.2c0ee1788
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/config.d.ts +2 -1
- package/dest/config.d.ts.map +1 -1
- package/dest/config.js +12 -7
- package/dest/publisher/sequencer-publisher.d.ts +1 -1
- package/dest/publisher/sequencer-publisher.d.ts.map +1 -1
- package/dest/publisher/sequencer-publisher.js +2 -2
- package/dest/sequencer/checkpoint_proposal_job.d.ts +22 -3
- package/dest/sequencer/checkpoint_proposal_job.d.ts.map +1 -1
- package/dest/sequencer/checkpoint_proposal_job.js +361 -43
- package/dest/sequencer/events.d.ts +6 -1
- package/dest/sequencer/events.d.ts.map +1 -1
- package/dest/sequencer/metrics.d.ts +5 -1
- package/dest/sequencer/metrics.d.ts.map +1 -1
- package/dest/sequencer/metrics.js +22 -0
- package/dest/sequencer/sequencer.d.ts +12 -4
- package/dest/sequencer/sequencer.d.ts.map +1 -1
- package/dest/sequencer/sequencer.js +33 -8
- package/dest/test/utils.d.ts +1 -1
- package/dest/test/utils.d.ts.map +1 -1
- package/dest/test/utils.js +7 -6
- package/package.json +27 -27
- package/src/config.ts +11 -4
- package/src/publisher/sequencer-publisher.ts +2 -4
- package/src/sequencer/README.md +20 -21
- package/src/sequencer/checkpoint_proposal_job.ts +414 -44
- package/src/sequencer/events.ts +5 -0
- package/src/sequencer/metrics.ts +29 -0
- package/src/sequencer/sequencer.ts +37 -9
- package/src/test/utils.ts +28 -10
package/src/sequencer/README.md
CHANGED
|
@@ -48,7 +48,7 @@ In a typical configuration without pipelining, a 72-second slot contains:
|
|
|
48
48
|
- 1 last validator re-execution sub-slot (8 seconds)
|
|
49
49
|
- 1 attestation and publishing period (17 seconds)
|
|
50
50
|
|
|
51
|
-
With proposer pipelining enabled, the last validator re-execution sub-slot is still reserved, but the
|
|
51
|
+
With proposer pipelining enabled, the last validator re-execution sub-slot is still reserved, but L1 publishing is deferred to the target slot and removed from the current slot budget. Attestation collection is completed inside the build slot itself, so the proposer can send the L1 transaction immediately at the target-slot boundary.
|
|
52
52
|
|
|
53
53
|
### The Fixed Sub-Slot Model
|
|
54
54
|
|
|
@@ -89,7 +89,8 @@ timeReservedAtEnd (normal mode) = blockDuration (last sub-slot for
|
|
|
89
89
|
+ checkpointFinalizationTime
|
|
90
90
|
|
|
91
91
|
timeReservedAtEnd (pipelining) = assembleTime
|
|
92
|
-
+ propagationTime
|
|
92
|
+
+ 2 * propagationTime (proposal out + attestations back)
|
|
93
|
+
+ blockDuration (last-block re-execution)
|
|
93
94
|
|
|
94
95
|
timeAvailableForBlocks = slotDuration - initializationOffset - timeReservedAtEnd
|
|
95
96
|
|
|
@@ -110,47 +111,45 @@ This means:
|
|
|
110
111
|
|
|
111
112
|
**The same slot with proposer pipelining enabled:**
|
|
112
113
|
```
|
|
113
|
-
timeReservedAtEnd = 1s + 2s =
|
|
114
|
-
timeAvailableForBlocks = 72s - 2s -
|
|
115
|
-
numberOfBlocks = floor(
|
|
114
|
+
timeReservedAtEnd = 1s + 2*2s + 8s = 13s
|
|
115
|
+
timeAvailableForBlocks = 72s - 2s - 13s = 57s
|
|
116
|
+
numberOfBlocks = floor(57s / 8s) = 7 blocks
|
|
116
117
|
```
|
|
117
118
|
|
|
118
|
-
The extra two block opportunities come from not charging the current slot for
|
|
119
|
+
The extra two block opportunities come from not charging the current slot for L1 publishing. The proposal broadcast, attestation round-trip, and last-block re-execution are now all reserved inside the build slot so that attestations are in hand at the slot boundary.
|
|
119
120
|
|
|
120
121
|
### Pipelining Mode
|
|
121
122
|
|
|
122
|
-
When proposer pipelining is enabled, the sequencer uses the current wall-clock slot to build the checkpoint for the **next target slot
|
|
123
|
+
When proposer pipelining is enabled, the sequencer uses the current wall-clock slot to build the checkpoint for the **next target slot**, and finishes collecting attestations before the slot boundary so that L1 publishing can happen immediately at the target-slot boundary.
|
|
123
124
|
|
|
124
125
|
It helps to think in terms of two different slots:
|
|
125
126
|
|
|
126
|
-
- **Wall-clock slot N-1**: The sequencer initializes checkpoint `N`, builds its blocks,
|
|
127
|
-
- **Target slot N**:
|
|
127
|
+
- **Wall-clock slot N-1**: The sequencer initializes checkpoint `N`, builds its blocks, validators re-execute the last block, and attestations are gathered
|
|
128
|
+
- **Target slot N**: The checkpoint is submitted to L1
|
|
128
129
|
|
|
129
130
|
So the work is split like this:
|
|
130
131
|
|
|
131
|
-
- **During slot N-1**: Initialization, block building,
|
|
132
|
-
- **
|
|
133
|
-
- **During slot N**: Validators finish re-executing, send attestations, the proposer collects them, and the checkpoint is submitted to L1 before slot `N` reaches its publish cutoff
|
|
132
|
+
- **During slot N-1**: Initialization, block building, last-block re-execution, proposal broadcast, and attestation collection
|
|
133
|
+
- **At the start of slot N**: The L1 transaction is submitted — attestations are already in hand
|
|
134
134
|
|
|
135
|
-
In other words, pipelining
|
|
135
|
+
In other words, pipelining moves **block production, block re-execution, proposal broadcast, and attestation collection** into the build slot, while **L1 submission** happens aligned with slot `N`. With default values (72s slot, 6s block, 2s p2p, 1s assemble), the last build-slot block finishes at `T = slotDuration - timeReservedAtEnd = 61s`, the proposer broadcasts the checkpoint at `T=62s` after `assembleTime=1s`, and attestations are in hand by `T=72s` (the slot boundary).
|
|
136
136
|
|
|
137
137
|
**Example: building checkpoint 12 while wall-clock time is in slot 11**
|
|
138
138
|
```
|
|
139
139
|
Slot 11 (wall clock):
|
|
140
140
|
- Build blocks that will make up checkpoint 12
|
|
141
|
-
- Validators re-execute the last block of checkpoint 12
|
|
142
141
|
- Broadcast checkpoint 12 proposal
|
|
143
|
-
-
|
|
142
|
+
- Validators re-execute the last block of checkpoint 12
|
|
143
|
+
- Collect checkpoint 12 attestations (all complete before slot 11 ends)
|
|
144
144
|
|
|
145
145
|
Slot 12 (target/submission slot):
|
|
146
|
-
-
|
|
147
|
-
- Submit checkpoint 12 to L1
|
|
146
|
+
- Submit checkpoint 12 to L1 at the slot boundary
|
|
148
147
|
```
|
|
149
148
|
|
|
150
|
-
For timetable purposes
|
|
149
|
+
For timetable purposes:
|
|
151
150
|
|
|
152
|
-
- `maxNumberOfBlocks` is computed by reserving
|
|
153
|
-
- `initializeDeadline` no longer subtracts checkpoint finalization time; it only requires enough time for initialization
|
|
151
|
+
- `maxNumberOfBlocks` is computed by reserving assembly + round-trip p2p + last-block re-execution at the end of the slot
|
|
152
|
+
- `initializeDeadline` no longer subtracts checkpoint finalization time; it only requires enough time for initialization and two execution windows
|
|
154
153
|
|
|
155
154
|
In code, that means:
|
|
156
155
|
|
|
@@ -162,7 +161,7 @@ initializeDeadline (pipelining) =
|
|
|
162
161
|
slotDuration - initializationOffset - 2 * minExecutionTime
|
|
163
162
|
```
|
|
164
163
|
|
|
165
|
-
The fixed sub-slot deadlines themselves do not change. Pipelining only changes how much of the slot is considered available for block building.
|
|
164
|
+
The fixed sub-slot deadlines themselves do not change. Pipelining only changes how much of the slot is considered available for block building, and when the broadcast and attestation windows close.
|
|
166
165
|
|
|
167
166
|
## The Sequencer's Work
|
|
168
167
|
|