Next sync committee branch bug (#7443)

#7441


  Make sure we're correctly caching light client data
This commit is contained in:
Eitan Seri-Levi
2025-05-12 18:13:15 -07:00
committed by GitHub
parent 0a917989b2
commit 807848bc7a

View File

@@ -421,18 +421,13 @@ struct LightClientCachedData<E: EthSpec> {
impl<E: EthSpec> LightClientCachedData<E> {
fn from_state(state: &mut BeaconState<E>) -> Result<Self, BeaconChainError> {
let (finality_branch, next_sync_committee_branch, current_sync_committee_branch) = (
state.compute_finalized_root_proof()?,
state.compute_current_sync_committee_proof()?,
state.compute_next_sync_committee_proof()?,
);
Ok(Self {
finalized_checkpoint: state.finalized_checkpoint(),
finality_branch,
finality_branch: state.compute_finalized_root_proof()?,
next_sync_committee: state.next_sync_committee()?.clone(),
current_sync_committee: state.current_sync_committee()?.clone(),
next_sync_committee_branch,
current_sync_committee_branch,
next_sync_committee_branch: state.compute_next_sync_committee_proof()?,
current_sync_committee_branch: state.compute_current_sync_committee_proof()?,
finalized_block_root: state.finalized_checkpoint().root,
})
}