Return txid even if ATMP fails for new transaction #9302
pull sipa wants to merge 1 commits into bitcoin:master from sipa:failedtxid changing 1 files +4 −4-
sipa commented at 7:49 pm on December 8, 2016: member
-
jonasschnelli added the label Wallet on Dec 8, 2016
-
jonasschnelli commented at 7:54 pm on December 8, 2016: contributorutACK a0728ccebb155b09cc537c88275662e33c1ab675 Would be nice if someone could write a test for this.
-
Return txid even if ATMP fails for new transaction b3a74100b8
-
sipa force-pushed on Dec 8, 2016
-
sipa added the label Bug on Dec 8, 2016
-
sipa added the label Needs backport on Dec 8, 2016
-
morcos commented at 9:01 pm on December 8, 2016: member
utACK b3a7410
I think this needs release notes documenting the change in behavior.
For 0.14.0 (not backport) we should also consider how to pass on the information on whether the tx was accepted to the mempool and if not why not?
-
MarcoFalke added this to the milestone 0.13.2 on Dec 8, 2016
-
MarcoFalke added the label Needs release notes on Dec 8, 2016
-
luke-jr commented at 0:42 am on December 9, 2016: memberutACK. It may make sense to move broadcasting outside of CommitTransaction entirely, but this is good enough for now (and backport).
-
sdaftuar commented at 1:46 pm on December 9, 2016: member
ACK b3a74100b86423c553ac327f3ea6fdbc2c50890a, wrote up a quick test to exercise the logic (EDIT: note that this test is no good to merge, as #9262 may require it to be rewritten):
0diff --git a/qa/rpc-tests/wallet.py b/qa/rpc-tests/wallet.py 1index 3c0dc0f..6435f00 100755 2--- a/qa/rpc-tests/wallet.py 3+++ b/qa/rpc-tests/wallet.py 4@@ -346,5 +346,18 @@ class WalletTest (BitcoinTestFramework): 5 assert_equal(coinbase_tx_1["transactions"][0]["blockhash"], blocks[1]) 6 assert_equal(len(self.nodes[0].listsinceblock(blocks[1])["transactions"]), 0) 7 8+ # Test that spending coins doesn't fail as long as balance is high enough. 9+ to_send = 0.05 10+ txids = [] 11+ while self.nodes[0].getbalance() > to_send: 12+ txids.append(self.nodes[0].sendtoaddress(self.nodes[0].getnewaddress(), to_send)) 13+ 14+ mempool = self.nodes[0].getrawmempool() 15+ sent_tx_not_in_mempool = False 16+ for txid in txids: 17+ if (txid not in mempool): 18+ sent_tx_not_in_mempool = True 19+ assert(sent_tx_not_in_mempool) # otherwise test needs to be updated to cover this case 20+ 21 if __name__ == '__main__': 22 WalletTest().main()
-
morcos commented at 3:35 pm on December 9, 2016: member
@gmaxwell No, I mean more than that. I think it would be good to inform the user that for some reason his transaction has not be accepted to the mempool. Perhaps there is no good way to do this without breaking the RPC API, but at the very least we could do it from the GUI.
But to be clear, I do not think that should be a blocker for this. I’ll agree that this is an improvement, I just think we should continue to improve afterwards…
-
gmaxwell commented at 5:13 pm on December 9, 2016: contributorACK
-
CodeShark commented at 8:57 am on December 11, 2016: contributorACK
-
MarcoFalke commented at 9:28 am on December 11, 2016: memberutACK b3a74100b86423c553ac327f3ea6fdbc2c50890a
-
MarcoFalke commented at 9:34 am on December 11, 2016: memberI’d prefer not to merge any test case for this, as a passing test would assert that there is a bug in the code base. Tests are usually written to assert that there are no bugs…
-
morcos commented at 1:37 pm on December 11, 2016: member@marcofalke what do you mean by that? There are certainly ways for transactions to not be accepted into the memory pool which aren’t bugs and I think it could make sense to verify that a txid is still returned.
-
MarcoFalke commented at 2:11 pm on December 11, 2016: member
@morcos What I mean is that the wallet logic should take care that a transaction is accepted to the mempool. When it is not possible, return early in the wallet logic and don’t commit the transaction to the wallet, otherwise it is a bug.
I see the return-txid patch as a temporary workaround and not a solution to the problem. So sure, you could create a unit test to check that a transaction fails ATMP but still returns true when commited, but I don’t think it makes sense to create a functional test for this. Note that the test above by sdaftuar relies on bug #9019. Another (maybe minimal) test case could rely on bug #9316. Similarly you could come up with a test that pumps the mempoolminfee above the default wallet fee rate, I assume. Of course one could argue that some of these are features and not bugs, but as long as they appear in conjunction with
-walletbroadcast
enabled, I consider them bugs. -
morcos commented at 3:51 pm on December 11, 2016: member
@MarcoFalke ah ok, yes I mostly agree. However I think that too long chains may end up being an exception to that where we want the wallet to generate and save the transaction even if its not accepted to the mempool. That’s obviously after a best efforts try to create the transaction without a too long chain.
In any case, I think we both agree nothing more needed on this PR (but release notes still needed)
-
instagibbs commented at 8:16 pm on December 12, 2016: member
-
instagibbs commented at 8:17 pm on December 12, 2016: memberutACK b3a74100b86423c553ac327f3ea6fdbc2c50890a
-
MarcoFalke assigned laanwj on Dec 12, 2016
-
paveljanik commented at 8:58 am on December 13, 2016: contributor
-
laanwj merged this on Dec 13, 2016
-
laanwj closed this on Dec 13, 2016
-
laanwj referenced this in commit b6abdc77d3 on Dec 13, 2016
-
laanwj referenced this in commit 782328660e on Dec 14, 2016
-
MarcoFalke removed the label Needs release notes on Dec 14, 2016
-
MarcoFalke referenced this in commit 8b5c2be8a0 on Dec 14, 2016
-
MarcoFalke removed the label Needs backport on Dec 14, 2016
-
MarcoFalke commented at 12:09 pm on December 14, 2016: memberBackport in #9347 (release notes already merged)
-
MarcoFalke referenced this in commit 44c342a1a1 on Dec 14, 2016
-
MarcoFalke referenced this in commit 322e48c93b on Dec 14, 2016
-
MarcoFalke referenced this in commit 1b51e7044b on Dec 14, 2016
-
MarcoFalke referenced this in commit f5d606e5ab on Dec 14, 2016
-
dexX7 referenced this in commit 2fdbc202ae on Jan 9, 2017
-
dexX7 referenced this in commit b1c266f414 on Jan 9, 2017
-
dexX7 referenced this in commit afb0c58e0b on Jan 23, 2017
-
dexX7 referenced this in commit a400d26561 on Jun 8, 2017
-
dexX7 referenced this in commit 2476c64723 on Jun 8, 2017
-
dexX7 referenced this in commit 3edbe7cc79 on Jun 8, 2017
-
codablock referenced this in commit d347d1fffe on Jan 16, 2018
-
codablock referenced this in commit 4c5a0fc74c on Jan 16, 2018
-
codablock referenced this in commit d0db70b01c on Jan 17, 2018
-
andvgal referenced this in commit 6df3f68faa on Jan 6, 2019
-
CryptoCentric referenced this in commit d247450ac5 on Feb 25, 2019
-
laanwj referenced this in commit 8a191148db on Oct 24, 2019
-
DrahtBot locked this on Sep 8, 2021
sipa
jonasschnelli
morcos
gmaxwell
luke-jr
sdaftuar
CodeShark
MarcoFalke
instagibbs
paveljanik
Milestone
0.13.2
This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-12-28 09:12 UTC
More mirrored repositories can be found on mirror.b10c.me