1/5
--- ### Formal Verification: The Naive Approach When approaching formal verification, it’s essential to start by employing a naive method before exploring more sophisticated tools. The first step typically involves basic fuzz testing to determine the robustness of the function under scrutiny. #### Exploring the Basics with Halmos In this scenario, the Halmos function is used to illustrate the initial verification steps. Upon pasting the function into the verification tool, we encounter several 'Unknown' results, indicating that the paths have not been fully explored. This is primarily due to a loop unrolling bound of two. #### Understanding Loop Unrolling Bound The core of the issue lies in the function's while loop. When the variable `y` is significantly large, the loop executes numerous iterations. The loop unrolling bound, set to a default of two, restricts the depth of exploration, which in turn hampers the tool’s ability to fully analyze the function. To mitigate this, the loop unrolling bound is increased drastically (e.g., to 1000) to enhance the thoroughness of the test. #### Encountering the Path Explosion Problem Upon re-running the test with an increased loop unrolling bound, it becomes evident that this approach is impractical for extensive loops. The function execution becomes exceedingly long, potentially infinite, highlighting a significant issue known as the path explosion problem. This occurs when the function contains an overwhelming number of possible execution paths or symbolic variables, making it computationally challenging to explore all paths fully.
A naive approach to formal verification with Halmos - The video goes over how to use Halmos and how naive formal verification can be. Halmos is a tool that is used to formally verify solidity code.
Previous lesson
Previous
Next lesson
Next
Give us feedback
Course Overview
About the course
Assembly
Writing smart contracts using Huff and Yul
Ethereum Virtual Machine OPCodes
Formal verification testing
Smart contract invariant testing
Halmos, Certora, Kontrol
Security researcher
$49,999 - $120,000 (avg. salary)
Smart Contract Auditor
$100,000 - $200,000 (avg. salary)
Guest lecturers:
Josselin Feist
Head of Blockchain at Trail of Bits
Last updated on January 17, 2025
Solidity Developer
Assembly and Formal VerificationDuration: 30min
Duration: 4h 38min
Duration: 3h 57min
Duration: 1h 56min
Course Overview
About the course
Assembly
Writing smart contracts using Huff and Yul
Ethereum Virtual Machine OPCodes
Formal verification testing
Smart contract invariant testing
Halmos, Certora, Kontrol
Security researcher
$49,999 - $120,000 (avg. salary)
Smart Contract Auditor
$100,000 - $200,000 (avg. salary)
Guest lecturers:
Josselin Feist
Head of Blockchain at Trail of Bits
Last updated on January 17, 2025
Testimonials
Read what our students have to say about this course.
Chainlink
Chainlink
Gustavo Gonzalez
Solutions Engineer at OpenZeppelin
Francesco Andreoli
Lead Devrel at Metamask
Albert Hu
DeForm Founding Engineer
Radek
Senior Developer Advocate at Ceramic
Boidushya
WalletConnect
Idris
Developer Relations Engineer at Axelar