You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, we have several occurrences of expect in QBFT. It would be nicer if we can avoid them altogether through some refactoring. Furthermore, there is some repeated deserialisation in some code paths, which would also be nice to avoid. Ways to achieve this might be:
This struct could be introduced and passed around, avoiding multiple deserialisations. It is lightweight, as the full data lives on the stack. We could also put this in our main Qbft struct everywhere where we currently have D::Hash, as we avoid data lookups from the map (and associated expects that way).
Some data is always present if we are in certain states, e.g. proposal_root is always set if we are in state Prepare or further. We could therefore add this as a field to the Prepare and further variants, avoiding the Option and related expects.
Other smaller local refactoring, like pattern matching on slices to assert that something has exactly one element and then getting it.
The text was updated successfully, but these errors were encountered:
Currently, we have several occurrences of
expect
in QBFT. It would be nicer if we can avoid them altogether through some refactoring. Furthermore, there is some repeated deserialisation in some code paths, which would also be nice to avoid. Ways to achieve this might be:Qbft
struct everywhere where we currently haveD::Hash
, as we avoid data lookups from the map (and associatedexpect
s that way).proposal_root
is always set if we are in statePrepare
or further. We could therefore add this as a field to thePrepare
and further variants, avoiding theOption
and relatedexpect
s.The text was updated successfully, but these errors were encountered: