SectorInfo.simple_qap => SectorInfo.flags #601
ZenGround0
started this conversation in
Enhancements - Technical
Replies: 2 comments
-
This sounds good to me. As a simple re-interpretation of some existing zero bits, I don't think we need a FIP to do it. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
For most of the changes tentatively aimed for the nv19 upgrade (fip 0047, activation bug fix and SDM) we need to do a migration over sector infos.
While we are here I propose moving simple_qap into a cbor int interpreted as a flags bitfield. The lowest order bit will be the simple_qap bit. This approach allows us to use the same space overhead as the current boolean representation but allow for more flag extensions to the sector info without necessarily requiring an upgrade. If we do end up using more flags this approach will be strictly more space efficient than adding another boolean flag. Note this is one of the places in the system where every byte matters. For every sector info byte we incur between 16 and 32 MiB of state tree size (depending on fraction of 32 GiB to 64 GiB sectors) for each EiB of raw byte storage. So ~ 1/4 - 1/2 a GiB per byte today.
CBOR Details
CBOR int headers look like
<maj-type><extra-data>
:0b000_01010
for values between 0 (
b0000_0000
) and 23 (b0001_0111
) the int value itself is packed in the header's extra data. Since cbor bools are one byte this means that we would get 3 additional flags for no extra byte cost as all flag permutations of four bits fit in a single byte CBOR int. Up to 64 new flags could be added beyond this without need for upgrade with additional byte overhead.Reasons not to do this
Adding complexity to sector info is not good for code complexity so maybe we want to discourage flag extensions to sector info by forcing a painful migration every time we add a flag.
Upgrades adding new flags might want to modify flags on existing sector infos which would be easiest to accomplish by a migration anyway. We used this approach to make the simple_qap flag, though we could have avoided at the cost of a little more code complexity.
Beta Was this translation helpful? Give feedback.
All reactions