Skip to content

Commit

Permalink
fix(core): correctly filter pruned sync peers for block sync (#3902)
Browse files Browse the repository at this point in the history
Description
---
Corrects filter predicate for full block sync peers

Motivation and Context
---
Rpc error: `Service returned an error: BadRequest: Requested full block body at height 6804, however this node has an effective pruned height of 15941` caused by peer incorrectly selecting pruned nodes. 

How Has This Been Tested?
---
Manually
  • Loading branch information
sdbondi authored Mar 9, 2022
1 parent f2b353e commit bfdfce6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion base_layer/common_types/src/chain_metadata.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub struct ChainMetadata {
/// (exclusive). If `pruned_height` is equal to the `height_of_longest_chain` no blocks can be
/// provided. Archival nodes wil always have an `pruned_height` of zero.
pruned_height: u64,
/// The total accumuated proof of work of the longest chain
/// The total accumulated proof of work of the longest chain
accumulated_difficulty: u128,
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ impl DecideNextSync {
.sync_peers
.drain(..)
.filter(|sync_peer| {
sync_peer.claimed_chain_metadata().pruning_horizon() <= local_metadata.height_of_longest_chain()
sync_peer.claimed_chain_metadata().pruned_height() <= local_metadata.height_of_longest_chain()
})
.collect::<Vec<_>>();

Expand Down

0 comments on commit bfdfce6

Please sign in to comment.