failure in feature_bip68_sequence.py #27129

issue fanquake openend this issue on February 20, 2023
  1. fanquake commented at 4:32 pm on February 20, 2023: member

    https://cirrus-ci.com/task/5552802257174528?logs=ci#L3998

     0 node0 2023-02-16T16:55:28.505405Z [httpworker.3] [rpc/request.cpp:179] [parse] [rpc] ThreadRPCServer method=sendrawtransaction user=__cookie__ 
     1 node0 2023-02-16T16:55:28.506156Z [httpworker.3] [txmempool.cpp:644] [check] [mempool] Checking mempool with 58 transactions and 123 inputs 
     2 test  2023-02-16T16:55:28.513000Z TestFramework (ERROR): JSONRPC error 
     3                                   Traceback (most recent call last):
     4                                     File "/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/test_framework/test_framework.py", line 134, in main
     5                                       self.run_test()
     6                                     File "/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/feature_bip68_sequence.py", line 73, in run_test
     7                                       self.test_sequence_lock_unconfirmed_inputs()
     8                                     File "/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/feature_bip68_sequence.py", line 225, in test_sequence_lock_unconfirmed_inputs
     9                                       tx1 = self.wallet.send_self_transfer(from_node=self.nodes[0])["tx"]
    10                                     File "/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/test_framework/wallet.py", line 249, in send_self_transfer
    11                                       self.sendrawtransaction(from_node=from_node, tx_hex=tx['hex'])
    12                                     File "/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/test_framework/wallet.py", line 356, in sendrawtransaction
    13                                       txid = from_node.sendrawtransaction(hexstring=tx_hex, maxfeerate=maxfeerate, **kwargs)
    14                                     File "/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/test_framework/coverage.py", line 49, in __call__
    15                                       return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
    16                                     File "/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/test_framework/authproxy.py", line 146, in __call__
    17                                       raise JSONRPCException(response['error'], status)
    18                                   test_framework.authproxy.JSONRPCException: bad-txns-premature-spend-of-coinbase, tried to spend coinbase at depth 7 (-26)
    19 test  2023-02-16T16:55:28.514000Z TestFramework (DEBUG): Closing down network thread 
    20 test  2023-02-16T16:55:28.564000Z TestFramework (INFO): Stopping nodes 
    21 test  2023-02-16T16:55:28.564000Z TestFramework.node0 (DEBUG): Stopping node 
    
  2. fanquake added the label Bug on Feb 20, 2023
  3. maflcko commented at 4:42 pm on February 20, 2023: member
    Maybe due to the miniwallet change?
  4. brunoerg commented at 7:19 pm on February 27, 2023: contributor

    @MarcoFalke I think so, because send_self_transfer will call create_self_transfer which will call get_utxo (since we’re not specifying it). get_utxo will return the largest utxo and it’s usually the coinbase one (50). However, coinbase transactions need 100 confs and get_utxo doesn’t check it what may be causing a “bad-txns-premature-spend-of-coinbase” error.

    perhaps a fix:

     0diff --git a/test/functional/feature_bip68_sequence.py b/test/functional/feature_bip68_sequence.py
     1index 894afffc7..b248f2f5a 100755
     2--- a/test/functional/feature_bip68_sequence.py
     3+++ b/test/functional/feature_bip68_sequence.py
     4@@ -222,7 +222,8 @@ class BIP68Test(BitcoinTestFramework):
     5 
     6         # Create a mempool tx.
     7         self.wallet.rescan_utxos()
     8-        tx1 = self.wallet.send_self_transfer(from_node=self.nodes[0])["tx"]
     9+        utxo = utxo = self.wallet.get_utxos(include_immature_coinbase=False)[0]
    10+        tx1 = self.wallet.send_self_transfer(from_node=self.nodes[0], utxo_to_spend=utxo)["tx"]
    11         tx1.rehash()
    12 
    13         # Anyone-can-spend mempool tx.
    
  5. achow101 closed this on May 23, 2023

  6. BlackcoinDev referenced this in commit 3132ec64d9 on Feb 5, 2024
  7. bitcoin locked this on May 22, 2024

github-metadata-mirror

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-06-29 07:13 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me