Just collecting some thoughts as I work on DB stuff for Gloas.
Storage of states for Full blocks
Option 1: always use ReplayFrom(same_slot)
When storing state summaries for Full states (post-payload states), always use a storage strategy of ReplayFrom(slot) with slot == summary.slot (i.e. replay from the Pending state at the same slot -- just apply the payload).
Option 2: use ReplayFrom(prior_slot)
Similar to option 1, but use the same slot in ReplayFrom that we would use for a regular (Pending) state. In the case where the regular pending state would be stored as a snapshot or diff, fallback to ReplayFrom(same_slot) to replay just the payload on the state.
I think option (1) is probably simpler from a conceptual & implementation PoV. The only downside is that it involves potentially 2 replay_blocks calls rather than just 1 (although the same number of blocks+payloads are processed in total).
Just collecting some thoughts as I work on DB stuff for Gloas.
Storage of states for
FullblocksOption 1: always use
ReplayFrom(same_slot)When storing state summaries for
Fullstates (post-payload states), always use a storage strategy ofReplayFrom(slot)withslot == summary.slot(i.e. replay from thePendingstate at the same slot -- just apply the payload).Option 2: use
ReplayFrom(prior_slot)Similar to option 1, but use the same
slotinReplayFromthat we would use for a regular (Pending) state. In the case where the regular pending state would be stored as a snapshot or diff, fallback toReplayFrom(same_slot)to replay just the payload on the state.I think option (1) is probably simpler from a conceptual & implementation PoV. The only downside is that it involves potentially 2
replay_blockscalls rather than just 1 (although the same number of blocks+payloads are processed in total).