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 block body root to ssz hash of the empty struct rather than empty hash #1089

Closed
sorpaas opened this issue May 17, 2019 · 0 comments · Fixed by #1098
Closed

Set genesis block body root to ssz hash of the empty struct rather than empty hash #1089

sorpaas opened this issue May 17, 2019 · 0 comments · Fixed by #1098

Comments

@sorpaas
Copy link

sorpaas commented May 17, 2019

A block is not useful unless it has a way to point to its parent block, so that an importer knows how to import it. Although the spec does not define it, all block intrinsically has a block identifier. Currently our block identifier is defined by previous_block_root:

signing_root(BeaconBlockHeader {
  	slot: block.slot,
	previous_block_root: block.previous_block_root,
	state_root: self.0.state_root,
	block_body_root: if is_genesis {
		Default::default()
	} else {
		hash(&block.body)
	},
	..Default::default()
})

Notice the if statement just for genesis block. If, instead, we change genesis block_body_root to empty struct signing root, it can be avoided.

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