Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix random validation #2609

Merged
merged 1 commit into from
Sep 18, 2021
Merged

Fix random validation #2609

merged 1 commit into from
Sep 18, 2021

Conversation

djrtwo
Copy link
Contributor

@djrtwo djrtwo commented Sep 17, 2021

execution_payload.random was incorrectly only being evaluated once the transition had happened and there was a non-empty latest_execution_payload in the state.

This field can and should be evaluated even at the transition block because it is not a function of the latest_execution_payload but instead is a function of just the beacon state. Without this fix, arbitrary data could be inserted for random at the transition block.

Ensured that test_bad_random_first_payload before change to beacon transition function. And passes with the change

@djrtwo djrtwo requested a review from mkalinin September 17, 2021 17:06
Copy link
Collaborator

@mkalinin mkalinin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very well spotted! The fix looks good to me 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants