Skip to content

Commit

Permalink
also allow ingestion of Push with LegacyVersion to prevent amplificat…
Browse files Browse the repository at this point in the history
…ions
  • Loading branch information
Alex Pyattaev committed Feb 4, 2025
1 parent 814abfa commit da0b1e5
Showing 1 changed file with 4 additions and 12 deletions.
16 changes: 4 additions & 12 deletions gossip/src/protocol.rs
Original file line number Diff line number Diff line change
Expand Up @@ -165,18 +165,10 @@ impl Sanitize for Protocol {
val.sanitize()
}
Protocol::PushMessage(_, val) => {
//Push is allowed to carry anything in its CrdsData, except for deprecated fields
for v in val {
match v.data() {
CrdsData::LegacyVersion(_) => {
return Err(SanitizeError::InvalidValue);
}
_ => {
v.sanitize()?;
}
}
}
Ok(())
// PushMessage is allowed to carry anything in its CrdsData, including deprecated Crds
// such that a deprecated Crds gets ingested instead of the node having to pull it from
// other nodes that have inserted it into their Crds table
val.sanitize()
}
Protocol::PruneMessage(from, val) => {
if *from != val.pubkey {
Expand Down

0 comments on commit da0b1e5

Please sign in to comment.