Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions consensus/types/src/beacon_block_header.rs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ impl BeaconBlockHeader {
state_root: Default::default(),
}
}

pub fn update_state_root(&mut self, state_root: Hash256) {
self.state_root = state_root;
}
}

#[cfg(test)]
Expand Down
8 changes: 6 additions & 2 deletions consensus/types/src/light_client_bootstrap.rs
Original file line number Diff line number Diff line change
Expand Up @@ -188,8 +188,12 @@ impl<E: EthSpec> LightClientBootstrap<E> {
block: &SignedBlindedBeaconBlock<E>,
chain_spec: &ChainSpec,
) -> Result<Self, Error> {
let mut header = beacon_state.latest_block_header().clone();
header.state_root = beacon_state.update_tree_hash_cache()?;
let header = beacon_state.update_tree_hash_cache()?;
beacon_state
.latest_block_header()
.clone()
.update_state_root(header);

let current_sync_committee_branch = beacon_state.compute_current_sync_committee_proof()?;
let current_sync_committee = beacon_state.current_sync_committee()?.clone();

Expand Down
Loading