Skip to content

Conversation

sipa
Copy link
Member

@sipa sipa commented Oct 11, 2020

This:

  • Documents BIP155 support in doc/bips.md
  • Restricts addrv2 relay to IPv4, IPv6, and Tor addresses. Relaying addresses in ranges that no network software has support for seems like a gratuitous spam vector.

@fanquake fanquake added the P2P label Oct 11, 2020
Copy link
Member

@hebasto hebasto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Concept ACK.

Copy link
Member

@hebasto hebasto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 7ca0e87

@jonatack
Copy link
Member

jonatack commented Oct 11, 2020

Concept ACK.

I wondered a little why the additional "should we relay this address?" logic is in RelayAddress() instead in the caller along with the existing logic. (Edit: domain separation and/or more elegant code, I suppose. It's certainly not a blocker.)

src/net_processing.cpp::L2660

            bool fReachable = IsReachable(addr);
            if (addr.nTime > nSince && !pfrom.fGetAddr && vAddr.size() <= 10 && addr.IsRoutable())
            {
                // Relay to a limited number of other nodes
                RelayAddress(addr, fReachable, m_connman);
            }

@sipa sipa force-pushed the 202010_bip155_followup branch from 7ca0e87 to 56f9dba Compare October 11, 2020 18:29
@jonatack
Copy link
Member

ACK 56f9dba

Copy link
Member

@hebasto hebasto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 56f9dba, verified both links.

@naumenkogs
Copy link
Member

ACK 56f9dba

@fanquake fanquake merged commit af22322 into bitcoin:master Oct 12, 2020
Copy link
Contributor

@vasild vasild left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(post merge) ACK 56f9dba

This patch achieves the same as the one at the bottom of #19954 (comment) and in addition the patch in this PR will relay I2P addresses if they become reachable in the future without needing an adjustment.

Given that the newly added function IsRelayable() deals with a higher level logic of whether to relay or not, maybe it would be better if it lives somewhere in net_processing.cc, next to RelayAddress() instead of as a method of the lower level CNetAddr class. But it works anyway and can be adjusted further if needed.

Thanks!

@jonatack
Copy link
Member

Further BIP155 follow-ups and minor bugfix at #20120.

vasild added a commit to vasild/bitcoin that referenced this pull request Jun 10, 2021
Nodes that can reach the I2P network (have set `-i2psam=`) will relay
I2P addresses even without this patch. However, nodes that can't reach
the I2P network will not. This was done as a precaution in
bitcoin#20119 before anybody could
connect to I2P because then, for sure, it would have been useless.

Now, however, we have I2P support and a bunch of I2P nodes, so get all
nodes on the network to relay I2P addresses to help with propagation,
similarly to what we do with Tor addresses.
luke-jr pushed a commit to bitcoinknots/bitcoin that referenced this pull request Jun 27, 2021
Nodes that can reach the I2P network (have set `-i2psam=`) will relay
I2P addresses even without this patch. However, nodes that can't reach
the I2P network will not. This was done as a precaution in
bitcoin#20119 before anybody could
connect to I2P because then, for sure, it would have been useless.

Now, however, we have I2P support and a bunch of I2P nodes, so get all
nodes on the network to relay I2P addresses to help with propagation,
similarly to what we do with Tor addresses.

Github-Pull: bitcoin#22211
Rebased-From: ba45f02
laanwj added a commit to bitcoin-core/gui that referenced this pull request Jul 15, 2021
…chable (by us)

7593b06 test: ensure I2P addresses are relayed (Vasil Dimov)
e746813 test: make CAddress in functional tests comparable (Vasil Dimov)
33e211d test: implement ser/unser of I2P addresses in functional tests (Vasil Dimov)
8674281 test: use NODE_* constants instead of magic numbers (Vasil Dimov)
ba45f02 net: relay I2P addresses even if not reachable (by us) (Vasil Dimov)

Pull request description:

  Nodes that can reach the I2P network (have set `-i2psam=`) will relay
  I2P addresses even without this patch. However, nodes that can't reach
  the I2P network will not. This was done as a precaution in
  bitcoin/bitcoin#20119 before anybody could
  connect to I2P because then, for sure, it would have been useless.

  Now, however, we have I2P support and a bunch of I2P nodes, so get all
  nodes on the network to relay I2P addresses to help with propagation,
  similarly to what we do with Tor addresses.

ACKs for top commit:
  jonatack:
    ACK 7593b06
  naumenkogs:
    ACK 7593b06.
  laanwj:
    Code review ACK 7593b06
  kristapsk:
    ACK 7593b06. Code looks correct, tested that functional test suite passes and also that `test/functional/p2p_addrv2_replay.py` fails if I undo changes in `IsRelayable()`.

Tree-SHA512: c9feec4a9546cc06bc2fec6d74f999a3c0abd3d15b7c421c21fcf2d610eb94611489e33d61bdcd5a4f42041a6d84aa892f7ae293b0d4f755309a8560b113b735
hebasto pushed a commit to hebasto/gui-qml that referenced this pull request Jul 19, 2021
Nodes that can reach the I2P network (have set `-i2psam=`) will relay
I2P addresses even without this patch. However, nodes that can't reach
the I2P network will not. This was done as a precaution in
bitcoin/bitcoin#20119 before anybody could
connect to I2P because then, for sure, it would have been useless.

Now, however, we have I2P support and a bunch of I2P nodes, so get all
nodes on the network to relay I2P addresses to help with propagation,
similarly to what we do with Tor addresses.
jarolrod pushed a commit to jarolrod/gui-qml that referenced this pull request Jul 19, 2021
Nodes that can reach the I2P network (have set `-i2psam=`) will relay
I2P addresses even without this patch. However, nodes that can't reach
the I2P network will not. This was done as a precaution in
bitcoin/bitcoin#20119 before anybody could
connect to I2P because then, for sure, it would have been useless.

Now, however, we have I2P support and a bunch of I2P nodes, so get all
nodes on the network to relay I2P addresses to help with propagation,
similarly to what we do with Tor addresses.
josibake pushed a commit to josibake/bitcoin that referenced this pull request Jul 21, 2021
Nodes that can reach the I2P network (have set `-i2psam=`) will relay
I2P addresses even without this patch. However, nodes that can't reach
the I2P network will not. This was done as a precaution in
bitcoin#20119 before anybody could
connect to I2P because then, for sure, it would have been useless.

Now, however, we have I2P support and a bunch of I2P nodes, so get all
nodes on the network to relay I2P addresses to help with propagation,
similarly to what we do with Tor addresses.
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Jul 23, 2021
…by us)

7593b06 test: ensure I2P addresses are relayed (Vasil Dimov)
e746813 test: make CAddress in functional tests comparable (Vasil Dimov)
33e211d test: implement ser/unser of I2P addresses in functional tests (Vasil Dimov)
8674281 test: use NODE_* constants instead of magic numbers (Vasil Dimov)
ba45f02 net: relay I2P addresses even if not reachable (by us) (Vasil Dimov)

Pull request description:

  Nodes that can reach the I2P network (have set `-i2psam=`) will relay
  I2P addresses even without this patch. However, nodes that can't reach
  the I2P network will not. This was done as a precaution in
  bitcoin#20119 before anybody could
  connect to I2P because then, for sure, it would have been useless.

  Now, however, we have I2P support and a bunch of I2P nodes, so get all
  nodes on the network to relay I2P addresses to help with propagation,
  similarly to what we do with Tor addresses.

ACKs for top commit:
  jonatack:
    ACK 7593b06
  naumenkogs:
    ACK 7593b06.
  laanwj:
    Code review ACK 7593b06
  kristapsk:
    ACK 7593b06. Code looks correct, tested that functional test suite passes and also that `test/functional/p2p_addrv2_replay.py` fails if I undo changes in `IsRelayable()`.

Tree-SHA512: c9feec4a9546cc06bc2fec6d74f999a3c0abd3d15b7c421c21fcf2d610eb94611489e33d61bdcd5a4f42041a6d84aa892f7ae293b0d4f755309a8560b113b735
janus pushed a commit to BitgesellOfficial/bitgesell that referenced this pull request Oct 29, 2021
Nodes that can reach the I2P network (have set `-i2psam=`) will relay
I2P addresses even without this patch. However, nodes that can't reach
the I2P network will not. This was done as a precaution in
bitcoin/bitcoin#20119 before anybody could
connect to I2P because then, for sure, it would have been useless.

Now, however, we have I2P support and a bunch of I2P nodes, so get all
nodes on the network to relay I2P addresses to help with propagation,
similarly to what we do with Tor addresses.
Fabcien pushed a commit to Bitcoin-ABC/bitcoin-abc that referenced this pull request Nov 10, 2021
Summary:
> Mention BIP155 in doc/bips.md

> Only relay IPv4, IPv6, Tor addresses

This is a backport of [[bitcoin/bitcoin#20119 | core#20119]]

Test Plan: `ninja all check-all`

Reviewers: #bitcoin_abc, Fabien

Reviewed By: #bitcoin_abc, Fabien

Subscribers: Fabien

Differential Revision: https://reviews.bitcoinabc.org/D10438
@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.

6 participants