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

Typed-initialized beacon state caches #18

Closed

Conversation

dapplion
Copy link
Owner

Current beacon_state caches have three states:

  • Uninitialized: set to default when state is decoded
  • Initialized: after doing some calculation with state's data + spec
  • Stale: when calculated data is not longer in sync with a mutated state

This PR explorers removing the first state Uninitialized by having two types:

  • BeaconStateInner / BeaconState: the thing you deserialize to
  • BeaconState / CachedBeaconState: wrapper struct that includes the caches

CachedBeaconState does not implement default and must calculate all structs on allocation.

@dapplion dapplion deleted the branch tree-state-epoch-single-pass-merge January 24, 2025 18:03
@dapplion dapplion closed this Jan 24, 2025
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.

1 participant