ethereum / beacon_chain

MIT License
211 stars 65 forks source link

Add state roots validation #73

Closed hwwhww closed 5 years ago

hwwhww commented 6 years ago

Issue

The state roots validation is not part of the current spec or codebase.

How to fix it

After the spec is revised, we add the state roots validation between here L349:

It should be done outside state transtion function. There are some different processes; when the validator applies lookahead via get_new_shuffling, check if ze is the proposer or validator of a certain slot:

On receiving a new block

We can wrap the is_proposer... process and modify mock_validator_record now to get some more genenal API that can be used for both the real client and the tests.

hwwhww commented 6 years ago

@djrtwo I updated the issue description. Could you take a look to confirm the abstract processes are correct? Thanks. :)

djrtwo commented 6 years ago

for attester:

for proposer:

Note! The computing and setting of state roots can be found here in testing setup for reference. https://github.com/ethereum/beacon_chain/blob/master/tests/state/conftest.py#L365-L378