Skip to content

Fix BIP113 MTP CLTV validation fixture and un-ignore test - #15

Merged
secsovereign merged 1 commit into
mainfrom
fix/bip113-mtp-cltv-validation-logic
Sep 21, 2026
Merged

secsovereign merged 1 commit into
mainfrom
fix/bip113-mtp-cltv-validation-logic

Conversation

@secsovereign

Copy link
Copy Markdown
Member

Summary

  • The #[ignore] on test_median_time_past_cltv_validation_logic was stale: it blamed pending validate_with_context MTP wiring, but the body never calls that API — only get_test_median_time_past.
  • Under --ignored, the assert failed because MTP equals required_locktime: for 11 timestamps base + i*600, mid-index MTP is T[5] = base+3000, and the fixture set required_locktime = base+3000.
  • Raise required_locktime to base+3600 so the intended unsatisfied CLTV case (median < required_locktime) holds; assert MTP equality explicitly and document mid-index behavior; drop #[ignore] and rewrite the comment.

Numbers

Old New
base_time 1609459200 1609459200
MTP (mid-index) 1609462200 (base+3000) 1609462200 (base+3000)
required_locktime 1609462200 (base+3000) 1609462800 (base+3600)

Test plan

  • cargo fmt / cargo fmt --check
  • CARGO_INCREMENTAL=0 cargo check (path patch aside)
  • cargo test --test engineering_suite engineering::bip113_integration_tests::test_median_time_past_cltv_validation_logic -- --exact → ok (no --ignored)
  • Did not touch the secondary mixed segwit/taproot ignore
  • No PARTIAL_BASELINE bump, no merge, no publish

The ignore blamed pending validate_with_context MTP wiring, but the test
only calls get_test_median_time_past. required_locktime was base+3000,
equal to mid-index MTP, so the strict < assert failed under --ignored.
Raise required_locktime to base+3600 and document the mid-index MTP.
@secsovereign
secsovereign merged commit 3a409df into main Sep 21, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant