Skip to content

bitcoin: update CompactSize Kani proofs#5955

Merged
apoelstra merged 1 commit into
rust-bitcoin:masterfrom
i-a-m-d:fix-compactsize-kani-proofs
Apr 9, 2026
Merged

bitcoin: update CompactSize Kani proofs#5955
apoelstra merged 1 commit into
rust-bitcoin:masterfrom
i-a-m-d:fix-compactsize-kani-proofs

Conversation

@i-a-m-d

@i-a-m-d i-a-m-d commented Apr 4, 2026

Copy link
Copy Markdown
Contributor

There were 2 existing Kani proofs, checking a CompactSize serialization/deserialization roundtrip for all u32 values and u64 values greater than 0xffffffff.

These proofs no longer succeeded after #5697 implemented a range-check on CompactSize deserialization.

This PR updates the proofs such that a roundtrip is tested for all values in the enforced range, and values outside that range are rejected with ParseError::OversizedCompactSize.

Closes #5954

@github-actions github-actions Bot added the C-bitcoin PRs modifying the bitcoin crate label Apr 4, 2026

@tcharding tcharding left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 11bb6a8

@tcharding

Copy link
Copy Markdown
Member

Great! Thanks mate.

@apoelstra apoelstra left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ACK 11bb6a8; successfully ran local tests; nice! We will try to be more conscientious about the Kani tests in future..

@apoelstra apoelstra merged commit ca0c0cc into rust-bitcoin:master Apr 9, 2026
27 checks passed
@i-a-m-d

i-a-m-d commented Apr 9, 2026

Copy link
Copy Markdown
Contributor Author

#5978 might help with that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

C-bitcoin PRs modifying the bitcoin crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Kani CI failing since adding range-check to CompactSize deserialization

4 participants