Repository navigation
wallet: don't resubmit transactions under -privatebroadcast - #36330
instagibbs wants to merge 1 commit into
Conversation
|
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. External sites
ReviewsSee the guideline and AI policy for information on the review process.
If your review is incorrectly listed, please copy-paste ConflictsReviewers, this pull request conflicts with the following ones:
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. |
Is it? The current behavior is that all transactions being sent via the wallet do not use private broadcast at all; See also: #34533 (comment) |
This is true, but the case this change is protecting against is transactions sent by other means that also belong to the wallet. So if a user is running with |
|
Is this intended for backport? I ask because if we were not going to backport, then we could instead fix this by having the wallet use private broadcast. But for a backport fix this would be sufficient for existing users, with the tradeoff of reducing reliability of wallet transactions confirming a little bit. |
b7ea578 to
704238c
Compare
|
@andrewtoth Given that wallet integration isn't close to done, I think we should remove footguns until we get there. This is easily reversed. I think backporting makes sense for the same reason. |
8c4e257 to
6d54502
Compare
|
|
||
| self.log.info("The periodic resend does not re-add it") | ||
| # Resending needs a recent tip (the restart put node1 back in IBD) and a block seen since startup | ||
| self.generate(node1, 1, sync_fun=self.no_op) |
There was a problem hiding this comment.
nit:
This second test that tx's are not readded at the resubmit timer is dependent on the test above, e.g. consider this diff:
diff --git a/src/wallet/wallet.cpp b/src/wallet/wallet.cpp
index 93851a8736..8d15b02f37 100644
--- a/src/wallet/wallet.cpp
+++ b/src/wallet/wallet.cpp
@@ -1917,7 +1917,7 @@ void CWallet::ResubmitWalletTransactions(node::TxBroadcast broadcast_method, boo
// Don't attempt to resubmit if the wallet is configured to not broadcast,
// even if forcing.
if (!fBroadcastTransactions) return;
- if (m_private_broadcast) return;
+ // if (m_private_broadcast) return;
int submitted_tx_count = 0;
diff --git a/test/functional/wallet_resendwallettransactions.py b/test/functional/wallet_resendwallettransactions.py
index e4afad1d42..8f1da010e3 100755
--- a/test/functional/wallet_resendwallettransactions.py
+++ b/test/functional/wallet_resendwallettransactions.py
@@ -161,7 +161,8 @@ class ResendWalletTransactionsTest(BitcoinTestFramework):
node1.replace_in_config([("connect=0\n", "")]) # -privatebroadcast refuses -connect
privbcast_args = ["-privatebroadcast", "-onion=127.0.0.1:9", "-persistmempool=0"] # the proxy is never used here
self.restart_node(1, extra_args=privbcast_args + [f"-mocktime={node1.mocktime}"])
- assert recv_txid not in node1.getrawmempool() # loading the wallet did not re-add it
+ # [first test disabled]
+ # assert recv_txid not in node1.getrawmempool() # loading the wallet did not re-add it
self.log.info("The periodic resend does not re-add it")
# Resending needs a recent tip (the restart put node1 back in IBD) and a block seen since startupThen this second check passes (since the generate line included the tx in a block), maybe add a (redundant) check here, e.g.:
| self.generate(node1, 1, sync_fun=self.no_op) | |
| assert recv_txid not in node1.getrawmempool() | |
| self.generate(node1, 1, sync_fun=self.no_op) |
maybe spurious [why would somebody delete or move one of the tests], but IMO these long winded functional tests where each of the checks are not scoped and there's stateful stuff are hard enough to read and even though it's obvious to us reviewing this now, to my grug brain at least it would not be obvious that the properties this claims to test are only there if the test above also passes
There was a problem hiding this comment.
I had it mine an empty block, then did the assertion it's not in mempool. that help grug? (I agree these should all be subtests split off, easy cleanup task)
There was a problem hiding this comment.
I ask because if we were not going to backport, then we could instead fix this by having the wallet use private broadcast.
I think that promoting private broadcast into an essential feature (and with it, connectivity to privacy networks) that is required for basic functionality such as rebroadcasting is a major change that needs to be very well discussed, to say the least.
As of now I view it as an optional feature.
But as such, I could see users starting with -privatebroadcast just to send out some transactions, and then restarting back to regular mode without private broadcast with a wallet that rebroadcasts them. This could reveal the origin of their transactions after the fact, so there is only so much this PR can achieve.
|
crACK 6d54502 It is unfortunate that restarting subjects a user to potentially losing privacy if a TX is not confirmed. I would personally be in favor of dropping wallet rebroadcasting completely, it is a massive privacy footgun for non-privatebroadcast users as well, for little benefit. At least, for little benefit that couldn't be provided with other solutions that are less harmful. |
I was merely suggesting to have the wallet rebroadcast via private broadcast if |
|
Improving privacy is good, but I think this has taken an odd approach:
I think it is better to make wallet rebroadcasts separately controllable, independently of |
|
@vasild I don't think adding more knobs is the right direction, we already have
We can change documentation if we change behavior. Only matters if the change is correct/good/etc. @davidgumberg yeah, I am quite skeptical of the wallet rebroadcast feature, it's built around corner cases and is a massive leak. Would be willing to discuss alternatives in an issue regardless of how this PR goes. |
…dcast The wallet re-adds its unconfirmed transactions to the mempool periodically and whenever a wallet is loaded or its transactions are imported. A transaction that the rest of the network has dropped is then held by this node alone, and served to any peer that asks for it, which marks it as the node's own. Not announcing the re-added transaction does not hide this: any relay peer can fetch anything in the mempool once the next inv round has passed. With -privatebroadcast, skip the resubmission entirely. Transactions sent through the wallet are still submitted and announced as before, since those never went through private broadcast in the first place.
6d54502 to
3544df2
Compare
One such alternative has an issue open #30471. |
Right, I am not convinced either. Maybe the existent option can be extended, see at the bottom of #36380 (comment)
I just don't like those parameter interactions - in general, they could be hard to reason about. So to have
Right. And it would be nice to have the wallet use the private broadcast for its transactions even if currently it is documented that it does not :)
💯 |
|
I've opened #36403 where we can have more high level discussion about transaction rebroadcast in general. |
|
moving to draft due to lack of consensus |
andrewtoth
left a comment
There was a problem hiding this comment.
Code Review ACK 3544df2
Concept NACK |
Interactions between features exist and should not be ignored. It's a wallet issue, for sure, but for a wallet + pb user, it would be extremely surprising.
I don't think handing users footguns and hoping they read the docs is the right approach. Ideally we'd remove / replace rebroadcasts entirely, then this particular coupling can disappear safely. #36403 (comment) for some discussion for those following at home. |
|
I tend to concept NACK this although I cannot come with a better proposal that 100% fixes this right now. I don't think disallowing re-broadcast is the right solution (I know this is proposed as a temporal fix). Although it is not perfect, I prefer something like #36482 which I consider a good half-patch that limits this issue to a really specific case were a transaction disappears from node's mempool and is when we should consider rebroadcast necessary (in its current implementation). I don't think the incoming dust privacy attack is an argument for pushing this PR forward. That attack affects both, private and standard broadcast, and as I understand private broadcast, it improves your privacy when you send a transaction, not when you receive one. It helps hiding you are the origin of a transaction, but that doesn't mean that it makes impossible to know that you are the origin of a transaction. |
|
Should this be closed/drafted for now given the nacks? |
|
dont know what the direction is on this, closing |

This doesn't fix the general case of rebroadcasting potentially surprising users by divulging the originator IP trivially, but for users opting into private broadcast, it seems a bridge too far for them to expect the current behavior.
e.g. an incoming dust payment triggering your node to rebroadcast 24-36th later over clearnet
This can be removed if/when wallet drives through private broadcast.
see #3828 for running broader issue