Skip to content

Conversation

@morcos
Copy link
Contributor

@morcos morcos commented Feb 11, 2016

No description provided.

@pstratem
Copy link
Contributor

utACK

5a2b1c0

@sipa
Copy link
Member

sipa commented Feb 11, 2016

utACK

@pstratem Unnested ACK?

@morcos
Copy link
Contributor Author

morcos commented Feb 11, 2016

@laanwj sorry, needs backport

@pstratem
Copy link
Contributor

@sipa typo

@luke-jr
Copy link
Member

luke-jr commented Feb 12, 2016

Why not? How will they get relayed then?

At least attempt to add it to our own mempool again before failing...

@morcos
Copy link
Contributor Author

morcos commented Feb 12, 2016

@luke-jr My original attempt included trying to add it to your own mempool again first, but its an unfortunate amount of cs_main locking that would be needed.
Also this behavior preserves the functionality from 0.11 when txs not in your mempool had GetDepthInMainChain return less than 0.

@gmaxwell
Copy link
Contributor

ACK (with moderate testing)

@luke-jr
Copy link
Member

luke-jr commented Feb 12, 2016

Also this behavior preserves the functionality from 0.11 when txs not in your mempool had GetDepthInMainChain return less than 0.

That's a bug. They shouldn't be negative until a conflict is mined.

@luke-jr
Copy link
Member

luke-jr commented Feb 12, 2016

My original attempt included trying to add it to your own mempool again first, but its an unfortunate amount of cs_main locking that would be needed.

Rebroadcasts are rare anyway, right? I don't see why locking would be an issue...

@gmaxwell
Copy link
Contributor

@luke-jr This needs to be the simplest and most obviously-does-no-harm change to avoid a serious behavior regression in 0.12. The whole rebroadcast logic in general is brain-damaged and privacy destroying and we should fix it more completely, but this PR is not the time.

@morcos
Copy link
Contributor Author

morcos commented Feb 12, 2016

@luke-jr yes, i'm saying that in 0.11 they were negative so weren't rebroadcast. now they aren't negative, so we need to explicitly not rebroadcast them. i dont think they are rare are they?

@luke-jr
Copy link
Member

luke-jr commented Feb 12, 2016

@morcos It was literally impossible to have a wallet transaction that was rejected by your own mempool, in 0.11.

@gmaxwell What behaviour is regressed right now? The PR is severely lacking in details on what it's trying to fix...

@gmaxwell
Copy link
Contributor

@luke-jr In 0.11 same as in 0.12, a wallet transaction will be rejected by your mempool if your fee settings are higher than the tx pays.

The regressed behavior is that in 0.12 the node will continually rebroadcast non-mempoolable (and non-mempool) transactions; which is incredibly deanonymizing (and somewhat bandwidth wasting). E.g. you pay someone a tiny amount with a 1e-8/byte fee when their mempool isn't full and then their client will continue to beacon forever... and because their own node hasn't and wouldn't mempool the transaction, it's completely clear that they're the origin.

@luke-jr
Copy link
Member

luke-jr commented Feb 12, 2016

Oh! So this doesn't restore the "-1 if not in mempool" bug, it only restores the side effect of that preventing rebroadcast. Makes [enough] sense for now. Concept ACK.

@luke-jr
Copy link
Member

luke-jr commented Feb 12, 2016

@morcos Can you document the rationale here better in the commit message? Maybe something like:

wallet: Don't resend wallet txs that aren't in our own mempool

Rebroadcasting of wtx for not-in-mempool transactions was previously prevented by GetDepthInMainChain erroneously returning -1 for them. This restores that previous behaviour.

@luke-jr
Copy link
Member

luke-jr commented Feb 12, 2016

Actually, this is a new condition in 0.12, since 0.11 never would create a transaction that wouldn't be accepted to the mempool (and why the -1 bug wasn't really quite a bug in 0.11). So this does seem to indeed still change the behaviour negatively... so I guess I'm back to not seeing a justification for this change. :(

@laanwj laanwj added the Wallet label Feb 12, 2016
@gmaxwell
Copy link
Contributor

@luke-jr "wouldn't create" is too limited, people sendrawtransaction, wallets get copied, nodes get restarted with different settings, and this covers received transactions too.

if (!IsCoinBase())
{
if (GetDepthInMainChain() == 0 && !isAbandoned()) {
if (GetDepthInMainChain() == 0 && !isAbandoned() && InMempool()) {
Copy link
Contributor

Choose a reason for hiding this comment

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

orange flag: another coupling between the wallet and the full-node.

Copy link
Member

Choose a reason for hiding this comment

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

@jonasschnelli Sometimes I think 'outgoing' transactions need to be in a special section of the wallet. A bit like how mail programs have an 'outbox'. Newly created transactions will end up there, and are removed after trying to broadcast for a while - or when the user wants to give up on them.

It would be better than considering all transactions for rebroadcast. At the least it would give the user explicit control over that.

In any case, it doesn't need to block this sensible privacy improvement, but I agree that the rebroadcast logic is still far from optimal.

@dcousens
Copy link
Contributor

utACK 5a2b1c0

@sdaftuar
Copy link
Member

utACK

@laanwj
Copy link
Member

laanwj commented Mar 3, 2016

utACK 5a2b1c0

@laanwj laanwj merged commit 5a2b1c0 into bitcoin:master Mar 3, 2016
laanwj added a commit that referenced this pull request Mar 3, 2016
5a2b1c0 Don't resend wallet txs that aren't in our own mempool (Alex Morcos)
maflcko pushed a commit to maflcko/bitcoin-core that referenced this pull request Apr 27, 2016
@maflcko
Copy link
Member

maflcko commented Jun 9, 2016

Backported as part of #7938. Removing label 'Needs backport'.

thokon00 pushed a commit to faircoin/faircoin that referenced this pull request Jun 28, 2016
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Sep 8, 2021
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.

10 participants