1
1
---
2
2
simd : ' 0307'
3
- title : Add Block Header
3
+ title : Add Block Footer
4
4
authors :
5
5
- jherrera-jump (Firedancer)
6
6
category : Standard
@@ -14,7 +14,7 @@ development:
14
14
15
15
## Summary
16
16
17
- Add a block header to solana blocks and expose header fields in the
17
+ Add a block footer to Solana blocks and expose Footer fields in the
18
18
` getBlock ` rpc endpoint.
19
19
20
20
## Motivation
@@ -34,7 +34,7 @@ timestamps. Unfortunately there are some problems with the current approach:
34
34
- Vote timestamps will be removed with Alpenglow.
35
35
36
36
This SIMD solves these issues by including relevant information in a static
37
- block header .
37
+ block footer .
38
38
39
39
## New Terminology
40
40
@@ -63,19 +63,19 @@ set contains a handful of shreds (~32). Once sufficient shreds are available
63
63
the raw block data is reconstructed and reinterpreted as an array of entry
64
64
batches. Entry batches do not cross shred boundaries.
65
65
66
- This SIMD add the following header at the beginning of the raw block data. This
66
+ This SIMD add the following footer at the end of the raw block data. This
67
67
puts it on the same abstraction layer as serialized entry batch data. Put
68
- differently, the serialized header will be prepended to the first serialized
68
+ differently, the serialized footer will be appended after the last serialized
69
69
entry batch in the block.
70
70
71
71
```
72
- Block Header Layout
72
+ Block Footer Layout
73
73
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
74
- | block_header_flag (64 bits) |
74
+ | block_footer_flag (64 bits) |
75
75
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
76
76
| version (64 bits) |
77
77
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
78
- | header_length (16 bits) |
78
+ | footer_length (16 bits) |
79
79
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
80
80
| block_producer_time_nanos (64 bits) |
81
81
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
@@ -84,25 +84,29 @@ entry batch in the block.
84
84
| block_user_agent (0-255 bytes) |
85
85
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
86
86
87
- Note that header fields are packed together without any alignment requirements
87
+ Note that footer fields are packed together without any alignment requirements
88
88
or padding.
89
89
```
90
90
91
- - ` block_header_flag : u64` will always be zero. The first 8 bytes of an entry
91
+ - ` block_footer_flag : u64` will always be zero. The first 8 bytes of an entry
92
92
batch are always a positive number (the number of entries in the batch), so
93
- this flag allows parsers to differentiate between a normal entry batch and one
94
- with a header prepended. Though not strictly necessary, this may facilitate
95
- parsing block data, and allows us to make the header optional if we ever need
96
- to.
93
+ this flag allows parsers to differentiate the footer from a normal entry batch.
94
+ This facilitates parsing block data and would also allow us to make the footer
95
+ optional if that's ever needed.
97
96
98
97
- ` version: u64 ` is a positive integer which changes anytime a change is made to
99
- the header . The initial version will be 1.
98
+ the footer . The initial version will be 1.
100
99
101
- - ` header_length : u16` is the length of the rest of the header in bytes (i.e.
102
- not including the ` block_header_flag ` , ` version ` , and ` header_length ` fields).
100
+ - ` footer_length : u16` is the length of the rest of the footer in bytes (i.e.
101
+ not including the ` block_footer_flag ` , ` version ` , and ` footer_length ` fields).
103
102
104
103
- ` block_producer_time_nanos: u64 ` is a nanosecond UNIX timestamp representing
105
104
the time when the block producer started constructing the block.
105
+ "started constructing" is the point at which, from the perspective of the
106
+ leader, all of the consensus checks required for assuming leadership have
107
+ "just passed". For example, in Agave's pre-alpenglow implementations, this would
108
+ be in replay/maybe_start_leader. In a post-Alpenglow implementation, this would
109
+ be after receiving the proper vote/skip certificate for the previous slot.
106
110
107
111
- ` block_user_agent_len: u8 ` the length of the ` block_user_agent ` string in
108
112
bytes.
@@ -111,16 +115,16 @@ bytes.
111
115
provides identifying information about the block producer.
112
116
113
117
Any other fields that are deemed necessary in the future may be added with a
114
- corresponding change to ` version ` / ` header_length ` . For example, SIMD
118
+ corresponding change to ` version ` / ` footer_length ` . For example, SIMD
115
119
[ 0298] ( https://github.com/solana-foundation/solana-improvement-documents/pull/298 )
116
- proposes a field header, which could be added as a subsequent SIMD (or even
120
+ proposes a header field , which could be added as a subsequent SIMD (or even
117
121
folded into this one).
118
122
119
- ### Header Field Specification
123
+ ### Footer Field Specification
120
124
121
- Header fields will be unilaterally populated by their respective block producer
125
+ Footer fields will be unilaterally populated by their respective block producer
122
126
without any enforced constraint on their contents. This SIMD includes the
123
- following fields in the header
127
+ following fields in the footer
124
128
125
129
- ` block_producer_time_nanos ` : u64
126
130
- ` block_user_agent_len ` : u8
@@ -180,10 +184,10 @@ agave/v3.0.0 (doublezero) greedy-scheduler/v3 (mode:perf; another-flag)
180
184
181
185
### RPC Protocol Changes
182
186
183
- The ` getBlock ` RPC response will be extended to, optionally, include all header
184
- fields. The request will be extended with the ` header ` parameter, which lets
185
- the client signal that they want the header fields in the response. By default,
186
- header fields will be included in the response.
187
+ The ` getBlock ` RPC response will be extended to, optionally, include all footer
188
+ fields. The request will be extended with the ` footer ` parameter, which lets
189
+ the client signal that they want the footer fields in the response. By default,
190
+ footer fields will be included in the response.
187
191
188
192
Sample Request Payload
189
193
@@ -199,7 +203,7 @@ Sample Request Payload
199
203
"maxSupportedTransactionVersion" : 0 ,
200
204
"transactionDetails" : " full" ,
201
205
"rewards" : false ,
202
- "header " : true
206
+ "footer " : true
203
207
}
204
208
]
205
209
}
@@ -217,7 +221,7 @@ Sample Response Payload
217
221
"blockhash" : " 3Eq21vXNB5s86c62bVuUfTeaMif1N2kUqRPBmGRJhyTA" ,
218
222
"parentSlot" : 429 ,
219
223
"previousBlockhash" : " mfcyqEXB3DnHXki6KjjmZck6YjmZLvpAByy2fj4nh6B" ,
220
- "header " : {
224
+ "footer " : {
221
225
"blockProducerTimeNanos" : 1750176982899968023 ,
222
226
"blockUserAgent" : " agave/v3.0.0 (doublezero) greedy-scheduler/v3 (mode:perf; another-flag)" ,
223
227
},
@@ -246,7 +250,7 @@ Sample Response Payload
246
250
" SysvarC1ock11111111111111111111111111111111" ,
247
251
" Vote111111111111111111111111111111111111111"
248
252
],
249
- "header " : {
253
+ "footer " : {
250
254
"numReadonlySignedAccounts" : 0 ,
251
255
"numReadonlyUnsignedAccounts" : 3 ,
252
256
"numRequiredSignatures" : 1
@@ -272,14 +276,21 @@ Sample Response Payload
272
276
```
273
277
<!-- markdownlint-restore -->
274
278
279
+ ### Mandating the block footer
280
+
281
+ While it is possible to make the block footer optional thanks to the
282
+ ` block_footer_flag ` field, this proposal makes it mandatory. Blocks that don't
283
+ include a valid footer in the block payload will be flagged as dead blocks and
284
+ skipped by the other nodes in the cluster.
285
+
275
286
## Alternatives Considered
276
287
277
288
- Do nothing
278
289
- We can't estimate block time / duration with sufficient granularity. We
279
290
won't be able to estimate at all when votes are changed in alpenglow.
280
291
- We will continue to have an incomplete, ephemeral record of who produced
281
292
blocks.
282
- - derive timestamp header field from consensus and enforce user agent format
293
+ - derive timestamp footer field from consensus and enforce user agent format
283
294
- This can and probably should be implemented as a future SIMD. Meanwhile,
284
295
these fields are still useful since
285
296
1 . most of the cluster is expected to
@@ -297,11 +308,11 @@ Sample Response Payload
297
308
This change will enable more reliable monitoring and benchmarking for operators
298
309
and for the community. Clients and indexers will need to extend both in-memory
299
310
and long-term block storage to be aware of the new columns added to the block
300
- header . The client rpc engine will need to change to support the new fields.
311
+ footer . The client rpc engine will need to change to support the new fields.
301
312
302
313
## Security Considerations
303
314
304
- - The header fields are untrusted and purely informational. Tools that expose
315
+ - The footer fields are untrusted and purely informational. Tools that expose
305
316
these fields to external users should clearly communicate their untrusted
306
317
nature.
307
318
@@ -314,6 +325,6 @@ header. The client rpc engine will need to change to support the new fields.
314
325
- RPC requests for old slots should properly document and return a suitable
315
326
default value (e.g. None).
316
327
- Clients that don't implement this SIMD will reject new blocks because they
317
- will fail to parse the new header .
318
- - Because this header is mandatory, leaders that produce blocks without a
319
- header will skip, since the header is required .
328
+ will fail to parse the new footer .
329
+ - Because this footer is mandatory, leaders that produce blocks without a
330
+ footer will skip.
0 commit comments