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

validator status cleanup #280

Merged
merged 10 commits into from
Dec 11, 2018
Merged

validator status cleanup #280

merged 10 commits into from
Dec 11, 2018

Conversation

djrtwo
Copy link
Contributor

@djrtwo djrtwo commented Dec 10, 2018

addresses #274 and #268

  • Setup initial validators via process_deposit and normal activation to better reuse code and ensure that the validator_registry_delta_chain is built
  • handle all validator status updates via update_validator_status
  • exit_validator is no longer used for changing ACTIVE -> ACTIVE_PENDING_EXIT
  • exit_validator only removes validator from persistent_committees and updates validator_registry_delta_chain if not previously already exited
    • note: This protects against doing repeated actions when slashing a validator that has already exited to status `EXIT_WITHOUT_PENALTY

Not addressed but worth noting here:

  • There was language around the definition of process_deposit that said deposits from 1.0 should be processed in order as they were submit in the 1.0 chain, but there is no mechanism in "per-slot - deposits" to ensure this validity when processing a block. This needs to be considered more and handled in another PR. the Deposit object might need a source field (to distinguish 1.0 vs 2.0 deposits) and the BeaconState might need to remember the last deposit hash processed from the 1.0 chain.

@djrtwo djrtwo changed the title [WIP] validator status cleanup validator status cleanup Dec 10, 2018
@djrtwo
Copy link
Contributor Author

djrtwo commented Dec 10, 2018

actually still have a couple of cleanups to do and will handle merge conflict @JustinDrake. I'll ping for review

@djrtwo
Copy link
Contributor Author

djrtwo commented Dec 10, 2018

okay, now this is ready for review @JustinDrake @hwwhww

specs/core/0_beacon-chain.md Outdated Show resolved Hide resolved
specs/core/0_beacon-chain.md Show resolved Hide resolved
specs/core/0_beacon-chain.md Outdated Show resolved Hide resolved
specs/core/0_beacon-chain.md Outdated Show resolved Hide resolved
@@ -998,6 +1011,10 @@ def integer_squareroot(n: int) -> int:
return x
```

#### `BLSVerify`

`BLSVerify` is a function for verifying a BLS12-381 signature, defined in the [BLS12-381 spec](https://github.com/ethereum/eth2.0-specs/blob/master/specs/bls_verify.md).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, I thought BLS Verification spec is "Boneh-Lynn-Shacham signatures verification" because it's not talking about the details of the curve, no?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well that doc is doing a BLS signature verification for a specific BLS12-381 curve

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

renamed spec ref to "BLS Verification spec"

Activate the validator with the given ``index``.
Note that this function mutates ``state``.
"""
if validator.status != PENDING_ACTIVATION:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need some proof-reading here - validator does not yet exist ;)

validator.status = ACTIVE
validator.latest_status_change_slot = state.slot
state.validator_registry_delta_chain_tip = get_new_validator_registry_delta_chain_tip(
validator_registry_delta_chain_tip=validator_registry_delta_chain_tip,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

likewise - where's the chain tip coming from?

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.

None yet

4 participants