-
Notifications
You must be signed in to change notification settings - Fork 920
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
get_changed_validators
processes validators out-of-order
#222
Comments
I think you're right. /cc @JustinDrake @djrtwo |
This is true but not a very game-able imo. A simple solution would be to sort the validator list in I'm in favor of this change. What say you @hwwhww, @JustinDrake, @vbuterin |
Right, sort
|
What happens if there's a cloned validator ? For example, I somehow manage to clone a validators laptop nefariously or steal it, and original owner has backup and comes online (I have BLS pubkey & withdrawal_credentials, etc.) and attempt to validate the beacon chain as an imposter for my own nefarious purposes ? Possible ? Anything else needed within a ValidatorRecord or elsewhere to mitigate this hypothetical scenario ? isDuplicateValidator() ? I guess one path taken would be the |
There can only be one instance of a ValidatorRecord in state per pubkey. The If you steal a validator key, you are (from the perspective of the protocol) the validator. You can sign messages however you see fit. You are likely to sign a set of slashable messages or just submit an exit call. Other than that, you can't do much harm. The slashing (if not correlated with a high number of other slashings) will be relatively small. The withdrawal address is distinct from the signing key so as long as you kept your signing key offline/safe/secure, you will still control the ejected funds. |
@JustinDrake Because the index is not a field on Something like indices_and_validators = sorted(
[(i, validator) for i, validator in enumerate(state.validator_registry)],
key=lambda index_and_validator: index_and_validator[1].latest_status_change_slot
)
# Activate validators within the allowable balance churn
balance_churn = 0
for index, validator in indices_and_validators:
... Not the prettiest, but works. |
Here is one more idea that might be interesting: What if instead of using * In practice, |
See #374 |
Hmm, I can see that in #374, the if pubkey not in validator_pubkeys:
# Add new validator
validator = ValidatorRecord(...)
# Note: In phase 2 registry indices that has been withdrawn for a long time will be recycled.
index = len(state.validator_registry)
state.validator_registry.append(validator)
state.validator_balances.append(amount) In other words, it always appends to the end of the validator list. What is the long term plan regarding this? Is the final solution postponed to phase 2? If there is interest, I can try to flesh out a bit more how the free-list solution might work. All the validator lifecycle operations will be able to run in O(0). |
I'm tempted to punt this until phase 2. Feel free to reopen @zah if you end up working on a solution :) |
validator_records
inBeaconState
is updated by replacing the validatormin_empty_validator_index
, butget_changed_validators
iterates in list order - thus, sometimes a validator that was added at a later time to the list will be activated early.bfe0e9f
The text was updated successfully, but these errors were encountered: