Skip to content

Allow for constructing light client data across fork boundaries #7502

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

Open
wants to merge 1 commit into
base: unstable
Choose a base branch
from

Conversation

eserilev
Copy link
Member

Issue Addressed

#7002

Proposed Changes

LightClientUpdate data can contain an attested header and finalized header that originate from different forks. This usually happens during hardforks while an epoch in the new fork hasn't been finalized yet. This PR allows for us to construct LightClientUpdates in this scenario.

@eserilev eserilev requested a review from jxs as a code owner May 20, 2025 23:53
@eserilev eserilev added bug Something isn't working work-in-progress PR is a work-in-progress light-client labels May 20, 2025
Comment on lines +498 to +514
builder.register_anonymous_variable_length_item()?;
builder.register_type::<SyncCommittee<E>>()?;
if fork_name.electra_enabled() {
builder.register_type::<NextSyncCommitteeBranchElectra>()?;
} else {
builder.register_type::<NextSyncCommitteeBranch>()?;
}
// FINALIZED HEADER
builder.register_anonymous_variable_length_item()?;
if fork_name.electra_enabled() {
builder.register_type::<FinalityBranchElectra>()?;
} else {
builder.register_type::<FinalityBranch>()?;
}
builder.register_type::<SyncAggregate<E>>()?;
builder.register_type::<Slot>()?;
let mut decoder = builder.build()?;
Copy link
Member Author

Choose a reason for hiding this comment

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

There is an OffsetOutOfBounds failure on line 506 when I try to register the finalized header as an anonymous variable length item. I'm not sure why

Copy link
Member Author

Choose a reason for hiding this comment

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

cargo test --release -p ef_tests --features "ef_tests" -- light_client_update

Copy link

mergify bot commented May 21, 2025

Some required checks have failed. Could you please take a look @eserilev? 🙏

@mergify mergify bot added the waiting-on-author The reviewer has suggested changes and awaits thier implementation. label May 21, 2025
@eserilev eserilev removed the waiting-on-author The reviewer has suggested changes and awaits thier implementation. label May 23, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working light-client work-in-progress PR is a work-in-progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant