Page MenuHomePhabricator

[wallet] abort when attempting to fund a transaction above maxtxfee
ClosedPublic

Authored by deadalnix on May 27 2020, 14:18.

Details

Summary

FundTransaction calls GetMinimumFee which, when the fee rate is absurdly high, quietly reduced the fee to -maxtxfee. Becaue an absurdly high fee rate is usually the result of a fat finger, aborting seems safer behavior.

This is a backport of Core PR16257

Depends on D6267

Test Plan
ninja all check-all

Also run the test suite on the no wallet build

Event Timeline

[Bot Message]
One or more PR numbers were detected in the summary.
Links to those PRs have been inserted into the summary for reference.

Snippet of first build failure:

2020-05-27T14:20:39.382000Z TestFramework (INFO): Stopping nodes
2020-05-27T14:20:39.382000Z TestFramework (INFO): Cleaning up /work/build/test/tmp/test_runner_₿₵_  _20200527_142000/wallet_txn_clone_144 on exit
2020-05-27T14:20:39.382000Z TestFramework (INFO): Test skipped
[14:21:18]i:		 [Bitcoin ABC functional tests] wallet_txn_clone.py --mineblock
[14:21:18]i:			 [wallet_txn_clone.py --mineblock] Test ignored: wallet_txn_clone.py --mineblock
[14:21:18]i:		 [Bitcoin ABC functional tests] [Test Output]
2020-05-27T14:20:31.520000Z TestFramework (WARNING): Test Skipped: wallet has not been compiled.
2020-05-27T14:20:31.571000Z TestFramework (INFO): Stopping nodes
2020-05-27T14:20:31.571000Z TestFramework (INFO): Cleaning up /work/build/test/tmp/test_runner_₿₵_  _20200527_142000/wallet_txn_clone_127 on exit
2020-05-27T14:20:31.571000Z TestFramework (INFO): Test skipped
[14:21:18]i:		 [Bitcoin ABC functional tests] wallet_txn_doublespend.py
[14:21:18]i:			 [wallet_txn_doublespend.py] Test ignored: wallet_txn_doublespend.py
[14:21:18]i:		 [Bitcoin ABC functional tests] [Test Output]
2020-05-27T14:20:48.763000Z TestFramework (WARNING): Test Skipped: wallet has not been compiled.
2020-05-27T14:20:48.813000Z TestFramework (INFO): Stopping nodes
2020-05-27T14:20:48.813000Z TestFramework (INFO): Cleaning up /work/build/test/tmp/test_runner_₿₵_  _20200527_142000/wallet_txn_doublespend_176 on exit
2020-05-27T14:20:48.813000Z TestFramework (INFO): Test skipped
[14:21:18]i:		 [Bitcoin ABC functional tests] wallet_txn_doublespend.py --mineblock
[14:21:18]i:			 [wallet_txn_doublespend.py --mineblock] Test ignored: wallet_txn_doublespend.py --mineblock
[14:21:18]i:		 [Bitcoin ABC functional tests] [Test Output]
2020-05-27T14:20:31.616000Z TestFramework (WARNING): Test Skipped: wallet has not been compiled.
2020-05-27T14:20:31.666000Z TestFramework (INFO): Stopping nodes
2020-05-27T14:20:31.666000Z TestFramework (INFO): Cleaning up /work/build/test/tmp/test_runner_₿₵_  _20200527_142000/wallet_txn_doublespend_128 on exit
2020-05-27T14:20:31.666000Z TestFramework (INFO): Test skipped
[14:21:18]i:		 [Bitcoin ABC functional tests] wallet_zapwallettxes.py
[14:21:18]i:			 [wallet_zapwallettxes.py] Test ignored: wallet_zapwallettxes.py
[14:21:18]i:		 [Bitcoin ABC functional tests] [Test Output]
2020-05-27T14:20:23.231000Z TestFramework (WARNING): Test Skipped: wallet has not been compiled.
2020-05-27T14:20:23.281000Z TestFramework (INFO): Stopping nodes
2020-05-27T14:20:23.281000Z TestFramework (INFO): Cleaning up /work/build/test/tmp/test_runner_₿₵_  _20200527_142000/wallet_zapwallettxes_109 on exit
2020-05-27T14:20:23.281000Z TestFramework (INFO): Test skipped
[14:21:18]i:		 [Bitcoin ABC functional tests] interface_zmq.py
[14:21:18]i:			 [interface_zmq.py] [Test Output]
2020-05-27T14:20:15.345000Z TestFramework (INFO): Initializing test directory /work/build/test/tmp/test_runner_₿₵_  _20200527_142000/interface_zmq_103
2020-05-27T14:20:15.990000Z TestFramework (INFO): Generate 5 blocks (and 5 coinbase txes)
2020-05-27T14:21:17.069000Z TestFramework (ERROR): Unexpected exception caught during testing
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 163, in main
    self.run_test()
  File "/work/test/functional/interface_zmq.py", line 77, in run_test
    self._zmq_test()
  File "/work/test/functional/interface_zmq.py", line 93, in _zmq_test
    txid = self.hashtx.receive()
  File "/work/test/functional/interface_zmq.py", line 30, in receive
    topic, body, seq = self.socket.recv_multipart()
  File "/usr/lib/python3/dist-packages/zmq/sugar/socket.py", line 467, in recv_multipart
    parts = [self.recv(flags, copy=copy, track=track)]
  File "zmq/backend/cython/socket.pyx", line 788, in zmq.backend.cython.socket.Socket.recv
  File "zmq/backend/cython/socket.pyx", line 824, in zmq.backend.cython.socket.Socket.recv
  File "zmq/backend/cython/socket.pyx", line 191, in zmq.backend.cython.socket._recv_copy
  File "zmq/backend/cython/socket.pyx", line 186, in zmq.backend.cython.socket._recv_copy
  File "zmq/backend/cython/checkrc.pxd", line 19, in zmq.backend.cython.checkrc._check_rc
zmq.error.Again: Resource temporarily unavailable
2020-05-27T14:21:17.123000Z TestFramework (INFO): Stopping nodes
2020-05-27T14:21:17.483000Z TestFramework (WARNING): Not cleaning up dir /work/build/test/tmp/test_runner_₿₵_  _20200527_142000/interface_zmq_103
2020-05-27T14:21:17.483000Z TestFramework (ERROR): Test failed. Test logging available at /work/build/test/tmp/test_runner_₿₵_  _20200527_142000/interface_zmq_103/test_framework.log
2020-05-27T14:21:17.483000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/build/test/tmp/test_runner_₿₵_  _20200527_142000/interface_zmq_103' to consolidate all logs
[14:21:22]E:	 [Step 1/2] Failed tests detected
[14:21:22]W:	 [Step 1/2] Process exited with code 1
[14:21:22]E:	 [Step 1/2] Process exited with code 1 (Step: Command Line)

Each failure log is accessible here:
Bitcoin ABC functional tests: interface_zmq.py

Snippet of first build failure:

2020-05-27T14:25:57.148000Z TestFramework (INFO): Tests successful
[14:27:02]i:		 [Bitcoin ABC functional tests] wallet_resendwallettransactions.py
[14:27:02]i:			 [wallet_resendwallettransactions.py] [Test Output]
2020-05-27T14:26:32.773000Z TestFramework (INFO): Initializing test directory /work/build/test/tmp/test_runner_₿₵_  _20200527_142449/wallet_resendwallettransactions_491
2020-05-27T14:26:33.110000Z TestFramework (INFO): Create a new transaction and wait until it's broadcast
2020-05-27T14:26:34.324000Z TestFramework (INFO): Create a block
2020-05-27T14:26:34.390000Z TestFramework (INFO): Transaction should be rebroadcast after 30 minutes
2020-05-27T14:26:41.307000Z TestFramework (INFO): Stopping nodes
2020-05-27T14:26:41.509000Z TestFramework (INFO): Cleaning up /work/build/test/tmp/test_runner_₿₵_  _20200527_142449/wallet_resendwallettransactions_491 on exit
2020-05-27T14:26:41.509000Z TestFramework (INFO): Tests successful
[14:27:02]i:		 [Bitcoin ABC functional tests] wallet_txn_clone.py
[14:27:02]i:			 [wallet_txn_clone.py] [Test Output]
2020-05-27T14:26:43.363000Z TestFramework (INFO): Initializing test directory /work/build/test/tmp/test_runner_₿₵_  _20200527_142449/wallet_txn_clone_509
2020-05-27T14:26:45.408000Z TestFramework (INFO): Stopping nodes
2020-05-27T14:26:45.713000Z TestFramework (INFO): Cleaning up /work/build/test/tmp/test_runner_₿₵_  _20200527_142449/wallet_txn_clone_509 on exit
2020-05-27T14:26:45.713000Z TestFramework (INFO): Tests successful
[14:27:02]i:		 [Bitcoin ABC functional tests] wallet_txn_clone.py --mineblock
[14:27:02]i:			 [wallet_txn_clone.py --mineblock] [Test Output]
2020-05-27T14:26:32.844000Z TestFramework (INFO): Initializing test directory /work/build/test/tmp/test_runner_₿₵_  _20200527_142449/wallet_txn_clone_492
2020-05-27T14:26:35.876000Z TestFramework (INFO): Stopping nodes
2020-05-27T14:26:35.987000Z TestFramework (INFO): Cleaning up /work/build/test/tmp/test_runner_₿₵_  _20200527_142449/wallet_txn_clone_492 on exit
2020-05-27T14:26:35.987000Z TestFramework (INFO): Tests successful
[14:27:02]i:		 [Bitcoin ABC functional tests] wallet_txn_doublespend.py
[14:27:02]i:			 [wallet_txn_doublespend.py] [Test Output]
2020-05-27T14:26:54.115000Z TestFramework (INFO): Initializing test directory /work/build/test/tmp/test_runner_₿₵_  _20200527_142449/wallet_txn_doublespend_541
2020-05-27T14:26:55.271000Z TestFramework (INFO): Stopping nodes
2020-05-27T14:26:55.525000Z TestFramework (INFO): Cleaning up /work/build/test/tmp/test_runner_₿₵_  _20200527_142449/wallet_txn_doublespend_541 on exit
2020-05-27T14:26:55.525000Z TestFramework (INFO): Tests successful
[14:27:02]i:		 [Bitcoin ABC functional tests] wallet_txn_doublespend.py --mineblock
[14:27:02]i:			 [wallet_txn_doublespend.py --mineblock] [Test Output]
2020-05-27T14:26:34.863000Z TestFramework (INFO): Initializing test directory /work/build/test/tmp/test_runner_₿₵_  _20200527_142449/wallet_txn_doublespend_493
2020-05-27T14:26:38.083000Z TestFramework (INFO): Stopping nodes
2020-05-27T14:26:38.589000Z TestFramework (INFO): Cleaning up /work/build/test/tmp/test_runner_₿₵_  _20200527_142449/wallet_txn_doublespend_493 on exit
2020-05-27T14:26:38.589000Z TestFramework (INFO): Tests successful
[14:27:02]i:		 [Bitcoin ABC functional tests] wallet_zapwallettxes.py
[14:27:02]i:			 [wallet_zapwallettxes.py] [Test Output]
2020-05-27T14:26:20.564000Z TestFramework (INFO): Initializing test directory /work/build/test/tmp/test_runner_₿₵_  _20200527_142449/wallet_zapwallettxes_474
2020-05-27T14:26:20.936000Z TestFramework (INFO): Mining blocks...
2020-05-27T14:26:23.500000Z TestFramework (INFO): Stopping nodes
2020-05-27T14:26:23.651000Z TestFramework (INFO): Cleaning up /work/build/test/tmp/test_runner_₿₵_  _20200527_142449/wallet_zapwallettxes_474 on exit
2020-05-27T14:26:23.651000Z TestFramework (INFO): Tests successful
[14:27:02]i:		 [Bitcoin ABC functional tests] rpc_psbt.py
[14:27:02]i:			 [rpc_psbt.py] [Test Output]
2020-05-27T14:25:33.175000Z TestFramework (INFO): Initializing test directory /work/build/test/tmp/test_runner_₿₵_  _20200527_142449/rpc_psbt_447
2020-05-27T14:25:34.859000Z TestFramework (ERROR): Assertion failed
Traceback (most recent call last):
  File "/work/test/functional/test_framework/test_framework.py", line 163, in main
    self.run_test()
  File "/work/test/functional/rpc_psbt.py", line 92, in run_test
    assert_greater_than(0.06, res["fee"])
  File "/work/test/functional/test_framework/util.py", line 55, in assert_greater_than
    raise AssertionError("{} <= {}".format(str(thing1), str(thing2)))
AssertionError: 0.06 <= 0.06650000
2020-05-27T14:25:34.910000Z TestFramework (INFO): Stopping nodes
2020-05-27T14:25:35.213000Z TestFramework (WARNING): Not cleaning up dir /work/build/test/tmp/test_runner_₿₵_  _20200527_142449/rpc_psbt_447
2020-05-27T14:25:35.213000Z TestFramework (ERROR): Test failed. Test logging available at /work/build/test/tmp/test_runner_₿₵_  _20200527_142449/rpc_psbt_447/test_framework.log
2020-05-27T14:25:35.213000Z TestFramework (ERROR): Hint: Call /work/test/functional/combine_logs.py '/work/build/test/tmp/test_runner_₿₵_  _20200527_142449/rpc_psbt_447' to consolidate all logs
[14:27:04]E:	 [Step 1/2] Failed tests detected
[14:27:11]W:	 [Step 1/2] Process exited with code 1
[14:27:11]E:	 [Step 1/2] Process exited with code 1 (Step: Command Line)

Each failure log is accessible here:
Bitcoin ABC functional tests: rpc_psbt.py

Fixup fee rate in PSBT test because we account for signatures fully, while core uses segwit that account witness at 1/4th .

jasonbcox requested changes to this revision.May 27 2020, 16:21
jasonbcox added a subscriber: jasonbcox.
jasonbcox added inline comments.
doc/release-notes-0.18.1-16257.md
6 ↗(On Diff #20639)

Move to current release notes

test/functional/rpc_psbt.py
86 ↗(On Diff #20639)

should be 0.06650000 (or just remove it)

This revision now requires changes to proceed.May 27 2020, 16:21

Remove fee estimate comment

jasonbcox requested changes to this revision.May 29 2020, 21:33
jasonbcox added inline comments.
doc/release-notes.md
13 ↗(On Diff #20719)

BTC -> BCH

This revision now requires changes to proceed.May 29 2020, 21:33
This revision is now accepted and ready to land.May 29 2020, 21:51