Skip to content

Commit

Permalink
fix incorrect method name and update test to ensure off-by-one is inv…
Browse files Browse the repository at this point in the history
…alid
  • Loading branch information
realbigsean authored and pawanjay176 committed Jul 22, 2021
1 parent 6c76853 commit bed92c9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ impl<T: BeaconChainTypes> Worker<T> {
"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 { .. })
Expand Down Expand Up @@ -504,7 +504,7 @@ impl<T: BeaconChainTypes> Worker<T> {
"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!(
Expand Down
2 changes: 1 addition & 1 deletion beacon_node/network/src/beacon_processor/worker/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ impl<T: BeaconChainTypes> Worker<T> {
/// Send a message to `sync_tx`.
///
/// Creates a log if there is an internal error.
fn send_sync_committee_message(&self, message: SyncMessage<T::EthSpec>) {
fn send_sync_message(&self, message: SyncMessage<T::EthSpec>) {
self.sync_tx.send(message).unwrap_or_else(|e| {
debug!(self.log, "Could not send message to the sync service, likely shutdown";
"error" => %e)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ impl<T: BeaconChainTypes> Worker<T> {
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),
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ impl<T: BeaconChainTypes> Worker<T> {
}
};

self.send_sync_committee_message(SyncMessage::BatchProcessed {
self.send_sync_message(SyncMessage::BatchProcessed {
chain_id,
epoch,
result,
Expand All @@ -117,7 +117,7 @@ impl<T: BeaconChainTypes> Worker<T> {
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,
})
Expand Down

0 comments on commit bed92c9

Please sign in to comment.