Skip to content

Commit

Permalink
fix: Phase 2 does not need VIEW_DRIFT, the stored value is accurate.
Browse files Browse the repository at this point in the history
  • Loading branch information
shawn-zil committed Jan 10, 2025
1 parent 77c8320 commit e5482f3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions zilliqa/src/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -443,7 +443,6 @@ impl Sync {

// If we have no chain_segments, we have nothing to do
if let Some((peer_info, meta)) = self.chain_segments.last() {
let to_view = meta.view_number.saturating_add(Self::VIEW_DRIFT);
let mut from_view = meta.view_number;
let mut request_hashes = Vec::with_capacity(self.max_batch_size);
let mut key = meta.parent_hash; // start from this block
Expand Down Expand Up @@ -488,7 +487,11 @@ impl Sync {
last_used: std::time::Instant::now(),
score: u32::MAX, // used to indicate faux peer, will not be added to the group of peers
});
ExternalMessage::BlockRequest(BlockRequest { to_view, from_view })
// do not add VIEW_DRIFT - the stored marker is accurate!
ExternalMessage::BlockRequest(BlockRequest {
to_view: meta.view_number,
from_view,
})
}
};
self.message_sender
Expand Down

0 comments on commit e5482f3

Please sign in to comment.