failure in feature_bip68_sequence.py #27129

issue fanquake opened 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

     node0 2023-02-16T16:55:28.505405Z [httpworker.3] [rpc/request.cpp:179] [parse] [rpc] ThreadRPCServer method=sendrawtransaction user=__cookie__ 
     node0 2023-02-16T16:55:28.506156Z [httpworker.3] [txmempool.cpp:644] [check] [mempool] Checking mempool with 58 transactions and 123 inputs 
     test  2023-02-16T16:55:28.513000Z TestFramework (ERROR): JSONRPC error 
                                       Traceback (most recent call last):
                                         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
                                           self.run_test()
                                         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
                                           self.test_sequence_lock_unconfirmed_inputs()
                                         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
                                           tx1 = self.wallet.send_self_transfer(from_node=self.nodes[0])["tx"]
                                         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
                                           self.sendrawtransaction(from_node=from_node, tx_hex=tx['hex'])
                                         File "/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/test_framework/wallet.py", line 356, in sendrawtransaction
                                           txid = from_node.sendrawtransaction(hexstring=tx_hex, maxfeerate=maxfeerate, **kwargs)
                                         File "/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/test_framework/coverage.py", line 49, in __call__
                                           return_val = self.auth_service_proxy_instance.__call__(*args, **kwargs)
                                         File "/tmp/cirrus-ci-build/ci/scratch/build/bitcoin-x86_64-pc-linux-gnu/test/functional/test_framework/authproxy.py", line 146, in __call__
                                           raise JSONRPCException(response['error'], status)
                                       test_framework.authproxy.JSONRPCException: bad-txns-premature-spend-of-coinbase, tried to spend coinbase at depth 7 (-26)
     test  2023-02-16T16:55:28.514000Z TestFramework (DEBUG): Closing down network thread 
     test  2023-02-16T16:55:28.564000Z TestFramework (INFO): Stopping nodes 
     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:

    diff --git a/test/functional/feature_bip68_sequence.py b/test/functional/feature_bip68_sequence.py
    index 894afffc7..b248f2f5a 100755
    --- a/test/functional/feature_bip68_sequence.py
    +++ b/test/functional/feature_bip68_sequence.py
    @@ -222,7 +222,8 @@ class BIP68Test(BitcoinTestFramework):
     
             # Create a mempool tx.
             self.wallet.rescan_utxos()
    -        tx1 = self.wallet.send_self_transfer(from_node=self.nodes[0])["tx"]
    +        utxo = utxo = self.wallet.get_utxos(include_immature_coinbase=False)[0]
    +        tx1 = self.wallet.send_self_transfer(from_node=self.nodes[0], utxo_to_spend=utxo)["tx"]
             tx1.rehash()
     
             # 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: 2026-05-03 15:13 UTC

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