test: Fix list index out of range error in feature_bip68_sequence.py #32765

pull zaidmstrr wants to merge 1 commits into bitcoin:master from zaidmstrr:test-feature-bip68-fix changing 1 files +3 −1
  1. zaidmstrr commented at 4:09 pm on June 17, 2025: contributor

    Fixes #32334

    The test feature_bip68_sequence.py fails with IndexError: list index out of range error due to a mismatch between the number of inputs requested (at random) and the number of UTXOs available. The error is reproducible with the randomseed:

    0$ ./build/test/functional/feature_bip68_sequence.py --randomseed 6169832640268785903 
    

    This PR adds a valid upper bound to randomly select the inputs.

  2. test: Fix list index out of range error in feature_bip68_sequence.py e285e691b7
  3. DrahtBot commented at 4:09 pm on June 17, 2025: contributor

    The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

    Code Coverage & Benchmarks

    For details see: https://corecheck.dev/bitcoin/bitcoin/pulls/32765.

    Reviews

    See the guideline for information on the review process.

    Type Reviewers
    ACK maflcko, Prabhat1308, theStack

    If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

  4. DrahtBot added the label Tests on Jun 17, 2025
  5. Prabhat1308 commented at 5:46 pm on June 17, 2025: contributor

    Approach ACK

    The tests passes even with the original suggestion from the issue here , I wonder why you did not go with that ?

    Although I see no issues with the current approach

    UPD: The test did run noticably slower with the original suggestion

  6. in test/functional/feature_bip68_sequence.py:149 in e285e691b7
    143@@ -144,8 +144,10 @@ def test_sequence_lock_confirmed_inputs(self):
    144         # between height/time locking). Small random chance of making the locks
    145         # all pass.
    146         for _ in range(400):
    147+            available_utxos = len(utxos)
    148+
    149             # Randomly choose up to 10 inputs
    


    Prabhat1308 commented at 5:50 pm on June 17, 2025:

    This comment should be changed along the line “randomly choose upto minimum of 10 and available_utxo inputs here " now since its also bounded by the size of available_utxos

    Technically the statement still stands so no need to change


    zaidmstrr commented at 6:01 pm on June 17, 2025:
    Yes, still the maximum bound is 10.
  7. zaidmstrr commented at 6:12 pm on June 17, 2025: contributor

    The tests passes even with the original suggestion from the issue here , I wonder why you did not go with that ?

    The approach suggested here is resource inefficient compared to this. You need to create 4000 UTXOs which is 20x more than the current implementation.

  8. maflcko commented at 6:41 pm on June 17, 2025: member
    lgtm ACK e285e691b7a311e278f89e9fe423716de1ee268b
  9. DrahtBot requested review from Prabhat1308 on Jun 17, 2025
  10. Prabhat1308 commented at 9:25 am on June 18, 2025: contributor
    re-ACK e285e69
  11. theStack approved
  12. theStack commented at 10:44 pm on June 18, 2025: contributor

    ACK e285e691b7a311e278f89e9fe423716de1ee268b

    Thanks for fixing!

  13. fanquake merged this on Jun 19, 2025
  14. fanquake closed this on Jun 19, 2025

  15. fanquake referenced this in commit 4c7ed36c96 on Jun 19, 2025
  16. fanquake commented at 2:07 pm on June 19, 2025: member
    Backported to 29.x in #32589.

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: 2025-07-01 00:12 UTC

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