-
Notifications
You must be signed in to change notification settings - Fork 38.7k
net: Add option -enablebip61 to configure sending of BIP61 notifications
#13134
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
f0eb36f to
a0dad2b
Compare
test/functional/p2p_invalid_tx.py
Outdated
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.
txr seems unused?
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.
yes, it's not necessary, we can re-use tx1 (initially added it because it looked like I needed to generate a different transaction, but persistmempool=0 works too...)
|
Concept ACK |
1 similar comment
|
Concept ACK |
|
Concept ACK |
|
utACK ca4d71559c9d0f4a5a9a1dec105bff827b530a00 (after squashing the squashme) |
ca4d715 to
39d4d10
Compare
|
Squashed ca4d715 → 39d4d10 |
|
Concept ACK |
maflcko
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.
utACK 39d4d10bc961ae939b6bdabfd030140012c8b395. Just two style nits in tests
test/functional/p2p_invalid_tx.py
Outdated
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.
nit: If you set the reject_code, you might as well set the reject_reason:
reject_reason=b'mandatory-script-verify-flag-failed (Invalid OP_IF construction)'
test/functional/p2p_invalid_tx.py
Outdated
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.
micro-style-nit: Could add a white space after the comma?
jnewbery
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.
Tested ACK 39d4d10bc961ae939b6bdabfd030140012c8b395
My only micro-nit has been covered by @MarcoFalke
A couple of general points/questions:
- I think
-enablebip61is a better argument name than-peersendreject, which I think could be a little ambiguous/confusing. - Should this option also disable logging of received REJECT messages in
ProcessMessage()(to shut down the possibility of peers spamming our debug log with REJECT messages).
Possible enhancements for future PRs:
- disable REJECT messages by default.
- make this configurable per peer (eg for whitelisted peers)
|
Agree that mentioning bip61 in the option name makes sense. |
As you might have guessed from the variable name I used that name at first, but thought this name was more direct/clear. But I'm ok with changing it to that. One of the reasons for switching it around was that
I think that's an orthogonal concern. One might want their node to be silent but still listen to other's reject messages. |
|
Needs rebase |
|
Why would this already not be relevant now? |
|
Sorry, this is an automated template reply :) |
39d4d10 to
47d858d
Compare
-peersendreject to configure sending of BIP61 notifications-enablebip61 to configure sending of BIP61 notifications
|
Rebased and renamed the option. |
|
Strange. p2p_invalid_tx.py fails in one job in Travis, on the updated line: I can't reproduce this locally. |
|
Right - and that's not even with changed If it gets to that |
0b3ff97 to
56d8a5b
Compare
|
I'd missed @MarcoFalke 's comment about testing reject reason, patched and squashed: |
|
Yes, the travis failure is unrelated. I will open an issue when I see this again. |
|
re-utACK 56d8a5b0b58afc978bf47d7f18164d0362a433b0 (Only change is rebase and test fixup as well as a change to the option name) |
|
Needs rebase due to merge conflict in tests |
…tions This commit adds a boolean option `-enablebip61`, defaulting to `1`, that can be used to disable the sending of BIP61 `reject` messages. This functionality has been requested for various reasons: - security (DoS): reject messages can reveal internal state that can be used to target certain resources such as the mempool more easily. - bandwidth: a typical node sends lots of reject messages; this counts against upstream bandwidth. Also the reject messages tend to be larger than the message that was rejected. On the other hand, reject messages can be useful while developing client software (I found them indispensable while creating bitcoin-submittx), as well as for our own test cases, so whatever the default becomes on the long run, IMO the functionality should be retained as option. But that's a discussion for later.
56d8a5b to
87fe292
Compare
|
Rebased 56d8a5b0b58afc978bf47d7f18164d0362a433b0 → 87fe292 |
|
re-utACK 87fe292 (no changes other than rebase) |
|
utACK 87fe292 |
|
@jonasschnelli @sdaftuar Mind to re-ACK? |
|
utACK 87fe292 |
…BIP61 notifications 87fe292 doc: Mention disabling BIP61 in bips.md (Wladimir J. van der Laan) fe16dd8 net: Add option `-enablebip61` to configure sending of BIP61 notifications (Wladimir J. van der Laan) Pull request description: This commit adds a boolean option `-peersendreject`, defaulting to `1`, that can be used to disable the sending of [BIP61](https://github.com/bitcoin/bips/blob/master/bip-0061.mediawiki) `reject` messages. This functionality has been requested for various reasons: - security (DoS): reject messages can reveal internal state that can be used to target certain resources such as the mempool more easily. - bandwidth: a typical node sends lots of reject messages; this counts against upstream bandwidth. Also the reject messages tend to be larger than the message that was rejected. On the other hand, reject messages can be useful while developing client software (I found them indispensable while creating bitcoin-submittx), as well as for our own test cases, so whatever the default becomes on the long run, IMO the functionality should be retained as option. But that's a discussion for later, for now it's simply a node operator decision. Also adds a RPC test that checks the functionality. Tree-SHA512: 9488cc53e13cd8e5c6f8eb472a44309572673405c1d1438c3488f627fae622c95e2198bde5ed7d29e56b948e2918bf1920239e9f865889f4c37c097c37a4d7a9
…ing of BIP61 notifications 87fe292 doc: Mention disabling BIP61 in bips.md (Wladimir J. van der Laan) fe16dd8 net: Add option `-enablebip61` to configure sending of BIP61 notifications (Wladimir J. van der Laan) Pull request description: This commit adds a boolean option `-peersendreject`, defaulting to `1`, that can be used to disable the sending of [BIP61](https://github.com/bitcoin/bips/blob/master/bip-0061.mediawiki) `reject` messages. This functionality has been requested for various reasons: - security (DoS): reject messages can reveal internal state that can be used to target certain resources such as the mempool more easily. - bandwidth: a typical node sends lots of reject messages; this counts against upstream bandwidth. Also the reject messages tend to be larger than the message that was rejected. On the other hand, reject messages can be useful while developing client software (I found them indispensable while creating bitcoin-submittx), as well as for our own test cases, so whatever the default becomes on the long run, IMO the functionality should be retained as option. But that's a discussion for later, for now it's simply a node operator decision. Also adds a RPC test that checks the functionality. Tree-SHA512: 9488cc53e13cd8e5c6f8eb472a44309572673405c1d1438c3488f627fae622c95e2198bde5ed7d29e56b948e2918bf1920239e9f865889f4c37c097c37a4d7a9
…ding of BIP61 notifications (#3414) * Merge bitcoin#13134: net: Add option `-enablebip61` to configure sending of BIP61 notifications 87fe292 doc: Mention disabling BIP61 in bips.md (Wladimir J. van der Laan) fe16dd8 net: Add option `-enablebip61` to configure sending of BIP61 notifications (Wladimir J. van der Laan) Pull request description: This commit adds a boolean option `-peersendreject`, defaulting to `1`, that can be used to disable the sending of [BIP61](https://github.com/bitcoin/bips/blob/master/bip-0061.mediawiki) `reject` messages. This functionality has been requested for various reasons: - security (DoS): reject messages can reveal internal state that can be used to target certain resources such as the mempool more easily. - bandwidth: a typical node sends lots of reject messages; this counts against upstream bandwidth. Also the reject messages tend to be larger than the message that was rejected. On the other hand, reject messages can be useful while developing client software (I found them indispensable while creating bitcoin-submittx), as well as for our own test cases, so whatever the default becomes on the long run, IMO the functionality should be retained as option. But that's a discussion for later, for now it's simply a node operator decision. Also adds a RPC test that checks the functionality. Tree-SHA512: 9488cc53e13cd8e5c6f8eb472a44309572673405c1d1438c3488f627fae622c95e2198bde5ed7d29e56b948e2918bf1920239e9f865889f4c37c097c37a4d7a9 * 0.17 -> 0.16 Signed-off-by: Pasta <[email protected]> * tx1 -> base_ tx fixing 13134 Signed-off-by: Pasta <[email protected]> * move added bip61 message checking up Signed-off-by: Pasta <[email protected]> * Dash specific code, only send reject messages if bip61 is enabled Signed-off-by: Pasta <[email protected]> * Fix invalidtxrequest.py Co-authored-by: Wladimir J. van der Laan <[email protected]> Co-authored-by: UdjinM6 <[email protected]>
This commit adds a boolean option
-peersendreject, defaulting to1, that can be used to disable the sending of BIP61rejectmessages. This functionality has been requested for various reasons:security (DoS): reject messages can reveal internal state that can be used to target certain resources such as the mempool more easily.
bandwidth: a typical node sends lots of reject messages; this counts against upstream bandwidth. Also the reject messages tend to be larger than the message that was rejected.
On the other hand, reject messages can be useful while developing client software (I found them indispensable while creating bitcoin-submittx), as well as for our own test cases, so whatever the default becomes on the long run, IMO the functionality should be retained as option. But that's a discussion for later, for now it's simply a node operator decision.
Also adds a RPC test that checks the functionality.