cache justified roots in state/rename attestation fields #756
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
addresses #742
Two things:
correct value for genesis justified roots
Right now, we just have
ZERO_HASH
for the genesis justified roots. This does not actually reflect the value of the root of the block at genesis. The value of the block at the genesis slot is looks likeDue to the normal chicken-and-egg state/block-root problem, we can't embed the genesis block root in as the initial justified roots when constructing the genesis state. If we want to enforce this, we can do the following in
cache_state
. This is nice because the value reflects an actual block root but it's not really necessary imo.finalized root
Should we add another field
finalized_root
for symmetry? It is not needed in the state transition but might be nice to be available in state regardless of the number of slots since finality. (if greater thanHISTORICAL_ROOTS_LENGTH
you would no longer have it available in state)