add state root processing

This commit is contained in:
Danny Ryan 2018-12-05 13:03:24 -06:00
parent 3a677eefa9
commit 59494d1774
No known key found for this signature in database
GPG Key ID: 2765A792E42CE07A
1 changed files with 9 additions and 0 deletions

View File

@ -90,6 +90,7 @@
- [Validator registry](#validator-registry) - [Validator registry](#validator-registry)
- [Proposer reshuffling](#proposer-reshuffling) - [Proposer reshuffling](#proposer-reshuffling)
- [Final updates](#final-updates) - [Final updates](#final-updates)
- [State root processing](#state-root-processing)
- [Appendix](#appendix) - [Appendix](#appendix)
- [Appendix A - Hash function](#appendix-a---hash-function) - [Appendix A - Hash function](#appendix-a---hash-function)
- [References](#references) - [References](#references)
@ -1603,6 +1604,14 @@ while len(state.persistent_committee_reassignments) > 0 and state.persistent_com
* Run `exit_validator(i, state, penalize=False, current_slot=state.slot)` for indices `i` such that `state.validator_registry[i].status = ACTIVE and state.validator_registry[i].balance < MIN_BALANCE`. * Run `exit_validator(i, state, penalize=False, current_slot=state.slot)` for indices `i` such that `state.validator_registry[i].status = ACTIVE and state.validator_registry[i].balance < MIN_BALANCE`.
* Set `state.latest_block_hashes = state.latest_block_hashes[EPOCH_LENGTH:]`. * Set `state.latest_block_hashes = state.latest_block_hashes[EPOCH_LENGTH:]`.
## State root processing
If `block` is not a skip block:
* Verify `block.state_root == hash(state)`
If `block` is a skip block:
* Set `block.state_root = hash(state)`
# Appendix # Appendix
## Appendix A - Hash function ## Appendix A - Hash function