Add Header
fields while maintaining backwards compatibility
#7820
Labels
A-db
Related to the database
E-prague
Related to the prague network upgrade
M-prevent-stale
Prevents old inactive issues/PRs from being closed due to inactivity
S-needs-investigation
This issue requires detective work to figure out what's going wrong
Describe the feature
With Prague coming up, we should take this into account.
Generally with
Compact
, the reader first reads a fixed size bitflag struct (eg.HeaderFlags
) and uses that to read the number of bytes necessary for each field.As long as there are bits available on this bitflag struct, we can keep adding new fields to
Header
under the form ofOption<FIELD>
while maintaing backwards compatability. Each Option<> uses one bit in the bitflag struct. However, we have reached the limit, there's only one bit left.The next
Option<N>
has to be something likeOption<HeaderExt>
. N can be whatever we want it to be.Previous instances of Header will read that bit flag as 0 and ignore that field, and the new Header changes will read that bit as 1 and decode it
Additional context
No response
The text was updated successfully, but these errors were encountered: