-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Change SlotMeta is_connected bool to bitflags #29001
Conversation
8d68ff3
to
80e008f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just a few nits from me. agreed that this should be sufficient and the proposed custom deserializer to retain the bool
typification here is unnecesary
We currently use the is_connected field to be able to signal to ReplayStage that a slot has replayable updates. It was discovered that this functionality is effectively broken, and that is_connected is never true. In order to convey this information to ReplayStage more effectively, we need extra state information so this PR changes the existing bool to bitflags with two bits. From a compatibility standpoint, the is_connected bool was already occupying one byte in the serialized SlotMeta in blockstore. Thus, the change from a bool to bitflags still "fits" in that one byte allotment. In consideration of a case where a client may wish to downgrade software and use the same ledger, deserializing the bitflags into a bool could fail if the new bit is set. As such, this PR introduces the second bit field, but does not set it anywhere. Once clusters have mass adopted a software version with this PR, a subsequent change to actually set and use the new field can be introduced.
80e008f
to
9af643e
Compare
Also, I'm thinking backport to v1.13 and v1.14; agreed @t-nelson ? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, I'm thinking backport to v1.13 and v1.14; agreed @t-nelson ?
yep!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good! Much cleaner now!
Maybe consider adding one test case that covers the slot 0 case?
We currently use the is_connected field to be able to signal to ReplayStage that a slot has replayable updates. It was discovered that this functionality is effectively broken, and that is_connected is never true. In order to convey this information to ReplayStage more effectively, we need extra state information so this PR changes the existing bool to bitflags with two bits. From a compatibility standpoint, the is_connected bool was already occupying one byte in the serialized SlotMeta in blockstore. Thus, the change from a bool to bitflags still "fits" in that one byte allotment. In consideration of a case where a client may wish to downgrade software and use the same ledger, deserializing the bitflags into a bool could fail if the new bit is set. As such, this PR introduces the second bit field, but does not set it anywhere. Once clusters have mass adopted a software version with this PR, a subsequent change to actually set and use the new field can be introduced. (cherry picked from commit 01cd55a) # Conflicts: # ledger/src/blockstore.rs # ledger/src/blockstore_meta.rs
We currently use the is_connected field to be able to signal to ReplayStage that a slot has replayable updates. It was discovered that this functionality is effectively broken, and that is_connected is never true. In order to convey this information to ReplayStage more effectively, we need extra state information so this PR changes the existing bool to bitflags with two bits. From a compatibility standpoint, the is_connected bool was already occupying one byte in the serialized SlotMeta in blockstore. Thus, the change from a bool to bitflags still "fits" in that one byte allotment. In consideration of a case where a client may wish to downgrade software and use the same ledger, deserializing the bitflags into a bool could fail if the new bit is set. As such, this PR introduces the second bit field, but does not set it anywhere. Once clusters have mass adopted a software version with this PR, a subsequent change to actually set and use the new field can be introduced. (cherry picked from commit 01cd55a) # Conflicts: # ledger/src/blockstore.rs
* Change SlotMeta is_connected bool to bitflags (#29001) We currently use the is_connected field to be able to signal to ReplayStage that a slot has replayable updates. It was discovered that this functionality is effectively broken, and that is_connected is never true. In order to convey this information to ReplayStage more effectively, we need extra state information so this PR changes the existing bool to bitflags with two bits. From a compatibility standpoint, the is_connected bool was already occupying one byte in the serialized SlotMeta in blockstore. Thus, the change from a bool to bitflags still "fits" in that one byte allotment. In consideration of a case where a client may wish to downgrade software and use the same ledger, deserializing the bitflags into a bool could fail if the new bit is set. As such, this PR introduces the second bit field, but does not set it anywhere. Once clusters have mass adopted a software version with this PR, a subsequent change to actually set and use the new field can be introduced. (cherry picked from commit 01cd55a) # Conflicts: # ledger/src/blockstore.rs # ledger/src/blockstore_meta.rs * Resolve auto-merge failures Co-authored-by: steviez <steven@solana.com>
* Change SlotMeta is_connected bool to bitflags (#29001) We currently use the is_connected field to be able to signal to ReplayStage that a slot has replayable updates. It was discovered that this functionality is effectively broken, and that is_connected is never true. In order to convey this information to ReplayStage more effectively, we need extra state information so this PR changes the existing bool to bitflags with two bits. From a compatibility standpoint, the is_connected bool was already occupying one byte in the serialized SlotMeta in blockstore. Thus, the change from a bool to bitflags still "fits" in that one byte allotment. In consideration of a case where a client may wish to downgrade software and use the same ledger, deserializing the bitflags into a bool could fail if the new bit is set. As such, this PR introduces the second bit field, but does not set it anywhere. Once clusters have mass adopted a software version with this PR, a subsequent change to actually set and use the new field can be introduced. (cherry picked from commit 01cd55a) # Conflicts: # ledger/src/blockstore.rs * Resolve auto-merge failures Co-authored-by: steviez <steven@solana.com>
We currently use the is_connected field to be able to signal to ReplayStage that a slot has replayable updates. It was discovered that this functionality is effectively broken, and that is_connected is never true. In order to convey this information to ReplayStage more effectively, we need extra state information so this PR changes the existing bool to bitflags with two bits. From a compatibility standpoint, the is_connected bool was already occupying one byte in the serialized SlotMeta in blockstore. Thus, the change from a bool to bitflags still "fits" in that one byte allotment. In consideration of a case where a client may wish to downgrade software and use the same ledger, deserializing the bitflags into a bool could fail if the new bit is set. As such, this PR introduces the second bit field, but does not set it anywhere. Once clusters have mass adopted a software version with this PR, a subsequent change to actually set and use the new field can be introduced.
We currently use the is_connected field to be able to signal to ReplayStage that a slot has replayable updates. It was discovered that this functionality is effectively broken, and that is_connected is never true. In order to convey this information to ReplayStage more effectively, we need extra state information so this PR changes the existing bool to bitflags with two bits. From a compatibility standpoint, the is_connected bool was already occupying one byte in the serialized SlotMeta in blockstore. Thus, the change from a bool to bitflags still "fits" in that one byte allotment. In consideration of a case where a client may wish to downgrade software and use the same ledger, deserializing the bitflags into a bool could fail if the new bit is set. As such, this PR introduces the second bit field, but does not set it anywhere. Once clusters have mass adopted a software version with this PR, a subsequent change to actually set and use the new field can be introduced.
Problem
We currently use the
is_connected
field to be able to signal toReplayStage that a slot has replayable updates. It was discovered that
this functionality is effectively broken, and that
is_connected
is nevertrue.
Summary of Changes
In order to convey this information to ReplayStage more
effectively, we need extra state information so this PR changes the
existing bool to bitflags with two bits.
From a compatibility standpoint, the
is_connected bool
was alreadyoccupying one byte in the serialized SlotMeta in blockstore. Thus, the
change from a bool to bitflags still "fits" in that one byte allotment.
In consideration of a case where a client may wish to downgrade software
and use the same ledger, deserializing the bitflags into a bool could
fail if the new bit is set. As such, this PR introduces the second bit
field, but does not set it anywhere. Once clusters have mass adopted a
software version with this PR, a subsequent change to actually set and
use the new field can be introduced.