Skip to content
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

Clarify that only missing transmissions are checked #3443

Open
wants to merge 1 commit into
base: staging
Choose a base branch
from
Open
Changes from all commits
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
6 changes: 3 additions & 3 deletions node/bft/src/primary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -728,10 +728,10 @@ impl<N: Network> Primary<N> {
}

// If the peer is ahead, use the batch header to sync up to the peer.
let mut transmissions = self.sync_with_batch_header_from_peer::<false>(peer_ip, &batch_header).await?;
let mut missing_transmissions = self.sync_with_batch_header_from_peer::<false>(peer_ip, &batch_header).await?;

// Check that the transmission ids match and are not fee transactions.
if let Err(err) = cfg_iter_mut!(transmissions).try_for_each(|(transmission_id, transmission)| {
if let Err(err) = cfg_iter_mut!(missing_transmissions).try_for_each(|(transmission_id, transmission)| {
// If the transmission is not well-formed, then return early.
self.ledger.ensure_transmission_is_well_formed(*transmission_id, transmission)
}) {
Expand All @@ -751,7 +751,7 @@ impl<N: Network> Primary<N> {
// Ensure the batch header from the peer is valid.
let (storage, header) = (self.storage.clone(), batch_header.clone());
let missing_transmissions =
spawn_blocking!(storage.check_batch_header(&header, transmissions, Default::default()))?;
spawn_blocking!(storage.check_batch_header(&header, missing_transmissions, Default::default()))?;
// Inserts the missing transmissions into the workers.
self.insert_missing_transmissions_into_workers(peer_ip, missing_transmissions.into_iter())?;

Expand Down