Default to "zero" Eth1Data instead of current state #2501
Closed
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 #2227 by changing the default vote to be zeroed out - zero block hash, deposit root and zero deposits. The state transition is updated to explicitly disallow the zero vote from becoming the current
Eth1Data
in the spec.The zero vote is automatically ignored by
get_eth1_vote
because it won't be in the set of known blocks so doesn't lead validators to following a vote which doesn't progress the chain like defaulting to the currentstate.eth1_data
does.The alternative approach would be for validators to vote for a random block hash which has the advantage of not needing to update the state transition rules as it's exceedingly unlikely 50% of validators will choose the same random data, but the downside of making it harder to identify default votes. Differentiating default votes from votes for unknown blocks is particularly useful when evaluating whether a beacon node is tracking the eth1 chain correctly.
Note: Python likely needs some tweaking but hopefully gets the idea across.