-
Notifications
You must be signed in to change notification settings - Fork 25
added Ranger repo #395
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
added Ranger repo #395
Changes from 20 commits
fba3aae
9bb35c8
9879092
2247e56
2e139a0
bcfcbd2
821c409
41a7e8b
6cd89a5
f21b182
4056511
669da9b
4af3d41
fb12791
dafa026
28ff991
1b686eb
c7a4b6e
03f3c08
22e5da9
6f1bcfd
bdef21d
834dcd9
4be35a0
d7d4c2a
eaed893
c937873
48de033
860d84e
22967ae
ab2f870
0f5f5b4
8f4a1ca
1a388e9
5c0cf4b
8f41e0e
b7ff08e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| # How Ranger Works | ||
|
|
||
| Bounded search and depth (--bmc) | ||
|
|
||
| Initial state selection (constructor vs custom) | ||
|
|
||
| Built-in underapproximations (and how to override them) |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| (ranger-intro)= | ||
| Ranger | ||
| ====== | ||
|
|
||
| Text | ||
|
|
||
| ```{toctree} | ||
| :maxdepth: 2 | ||
|
|
||
| ranger_intro.md | ||
| starting_with_ranger.md | ||
| how_ranger_works.md | ||
| ranger_client.md | ||
| ``` | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,9 @@ | ||
| # The Ranger Client | ||
|
|
||
| # Usage: certoraRanger | ||
|
|
||
| # Ranger-specific flags | ||
|
|
||
| # Unsupported Prover flags | ||
|
|
||
| # Config file compatibility |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| # Introduction | ||
|
|
||
| **Ranger** is Certora’s bounded model checker for smart contracts. It complements formal verification by offering a lightweight, developer-friendly approach for quickly identifying violations of contract invariants. | ||
|
|
||
| Unlike the [Certora Prover](/docs/user-guide/index), which explores all program states, Ranger starts from a specific initial state and explores all function call sequences up to a bounded depth. This ensures that every violation corresponds to a realistic execution path, removing the need to filter out spurious counterexamples. | ||
|
|
||
| --- | ||
|
|
||
| ## Why Ranger? | ||
|
|
||
| Formal Verification provides strong correctness guarantees and checks more program states, but it can be slow, complex, and prone to false positives from unreachable states. {term}`fuzzing`, on the other hand, is faster, but has a lower coverage as it only checks for specific inputs per run. | ||
|
|
||
| Ranger offers a practical middle ground: | ||
|
|
||
| - ✅ **Realistic counterexamples**: All violations are reachable from the initial state. | ||
| - ✅ **Faster time to value**: Minimal setup required to get useful results. | ||
| - ✅ **Fewer false positives**: No need to precondition rules to filter out invalid states. | ||
| - ✅ **High coverage**: Symbolically tests all function call sequences from the initial state up to a certain range. | ||
|
|
||
| --- | ||
|
|
||
| ## Scope and Limitations | ||
|
|
||
| Ranger is in active development and currently supports only Solidity contracts. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| # Getting Started | ||
|
|
||
| This guide will help you run your first Ranger job using a Solidity contract and a [CVL](/docs/cvl/index) [invariant](/docs/cvl/invariants). | ||
|
|
||
| Ranger uses the same installation process, configuration files, and spec files as the [Certora Prover](/docs/user-guide/index). If you're already familiar with the Prover, getting started with Ranger will feel familiar. | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That Ranger uses CVL could be stated also
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
|
|
||
| --- | ||
|
|
||
| ## 1. Install Certora Tools | ||
|
|
||
| Ranger is part of the `certora` Python package. You can install or upgrade it using `pip`: | ||
|
|
||
| ```bash | ||
| pip install certora-cli | ||
| ``` | ||
| For full installation instructions and troubleshooting, see the Certora Prover [installation guide](/docs/user-guide/install). | ||
|
|
||
| ## 2. Prepare Your Files | ||
| You'll need three files: | ||
|
|
||
| - A compiled Solidity contract (e.g. `MyContract.sol`) | ||
| - A CVL spec file with at least one invariant (e.g. `MyContract.spec`) | ||
| - A configuration file (e.g. `ranger.conf`) | ||
|
|
||
| Example `ranger.conf`: | ||
|
|
||
| ```json | ||
| { | ||
| "files": ["MyContract.sol"], | ||
| "verify": "MyContract:MyContract.spec" | ||
| } | ||
| ``` | ||
|
|
||
| ## 3. Run Ranger | ||
| Use the certoraRanger command to launch the job: | ||
|
|
||
| ```bash | ||
| certoraRanger ranger.conf | ||
| ``` | ||
|
|
||
| This will start the Ranger process. A link to the Ranger Job Report in the dashboard will be pasted into your command line when the job is submitted. | ||
|
Comment on lines
+34
to
+41
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do we want to mention somewhere that ranger runs lots of processes/is compute intensive and suggest that users use it with
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've added a new warning with this info. IDK if it fits a warning or an info message |
||
|
|
||
| ```{warning} | ||
| Ranger is compute-intensive: It performs symbolic exploration of many function call sequences. For faster feedback, avoiding timeouts, and better resource usage, consider one of the following: | ||
|
|
||
| 1. Use {ref}`--rule` to focus on a single invariant or rule. | ||
|
|
||
| 2. Use {ref}`--split_rules` to automatically run each rule/invariant in a separate job. | ||
| ``` | ||
|
|
||
|
|
||
| ## 4. View the Results | ||
| A link to the Ranger Job Report in the dashboard will be pasted in your command line | ||
| when the job is submitted. | ||
| You can explore the results in the web-based Ranger Report by following the link. | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -11,6 +11,7 @@ Contents | |||||
| * :doc:`docs/sunbeam/index` -- instructions for installing and using *Certora Sunbeam* | ||||||
| for formal verification of `Soroban`_ contracts. | ||||||
| * :doc:`docs/solana/index` -- instructions for installing and using *Certora Solana Prover* | ||||||
| * :doc:`docs/ranger/index` -- TODO | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Good catch! |
||||||
| * :doc:`docs/gambit/index` -- use mutation testing to improve you specifications. | ||||||
|
|
||||||
| .. toctree:: | ||||||
|
|
@@ -23,6 +24,7 @@ Contents | |||||
| docs/prover/index.md | ||||||
| docs/sunbeam/index.rst | ||||||
| docs/solana/index.rst | ||||||
| docs/ranger/index.md | ||||||
| docs/gambit/index.md | ||||||
|
|
||||||
|
|
||||||
|
|
||||||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd rephrase this slightly.