Skip to content

amount: use Kani to prove some arithmetic properties#1415

Merged
apoelstra merged 2 commits intorust-bitcoin:masterfrom
apoelstra:2022-11--kani
Nov 28, 2022
Merged

amount: use Kani to prove some arithmetic properties#1415
apoelstra merged 2 commits intorust-bitcoin:masterfrom
apoelstra:2022-11--kani

Conversation

@apoelstra
Copy link
Copy Markdown
Member

A first exploration into using Kani. See #1370.

Kani can't really handle string processing, and appears to be unable
to check integer multiplication (for now), but we do several checks
for addition and subtraction, and conversion between signedness,
that Kani can easily prove.
Copy link
Copy Markdown
Collaborator

@Kixunil Kixunil left a comment

Choose a reason for hiding this comment

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

Awesome first step!

ACK d4bfc3d

Copy link
Copy Markdown
Member

@tcharding tcharding left a comment

Choose a reason for hiding this comment

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

ACK d4bfc3d

@tcharding
Copy link
Copy Markdown
Member

This is totally new to me but looks like a step forward. Whats the next step, more kani tests for other modules? Do we keep the fuzzing we have or is the idea to move to Bolero (which I also no nothing about)?

@apoelstra
Copy link
Copy Markdown
Member Author

This is totally new to me but looks like a step forward. Whats the next step, more kani tests for other modules?

Yep.

Do we keep the fuzzing we have or is the idea to move to Bolero (which I also no nothing about)?

We'll keep the fuzzing we have. The benefit of Bolero is that it lets us switch fuzz backends, which we don't really need, including to use a Kani backend, which I don't think really makes sense. (Fuzzers are good at open-ended search of strings and stuff, which is what Kani is horrible at.)

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants