Add gossip ban and rate limit policy#1263
Add gossip ban and rate limit policy#1263jjyr wants to merge 50 commits intonervosnetwork:developfrom
Conversation
| ))), | ||
| _ => Err(Error::InvalidParameter(format!( | ||
| "Channel announcement transaction {:?} not found or not confirmed, the reason is unknown", | ||
| Ok(response) => Err(Error::InvalidParameter(format!( |
There was a problem hiding this comment.
CkbRpcClient::get_transaction returns a successful response with tx_status Unknown, Pending, or Proposed when the funding tx is not committed yet. This branch still maps those statuses to InvalidParameter, so an honest peer can be scored or banned whenever our local chain view lags behind theirs. The defer path only handles transport errors; non-committed statuses should be deferred too.
|
|
||
| ExtendedGossipMessageStoreMessage::SaveMessages(peer, messages) => { | ||
| let now_ms = now_timestamp_as_millis_u64(); | ||
| for message in messages { |
There was a problem hiding this comment.
for BroadcastMessage like ChannelUpdate, seems save latest message is more meanningful than old ones.
here when we reached a limit, we drop those new ones?
maybe it's not a big issue, since we add limit here for extreme scenarios....
There was a problem hiding this comment.
Right, it is for preventing the milicious attack, the regular gossip message shouldn't reach the limitation.
This PR require #1217
Summary
This PR adds a gossip policy that temporarily bans misbehaving non-channel peers and rate-
limits gossip traffic to reduce spam, protect sync, and limit abuse.
Changes
GossipPolicyConfigunderFiberConfigasgossip_policyView diff