add a cached local state struct and use that in STF
- Dominant language
- Zig
- Stars
- 97
- Forks
- 39
- PR merge metrics
- No merged PRs in 30d
Description
followup to #182
current STF unflattens and reflattens justifications map at least 2 times, so better would be to have a "CachedState" which can be created from our normal ssz complaint state, with justifications as map without needing to unlfatten -reflatten and with a property to finally return the flattened ssz state so that the stateroot can be computed
this can especially be useful in block production where there are multiple rounds to add votes and state root compute is only relavant in the end of the rounds.
and can also save time whie appling a new block to a parent cached state as unflattening wouldn't be needed
Contributor guide
No contributing guide indexed for this repository
Research direction
Start with follow-up issue #182 and the STF implementation, tracing where the justifications map is unflattened and reflattens during block production and block application. Done means a CachedState can be created from the normal SSZ state, retain justifications in map form, and provide the flattened state needed for state-root computation.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- zig
- Domain
- blockchain
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100