From bed92c9b97b2fe5d74d9ebd10fb97d7e98da038b Mon Sep 17 00:00:00 2001 From: realbigsean Date: Tue, 13 Jul 2021 12:21:56 -0400 Subject: [PATCH] fix incorrect method name and update test to ensure off-by-one is invalid --- .../network/src/beacon_processor/worker/gossip_methods.rs | 4 ++-- beacon_node/network/src/beacon_processor/worker/mod.rs | 2 +- .../network/src/beacon_processor/worker/rpc_methods.rs | 2 +- .../network/src/beacon_processor/worker/sync_methods.rs | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/beacon_node/network/src/beacon_processor/worker/gossip_methods.rs b/beacon_node/network/src/beacon_processor/worker/gossip_methods.rs index 4e8397964d0..aae0239720d 100644 --- a/beacon_node/network/src/beacon_processor/worker/gossip_methods.rs +++ b/beacon_node/network/src/beacon_processor/worker/gossip_methods.rs @@ -327,7 +327,7 @@ impl Worker { "Unknown parent for gossip block"; "root" => %block.canonical_root() ); - self.send_sync_committee_message(SyncMessage::UnknownBlock(peer_id, block)); + self.send_sync_message(SyncMessage::UnknownBlock(peer_id, block)); return; } Err(e @ BlockError::FutureSlot { .. }) @@ -504,7 +504,7 @@ impl Worker { "Block with unknown parent attempted to be processed"; "peer_id" => %peer_id ); - self.send_sync_committee_message(SyncMessage::UnknownBlock(peer_id, block)); + self.send_sync_message(SyncMessage::UnknownBlock(peer_id, block)); } other => { debug!( diff --git a/beacon_node/network/src/beacon_processor/worker/mod.rs b/beacon_node/network/src/beacon_processor/worker/mod.rs index adc1ad66903..ec2cce0ee6f 100644 --- a/beacon_node/network/src/beacon_processor/worker/mod.rs +++ b/beacon_node/network/src/beacon_processor/worker/mod.rs @@ -25,7 +25,7 @@ impl Worker { /// Send a message to `sync_tx`. /// /// Creates a log if there is an internal error. - fn send_sync_committee_message(&self, message: SyncMessage) { + fn send_sync_message(&self, message: SyncMessage) { self.sync_tx.send(message).unwrap_or_else(|e| { debug!(self.log, "Could not send message to the sync service, likely shutdown"; "error" => %e) diff --git a/beacon_node/network/src/beacon_processor/worker/rpc_methods.rs b/beacon_node/network/src/beacon_processor/worker/rpc_methods.rs index 76f94abca50..e1e51ef2c6b 100644 --- a/beacon_node/network/src/beacon_processor/worker/rpc_methods.rs +++ b/beacon_node/network/src/beacon_processor/worker/rpc_methods.rs @@ -99,7 +99,7 @@ impl Worker { finalized_epoch: status.finalized_epoch, finalized_root: status.finalized_root, }; - self.send_sync_committee_message(SyncMessage::AddPeer(peer_id, info)); + self.send_sync_message(SyncMessage::AddPeer(peer_id, info)); } Err(e) => error!(self.log, "Could not process status message"; "error" => ?e), } diff --git a/beacon_node/network/src/beacon_processor/worker/sync_methods.rs b/beacon_node/network/src/beacon_processor/worker/sync_methods.rs index 66a71dbdbf5..db2b8db75ed 100644 --- a/beacon_node/network/src/beacon_processor/worker/sync_methods.rs +++ b/beacon_node/network/src/beacon_processor/worker/sync_methods.rs @@ -99,7 +99,7 @@ impl Worker { } }; - self.send_sync_committee_message(SyncMessage::BatchProcessed { + self.send_sync_message(SyncMessage::BatchProcessed { chain_id, epoch, result, @@ -117,7 +117,7 @@ impl Worker { match self.process_blocks(downloaded_blocks.iter().rev()) { (_, Err(e)) => { debug!(self.log, "Parent lookup failed"; "last_peer_id" => %peer_id, "error" => e); - self.send_sync_committee_message(SyncMessage::ParentLookupFailed { + self.send_sync_message(SyncMessage::ParentLookupFailed { peer_id, chain_head, })