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

Set genesis_state.latest_block_header with the root of empty BeaconBlockBody #1098

Merged
merged 1 commit into from
May 20, 2019

Conversation

hwwhww
Copy link
Contributor

@hwwhww hwwhww commented May 19, 2019

Fix #1089.

I think it is a bug because before this fix, the test helper build_empty_block_for_next_slot did not build the correct slot=GENESIS_SLOT+1 block which the parent block is point to genesis_block.

https://github.com/ethereum/eth2.0-specs/blob/23b1cb225d4aab476bbeba06ab1d17755ccfd104/test_libs/pyspec/tests/helpers.py#L131-L132

/cc @sorpaas

@JustinDrake
Copy link
Contributor

We probably also want to change genesis_block.

@hwwhww
Copy link
Contributor Author

hwwhww commented May 20, 2019

@JustinDrake

We probably also want to change genesis_block.

Doesn't SSZ default value work well for genesis_block now?

genesis_block = BeaconBlock(state_root=hash_tree_root(genesis_state))

implies to

genesis_block = BeaconBlock(
    slot=0,
    parent_root=ZERO_HASH,
    state_root=hash_tree_root(genesis_state),
    body=BeaconBlockBody(),
    signature=b'\x00' * 96,
)

@hwwhww
Copy link
Contributor Author

hwwhww commented May 20, 2019

I'm merging this fix since it's blocking adding tests for #1068.

@hwwhww hwwhww merged commit 83123a3 into dev May 20, 2019
@hwwhww hwwhww deleted the fix_genesis_header branch April 28, 2020 12:03
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.

Set genesis block body root to ssz hash of the empty struct rather than empty hash
2 participants