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

Put validator pubkey cache back in beacon_chain #4413

Closed
michaelsproul opened this issue Jun 19, 2023 · 1 comment
Closed

Put validator pubkey cache back in beacon_chain #4413

michaelsproul opened this issue Jun 19, 2023 · 1 comment
Labels
backwards-incompat Backwards-incompatible API change code-quality database tree-states Upcoming state and database overhaul

Comments

@michaelsproul
Copy link
Member

Description

At one point in the history of tree-states I relocated the validator pubkey cache into the store crate. With the latest database schema that's no longer necessary, so I think it would make sense to minimise the size of the (source code) diff and move it back. We just need to take care to preserve the changes which implement #3505.

@michaelsproul michaelsproul added tree-states Upcoming state and database overhaul code-quality backwards-incompat Backwards-incompatible API change labels Jun 19, 2023
@michaelsproul
Copy link
Member Author

I'd forgotten that the pubkey cache is used in the database for the storage of full states (store_full_state/get_full_state). For simplicity and to future-proof against validator index re-use in future versions of the protocol I think we should give up on trying to de-duplicate the validator pubkeys from the states. We only ever store a handful of full states at a time, ~N in the freezer database for the last N years of chain history, and 1 in the hot database for the finalized state.

Therefore I think we can remove ValidatorTrait and CompactBeaconState, and move the validator pubkey cache back to beacon_chain. This will be a breaking schema change for tree-states because the state format on disk will change.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backwards-incompat Backwards-incompatible API change code-quality database tree-states Upcoming state and database overhaul
Projects
None yet
Development

No branches or pull requests

1 participant