Skip to content

Conversation

@sdaftuar
Copy link
Member

@sdaftuar sdaftuar commented Dec 3, 2020

We use a rolling bloom filter to track which addresses we've previously sent a peer, but after #7125 we no longer clear it every day before our own announcement. This looks to me like an oversight which has the effect of reducing the frequency with which we actually self-announce our own address, so this reintroduces resetting that filter.

This behavior was apparently inadvertently broken in 5400ef6; without this
change our daily self-announcements frequently go unsent, because our
address is still in the peer's rolling bloom filter (for potentially many
days, depending on addr traffic).
@DrahtBot DrahtBot added the P2P label Dec 3, 2020
@sipa
Copy link
Member

sipa commented Dec 3, 2020

Concept ACK on resetting on relay.

Your second commit seems to be identical to #19763 (unclear what the status is there, but there was some interesting discussion earlier).

@sdaftuar
Copy link
Member Author

sdaftuar commented Dec 3, 2020

@sipa Thanks, I missed that PR. I'll drop my second commit and let the discussion continue in #19763.

@sdaftuar sdaftuar changed the title p2p: periodically clear m_addr_known, and choose new peers to receive relayed addresses p2p: periodically clear m_addr_known Dec 3, 2020
@naumenkogs
Copy link
Contributor

I was aware of this issue, but I was never sure whether it's intended or not...
I guess your reasoning makes sense, especially considering stuff happened in #7125.

Even if non-clearing somehow gave us extra security, it was probably a side-effect, because it was never documented.
I also tried to break AddrMan many times, and but that never has anything to do with the freshness of m_addr_known.

At most what an attacker gets here is easier noticing when we roll the filter precisely.
But I don't think timing this activity gives any significant advantage to an attacker.

ACK 65273fa

@bitcoin bitcoin deleted a comment from DrahtBot Dec 4, 2020
@laanwj
Copy link
Member

laanwj commented Dec 7, 2020

Code review ACK 65273fa

@sipa
Copy link
Member

sipa commented Dec 7, 2020

utACK 65273fa

@laanwj laanwj merged commit 1a9fa4c into bitcoin:master Dec 7, 2020
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Dec 7, 2020
65273fa Clear m_addr_known before our periodic self-advertisement (Suhas Daftuar)

Pull request description:

  We use a rolling bloom filter to track which addresses we've previously sent a peer, but after bitcoin#7125 we no longer clear it every day before our own announcement.  This looks to me like an oversight which has the effect of reducing the frequency with which we actually self-announce our own address, so this reintroduces resetting that filter.

ACKs for top commit:
  naumenkogs:
    ACK 65273fa
  laanwj:
    Code review ACK 65273fa
  sipa:
    utACK 65273fa

Tree-SHA512: 602c155fb6d2249b054fcb6f1c0dd17143605ceb87132286bbd90babf26d258ff6c41f9925482c17e2be41805d33f9b83926cb447f394969ffecd4bccfa0a64f
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Jan 21, 2022
Summary:
```
This behavior was apparently inadvertently broken in 5400ef6; without this change our daily self-announcements frequently go unsent, because our address is still in the peer's rolling bloom filter (for potentially many days, depending on addr traffic).
```

Backport of [[bitcoin/bitcoin#20561 | core#20561]].

Ref T1696.

Test Plan:
  ninja all check-all

Reviewers: #bitcoin_abc, PiRK

Reviewed By: #bitcoin_abc, PiRK

Maniphest Tasks: T1696

Differential Revision: https://reviews.bitcoinabc.org/D10859
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Feb 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants