Skip to content
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

net: Set relay in version msg to peers with relay permission in -blocksonly mode #26248

Merged
merged 1 commit into from
Oct 21, 2022

Conversation

maflcko
Copy link
Member

@maflcko maflcko commented Oct 4, 2022

Seems odd to set the relay permission in -blocksonly mode and also ask the peer not to relay transactions.

@maflcko
Copy link
Member Author

maflcko commented Oct 4, 2022

Given that no one ever reported a bug about this, it seems likely that this flag was never used in a client that doesn't violate the P2P protocol

@DrahtBot
Copy link
Contributor

DrahtBot commented Oct 4, 2022

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #26247 (refactor: Make m_mempool optional in PeerManager by MarcoFalke)
  • #24170 (p2p, rpc: Manual block-relay-only connections with addnode by mzumsande)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

Copy link
Member

@naumenkogs naumenkogs left a comment

Choose a reason for hiding this comment

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

ACK dddd1ac

We will now announce relay-tx in VERSION for those peers for which we set the corresponding permission.
Previously, they would have to technically violate this flag in some cases (blocksonly), although we didn't punish them for it.
This PR resolves this mismatch.

Copy link
Member

@glozow glozow 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
Contributor

@mzumsande mzumsande left a comment

Choose a reason for hiding this comment

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

ACK dddd1ac

Not a fan of the exception to sometimes accept / relay transactions in -blocksonly mode (It causes a lot of additional code complexity / privacy issues and I wonder if anyone out there actually use it), but this makes NetPermissionFlags::Relay consistent with its intended use.

@@ -5224,6 +5224,7 @@ bool PeerManagerImpl::RejectIncomingTxs(const CNode& peer) const
{
// block-relay-only peers may never send txs to us
if (peer.IsBlockOnlyConn()) return true;
if (peer.IsFeelerConn()) return true;
Copy link
Contributor

Choose a reason for hiding this comment

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

This means that we would now also disconnect feeler connections for sending us TX / TX-Invs - but that really shouldn't matter either way because we have disconnected feelers anyway before processing any non-VERSION messages from them.

Copy link
Member Author

Choose a reason for hiding this comment

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

Correct, with the current code this should only ever have any effect on PushNodeVersion (to retain the previous behaviour).

@maflcko
Copy link
Member Author

maflcko commented Oct 17, 2022

Not a fan of the exception

I am not a fan either. I think the use case is that you want to treat an external wallet (connected over P2P with relay permission) to be treated the same as a local Bitcoin Core internal wallet.

I am happy to remove the feature, if reviewers prefer that.

@mzumsande
Copy link
Contributor

I am happy to remove the feature, if reviewers prefer that.

Since this feature has been supported for a long time, I think removing it would require a bit of communication and wider disucssion (maybe a ML post to find out if people are using this) - I don't think this should be done here, this seems good to go as is.

@dergoegge
Copy link
Member

ACK dddd1ac

Would also be ok with removing the feature.

(I did not consider the relay permission in #22340, not sure if that should be revisited)

@maflcko maflcko merged commit 8c5c98d into bitcoin:master Oct 21, 2022
@maflcko maflcko deleted the 2210-version-relay-🥐 branch October 21, 2022 10:24
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Oct 23, 2022
@bitcoin bitcoin locked and limited conversation to collaborators Oct 21, 2023
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.

7 participants