-
Notifications
You must be signed in to change notification settings - Fork 5.9k
BIP155: change when sendaddrv2 is to be sent #1043
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
If the implementation is to be changed instead, then this patch is to be applied to it: change net_processing.cppdiff --git i/src/net_processing.cpp w/src/net_processing.cpp
index 1b4a05f0b..e46cbe487 100644
--- i/src/net_processing.cpp
+++ w/src/net_processing.cpp
@@ -2361,15 +2361,12 @@ void PeerManager::ProcessMessage(CNode& pfrom, const std::string& msg_type, CDat
if (greatest_common_version >= WTXID_RELAY_VERSION) {
m_connman.PushMessage(&pfrom, msg_maker.Make(NetMsgType::WTXIDRELAY));
}
m_connman.PushMessage(&pfrom, msg_maker.Make(NetMsgType::VERACK));
- // Signal ADDRv2 support (BIP155).
- m_connman.PushMessage(&pfrom, msg_maker.Make(NetMsgType::SENDADDRV2));
-
pfrom.nServices = nServices;
pfrom.SetAddrLocal(addrMe);
{
LOCK(pfrom.cs_SubVer);
pfrom.cleanSubVer = cleanSubVer;
}
@@ -2509,12 +2506,14 @@ void PeerManager::ProcessMessage(CNode& pfrom, const std::string& msg_type, CDat
uint64_t nCMPCTBLOCKVersion = 2;
if (pfrom.GetLocalServices() & NODE_WITNESS)
m_connman.PushMessage(&pfrom, msgMaker.Make(NetMsgType::SENDCMPCT, fAnnounceUsingCMPCTBLOCK, nCMPCTBLOCKVersion));
nCMPCTBLOCKVersion = 1;
m_connman.PushMessage(&pfrom, msgMaker.Make(NetMsgType::SENDCMPCT, fAnnounceUsingCMPCTBLOCK, nCMPCTBLOCKVersion));
}
+ // Signal ADDRv2 support (BIP155).
+ m_connman.PushMessage(&pfrom, msgMaker.Make(NetMsgType::SENDADDRV2));
pfrom.fSuccessfullyConnected = true;
return;
}
// Feature negotiation of wtxidrelay should happen between VERSION and
// VERACK, to avoid relay problems from switching after a connection is upthat would send |
|
A third option would be to use the same feature negotiation order that was used for wtxidrelay |
That would be " |
|
In the same way as wtxidrelay SGTM for being simpler rather than a different mechanism for each. |
33db426 to
50613bb
Compare
|
Changed to send it before sending verack (like wtxidrelay). |
|
ACK 50613bb |
|
ACK 50613bb |
jonatack
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Concept ACK
50613bb to
c2c55cf
Compare
|
ACK c2c55cf |
Mandate to send `sendaddrv2` to the peer before sending our `verack` to them. This way we know that the peer does not support `addrv2` if we did not receive `sendaddrv2` from them before receiving their `verack`.
c2c55cf to
e549ed3
Compare
|
There are many ways to say it, I hope the current phrasing is clear enough and good for everybody. |
|
ACK e549ed3 |
|
ACK e549ed3 Thanks for updating! |
|
ACK e549ed3 |
jonatack
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK e549ed3
hebasto
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK e549ed3, I believe that the establishing of connection invariants in a such manner--in response to the version and prior to sending the verack--is the right way both for new addrv2 message and for other future features.
|
According to the BIP process, this needs an ACK by the BIP champion @laanwj :) |
|
re-ACK e549ed3 |
See the corresponding BIP change: bitcoin/bips#1043
|
Thank you |
See the corresponding BIP change: bitcoin/bips#1043 Github-Pull: #20564 Rebased-From: 1583498 (cherry picked from commit bead935)
See the corresponding BIP change: bitcoin/bips#1043 Github-Pull: #20564 Rebased-From: 1583498 (cherry picked from commit bead935)
See the corresponding BIP change: bitcoin/bips#1043 Github-Pull: #20564 Rebased-From: 1583498 (cherry picked from commit bead935)
Summary --- This is a backport of bitcoin/bitcoin@1583498 > See the corresponding BIP change: bitcoin/bips#1043 Test plan --- * `ninja all check-all`
…nd send before 'verack' 1583498 Send and require SENDADDRV2 before VERACK (Pieter Wuille) c5a8919 Don't send 'sendaddrv2' to pre-70016 software (Pieter Wuille) Pull request description: BIP155 defines addrv2 and sendaddrv2 for all protocol versions, but some implementations reject messages they don't know. As a courtesy, don't send it to nodes with a version before 70016, as no software is known to support BIP155 that doesn't announce at least that protocol version number. Also move the sending of sendaddrv2 earlier (before sending verack), as proposed in bitcoin/bips#1043. This has the side effect that local address broadcast of torv3 will work (as it'll only trigger after we know whether or not the peer supports addrv2). ACKs for top commit: MarcoFalke: ACK 1583498 jnewbery: ACK 1583498 jonatack: ACK 1583498 vasild: ACK 1583498 Tree-SHA512: 3bd5833fa8c8567b6dedd99e4a9b6bb71c127aa66d5284b217503c86d597dc59aa7382c41f3a4bf561bb658b89db81d1a7703a700eef4ffc17cb916660e23a82
Mandate to send
sendaddrv2to the peer before sending ourverackto them.
This way we know that the peer does not support
addrv2if we did notreceive
sendaddrv2from them before receiving theirverack.