Open
Description
Fork choice Store.blocks
and Store.states
- The
Store
storage is an abstract data structure that clients can design their own implementations.- The
Store.blocks
filed is type ofDict[Root, BeaconBlock]
.
- The
- In our spec presentation,
BeaconBlock
means theBeaconBlock
of each spec.- However, right after the fork boundary,
store
contains bothphase0.BeaconBlock
andaltair.BeaconBlock
.
- However, right after the fork boundary,
- In the view of implementation, there should be only one head
store
object.- p.s. pyspec tests could choose to execute
phase0.on_block
oraltair.on_block
by the given block slot. Both with Altair store.
- p.s. pyspec tests could choose to execute
Proposed solution
- Define "Union"
SignedBeaconBlock
andBeaconBlock
. Since it's fork choice storage and not consensus container, it's not necessary to be the SSZUnion
type. PythonUnion
might be fine enough. - Add
upgrade_to_altair_store(store: phase0.Store) -> altair.Store
helper to handle the fork boundary transition.