Skip to content

Commit

Permalink
refactor: explicitly list all message types in tcp::Tier::is_allowed (#…
Browse files Browse the repository at this point in the history
…12637)

See [this
comment](#12634 (review)).
  • Loading branch information
pugachAG authored Dec 17, 2024
1 parent f867ea7 commit ff7166c
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion chain/network/src/peer_manager/connection/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,24 @@ impl tcp::Tier {
self == tcp::Tier::T2 || self == tcp::Tier::T3
}
PeerMessage::Routed(msg) => self.is_allowed_routed(&msg.body),
_ => self == tcp::Tier::T2,
PeerMessage::SyncRoutingTable(..)
| PeerMessage::DistanceVector(..)
| PeerMessage::RequestUpdateNonce(..)
| PeerMessage::SyncAccountsData(..)
| PeerMessage::PeersRequest(..)
| PeerMessage::PeersResponse(..)
| PeerMessage::BlockHeadersRequest(..)
| PeerMessage::BlockHeaders(..)
| PeerMessage::BlockRequest(..)
| PeerMessage::Block(..)
| PeerMessage::Transaction(..)
| PeerMessage::Disconnect(..)
| PeerMessage::Challenge(..)
| PeerMessage::SyncSnapshotHosts(..)
| PeerMessage::StateRequestHeader(..)
| PeerMessage::StateRequestPart(..)
| PeerMessage::EpochSyncRequest
| PeerMessage::EpochSyncResponse(..) => self == tcp::Tier::T2,
}
}

Expand Down

0 comments on commit ff7166c

Please sign in to comment.