-
Notifications
You must be signed in to change notification settings - Fork 998
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 underflows from #1017 #1027
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch on randao_mix
at GENESIS_EPOCH
! 👍
Some epoch
/get_current_epoch(state)
confusions in my comments.
A few initial comments:
|
@JustinDrake I'm okay taking the asserts out as they are untriggerable in the context of the state transition function. I added notes in the comment on the expected range for implementers whom I know utilize in other contexts |
prevent underflows in
generate_seed
,get_randao_mix
, andget_active_index_root
.Note that for epochs less than
MIN_SEED_LOOKAHEAD
we useZERO_HASH
rather than just pulling fromget_randao_mix(state, GENESIS_EPOCH)
because the randao_mix atGENESIS_EPOCH
is not static and would thus break lookahead.