mirror of
https://seed.radicle.dev/rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5.git
synced 2026-10-28 07:30:49 +08:00
Only the first peer to send us a version of an announcement was recorded as its relayer, as the `FIXME` in `handle_announcement` notes. Inventory announcements are relayed with a delay, so peers that sent the same version in the meantime were sent it back, which kept `announcement_message_amplification` close to the worst case. Node and refs announcements are relayed as soon as they arrive, so this does not affect them. The gossip store does not report which row a duplicate belongs to, so key the relayers by announcer, type and repository instead, together with the version they relayed. Having `Store::announced` report the row of a duplicate would also work, but would change what its result means for its other callers. As before, entries are never pruned, but there is now at most one entry per announcer, type and repository, rather than one per row ever created. With this, 1000 runs of `announcement_message_amplification` measured between 2.525 and 2.975, with a mean of 2.72, down from a mean of 3.98, against a best case of 2.5 for five fully connected nodes. Require it to stay below 3.25, which leaves room for the variation between runs.