Skip to content

feat(operators): add GetBlockTime->MTP swap and int64_t narrowing - #59

Merged
brunoerg merged 1 commit into
mainfrom
2026-09-operator-mtp-narrowing
Sep 14, 2026
Merged

brunoerg merged 1 commit into
mainfrom
2026-09-operator-mtp-narrowing

Conversation

@brunoerg

Copy link
Copy Markdown
Owner

Add two mutation operators:

  • Bitcoin Core only: replace GetBlockTime() with GetMedianTimePast(). Both live on CBlockIndex and return int64_t, but MTP lags the header timestamp, so locktime/timeout checks that pick the wrong clock are only caught by tests around that boundary.

  • Generic: replace int64_t with uint32_t. Silently truncates values above 2^32 and turns negatives into large positives, so a mutant only dies when a test exercises the wide or signed range. Added to common and mirrored in the Bitcoin Core set, which keeps its own list.

Add two mutation operators:

- Bitcoin Core only: replace `GetBlockTime()` with `GetMedianTimePast()`.
  Both live on CBlockIndex and return int64_t, but MTP lags the header
  timestamp, so locktime/timeout checks that pick the wrong clock are only
  caught by tests around that boundary.

- Generic: replace `int64_t` with `uint32_t`. Silently truncates values
  above 2^32 and turns negatives into large positives, so a mutant only
  dies when a test exercises the wide or signed range. Added to `common`
  and mirrored in the Bitcoin Core set, which keeps its own list.
@brunoerg
brunoerg merged commit 30cf71f into main Sep 14, 2026
1 check passed
@brunoerg
brunoerg deleted the 2026-09-operator-mtp-narrowing branch September 14, 2026 15:50
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