Skip to content
This repository has been archived by the owner on Jul 1, 2021. It is now read-only.

Implement "per-epoch processing - validator registry" section #223

Closed
hwwhww opened this issue Jan 23, 2019 · 2 comments
Closed

Implement "per-epoch processing - validator registry" section #223

hwwhww opened this issue Jan 23, 2019 · 2 comments

Comments

@hwwhww
Copy link
Contributor

hwwhww commented Jan 23, 2019

What is wrong?

Spec: per-epoch processing - validator registry https://github.com/ethereum/eth2.0-specs/blob/master/specs/core/0_beacon-chain.md#validator-registry

We don't have this section yet.

It could be 4 parts:

  1. Common logic: "update previous_epoch_calculation_slot and previous_epoch_start_shard.... " part
  2. Conditions: "If the following are satisfied... " part
  3. "If a validator registry update does not happen"
  4. "If a validator registry update does happen"

For MVP, at least we need the part 1-3.

How can it be fixed

  • In eth2/beacon/state_machines/forks/serenity/epoch_processing.py, add process_validator_registry(state: BeaconState, block: BaseBeaconBlock, config: BeaconConfig) -> BeaconState.
  • Call process_validator_registry in eth2.beacon.state_machines.forks.serenity.state_transitions. SerenityStateTransition.per_epoch_transition:
    def per_epoch_transition(self, state: BeaconState, block: BaseBeaconBlock) -> BeaconState:
        # TODO: state = process_receipt_roots(state, block, self.config)
        # TODO: state = process_justification(state, block, self.config)
        # TODO: state = process_rosslinks(state, block, self.config)
        # TODO: state = process_rewards_and_penalties(state, block, self.config)
        # TODO: state = process_ejections(state, block, self.config)
        state = process_validator_registry(state, block, self.config)
        # TODO: state = process_final_updates(state, block, self.config)

        return state

Note: recent incoming update: ethereum/consensus-specs#476 will affect it.

@hwwhww
Copy link
Contributor Author

hwwhww commented Jan 24, 2019

including part 1~3 into #225

@hwwhww hwwhww removed their assignment Jan 29, 2019
@hwwhww hwwhww self-assigned this Feb 17, 2019
@hwwhww
Copy link
Contributor Author

hwwhww commented Feb 17, 2019

working on update_validator_registry

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant