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

Fix electra light client types #6361

Open
wants to merge 107 commits into
base: unstable
Choose a base branch
from

Conversation

eserilev
Copy link
Collaborator

@eserilev eserilev commented Sep 5, 2024

Issue Addressed

Resolves #6002

Resolves #4022

Proposed Changes

Update light client types to be compatible with electra

Related spec PR:

ethereum/consensus-specs#3811

Blocked by #5915

@eserilev eserilev marked this pull request as ready for review September 7, 2024 01:36
@eserilev eserilev added ready-for-review The code is ready for review and removed work-in-progress PR is a work-in-progress labels Sep 7, 2024
@eserilev eserilev removed the blocked label Sep 10, 2024
beacon_node/beacon_chain/src/light_client_server_cache.rs Outdated Show resolved Hide resolved
beacon_node/store/src/hot_cold_store.rs Outdated Show resolved Hide resolved
consensus/types/src/light_client_update.rs Outdated Show resolved Hide resolved
consensus/types/src/light_client_update.rs Outdated Show resolved Hide resolved
consensus/types/src/beacon_state.rs Outdated Show resolved Hide resolved
consensus/types/src/beacon_state.rs Outdated Show resolved Hide resolved
consensus/types/src/beacon_state.rs Outdated Show resolved Hide resolved
consensus/types/src/beacon_state.rs Outdated Show resolved Hide resolved
generalized_index: usize,
) -> Result<Vec<Hash256>, Error> {
// 1. Convert generalized index to field index.
let field_index = match generalized_index {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just match on the self.fork_unchecked() and pick the right gindex. No need to pass the generalized_index as argument. I guess now that the function is repeated we don't need to list the 1,2,3,4 steps on each function. Same for compute_sync_committee_proof if you split the function into compute_next_sync_committee_proof and compute_current_sync_committee_proof they are short functions that are no longer fallible. It simplifies the logic on the caller side too

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
electra Required for the Electra/Prague fork light-client ready-for-review The code is ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants