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

Clarify calculation of epoch_boundary_block_root #188

Open
ericsson49 opened this issue Sep 12, 2019 · 0 comments
Open

Clarify calculation of epoch_boundary_block_root #188

ericsson49 opened this issue Sep 12, 2019 · 0 comments
Labels
question Further information is requested spec Changes related to spec

Comments

@ericsson49
Copy link
Contributor

There seems to be an edge case in
https://github.com/ethereum/eth2.0-specs/blob/dev/specs/validator/0_beacon-chain-validator.md, regarding calculation of epoch_boundary_block_root.

The spec says:

'epoch_boundary_block_root' is the root of block at the most recent epoch boundary

And later proposes how to look up for it:

Let start_slot = compute_start_slot_of_epoch(get_current_epoch(head_state)).
Let epoch_boundary_block_root = signing_root(head_block) if start_slot == head_state.slot else get_block_root(state, start_slot)

Obviously, if the head_state.slot is the start of an epoch, then there is no appropriate block_root in the state. If the head_block.slot == head_state.slot, then everything is fine.

But what if the head_block is stale? If it's younger than the previous epoch, then it seems reasonable too.
But what if it's older then the previous epoch? Then get_block_root(state, compute_start_slot_of_epoch(get_previous_epoch(head_state))) looks like a better match to "the root of block at the most recent epoch boundary".
Actually, it's also not quite clear whether it's a possible situation. E.g. LMD GHOST rule may rule it out.

@ericsson49 ericsson49 added question Further information is requested spec Changes related to spec labels Sep 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested spec Changes related to spec
Projects
None yet
Development

No branches or pull requests

1 participant