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

Why are validator balances no longer part of ValidatorRecord? #386

Closed
akhila-raju opened this issue Jan 2, 2019 · 2 comments
Closed

Why are validator balances no longer part of ValidatorRecord? #386

akhila-raju opened this issue Jan 2, 2019 · 2 comments

Comments

@akhila-raju
Copy link
Contributor

Validator_balances was separated into its own UInt64 array, rather than being part of ValidatorRecord. What was the thought process behind this decision?

'validator_registry': [ValidatorRecord],
'validator_balances': ['uint64']
@JustinDrake
Copy link
Collaborator

It's an optimisation to minimise the amount of hashing when computing the beacon state root. The validator_registry (which contains most of the state) changes slowly and requires little hashing effort to maintain. The validator_balances is a smaller part of the state with much higher churn, hence why it is segregated.

@akhila-raju
Copy link
Contributor Author

Thank you!

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

No branches or pull requests

2 participants