Skip to content

Commit a9e3385

Browse files
authored
Upgrade Certora CLI and Prover to v7.6.3 on the CI (#761)
Changelog is available here: https://docs.certora.com/en/latest/docs/prover/changelog/prover_changelog.html#may-15-2024 I also fixed the `verifyNativeTokenRefund` ruleset not using the configuration file.
1 parent f830466 commit a9e3385

File tree

9 files changed

+19
-23
lines changed

9 files changed

+19
-23
lines changed

.github/workflows/certora.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
with: { java-version: "17", java-package: jre, distribution: semeru }
3030

3131
- name: Install certora cli
32-
run: pip install -Iv certora-cli==6.3.1
32+
run: pip install -Iv certora-cli==7.6.3
3333

3434
- name: Install solc
3535
run: |

certora/conf/nativeTokenRefund.conf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77
"msg": "Safe Native Token Refund",
88
"optimistic_hashing": true,
99
"optimistic_loop": true,
10+
"optimistic_fallback": true,
1011
"process": "emv",
1112
"prover_args": [
12-
" -optimisticFallback true -mediumTimeout 30"
13+
"-mediumTimeout 30"
1314
],
1415
"rule_sanity": "basic",
1516
"solc": "solc7.6",

certora/conf/run.conf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77
"msg": "Safe Mutation",
88
"optimistic_hashing": true,
99
"optimistic_loop": true,
10+
"optimistic_fallback": true,
1011
"process": "emv",
1112
"prover_args": [
12-
" -optimisticFallback true -s z3 -copyLoopUnroll 5 -mediumTimeout 5 -depth 30"
13+
"-s z3 -copyLoopUnroll 5 -mediumTimeout 5 -depth 30"
1314
],
1415
"rule_sanity": "basic",
1516
"run_source": "MUTATION",

certora/conf/safe.conf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77
"msg": "Safe General Ruleset",
88
"optimistic_hashing": true,
99
"optimistic_loop": true,
10+
"optimistic_fallback": true,
1011
"process": "emv",
1112
"prover_args": [
12-
" -optimisticFallback true -s z3 -copyLoopUnroll 5 -mediumTimeout 5 -depth 30"
13+
"-s z3 -copyLoopUnroll 5 -mediumTimeout 5 -depth 30"
1314
],
1415
"rule_sanity": "basic",
1516
"solc": "solc7.6",

certora/conf/signatures.conf

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,10 @@
77
"msg": "Safe Signatures Rules",
88
"optimistic_hashing": true,
99
"optimistic_loop": true,
10+
"optimistic_fallback": true,
1011
"process": "emv",
1112
"prover_args": [
12-
"-optimisticFallback true -mediumTimeout 30"
13+
"-mediumTimeout 30"
1314
],
1415
"rule_sanity": "basic",
1516
"solc": "solc7.6",

certora/scripts/verifyNativeTokenRefund.sh

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,6 @@ if [[ -n "$CI" ]]; then
66
params=()
77
fi
88

9-
certoraRun certora/harnesses/SafeHarness.sol \
10-
--verify SafeHarness:certora/specs/NativeTokenRefund.spec \
11-
--solc solc7.6 \
12-
--optimistic_loop \
13-
--prover_args '-optimisticFallback true -s z3' \
14-
--loop_iter 3 \
15-
--optimistic_hashing \
16-
--hashing_length_bound 352 \
17-
--rule_sanity \
9+
certoraRun certora/conf/nativeTokenRefund.conf \
1810
"${params[@]}" \
1911
--msg "Safe $1 "

certora/specs/ModuleReach.spec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ definition updateSucc(address a, address b) returns bool = forall address X. for
157157
// hook to update the ghostModules and the reach ghost state whenever the modules field
158158
// in storage is written.
159159
// This also checks that the reach_succ invariant is preserved.
160-
hook Sstore currentContract.modules[KEY address key] address value STORAGE {
160+
hook Sstore currentContract.modules[KEY address key] address value {
161161
address valueOrNull;
162162
address someKey;
163163
require reach_succ(someKey, ghostModules[someKey]);
@@ -171,7 +171,7 @@ hook Sstore currentContract.modules[KEY address key] address value STORAGE {
171171

172172
// Hook to match ghost state and storage state when reading modules from storage.
173173
// This also provides the reach_succ invariant.
174-
hook Sload address value currentContract.modules[KEY address key] STORAGE {
174+
hook Sload address value currentContract.modules[KEY address key] {
175175
require ghostModules[key] == value;
176176
require reach_succ(key, value);
177177
}

certora/specs/OwnerReach.spec

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ definition updateGhostSuccCount(address key, mathint diff) returns bool = forall
202202
// hook to update the ghostOwners and the reach ghost state whenever the owners field
203203
// in storage is written.
204204
// This also checks that the reach_succ invariant is preserved.
205-
hook Sstore currentContract.owners[KEY address key] address value STORAGE {
205+
hook Sstore currentContract.owners[KEY address key] address value {
206206
address valueOrNull;
207207
address someKey;
208208
require reach_succ(someKey, ghostOwners[someKey]);
@@ -216,19 +216,19 @@ hook Sstore currentContract.owners[KEY address key] address value STORAGE {
216216
assert ghostSuccCount(someKey) == count_expected(someKey);
217217
}
218218

219-
hook Sstore currentContract.ownerCount uint256 value STORAGE {
219+
hook Sstore currentContract.ownerCount uint256 value {
220220
ghostOwnerCount = value;
221221
}
222222

223223
// Hook to match ghost state and storage state when reading owners from storage.
224224
// This also provides the reach_succ invariant.
225-
hook Sload address value currentContract.owners[KEY address key] STORAGE {
225+
hook Sload address value currentContract.owners[KEY address key] {
226226
require ghostOwners[key] == value;
227227
require reach_succ(key, value);
228228
require ghostSuccCount(key) == count_expected(key);
229229
}
230230

231-
hook Sload uint256 value currentContract.ownerCount STORAGE {
231+
hook Sload uint256 value currentContract.ownerCount {
232232
// The prover found a counterexample if the owners count is max uint256,
233233
// but this is not a realistic scenario.
234234
require ghostOwnerCount < MAX_UINT256();

certora/specs/Safe.spec

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,14 +54,14 @@ persistent ghost address ghostSingletonAddress {
5454
init_state axiom ghostSingletonAddress == 0;
5555
}
5656
57-
hook Sstore SafeHarness.(slot 0) address newSingletonAddress STORAGE {
57+
hook Sstore SafeHarness.(slot 0) address newSingletonAddress {
5858
ghostSingletonAddress = newSingletonAddress;
5959
}
6060
6161
// This is EIP-1967's singleton storage slot:
6262
// 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc
6363
// converted to decimal because certora doesn't seem to support hex yet.
64-
hook Sstore SafeHarness.(slot 24440054405305269366569402256811496959409073762505157381672968839269610695612) address newSingletonAddress STORAGE {
64+
hook Sstore SafeHarness.(slot 24440054405305269366569402256811496959409073762505157381672968839269610695612) address newSingletonAddress {
6565
ghostSingletonAddress = newSingletonAddress;
6666
}
6767
@@ -76,7 +76,7 @@ persistent ghost address fallbackHandlerAddress {
7676
// This is Safe's fallback handler storage slot:
7777
// 0x6c9a6c4a39284e37ed1cf53d337577d14212a4870fb976a4366c693b939918d5
7878
// converted to decimal because certora doesn't seem to support hex yet.
79-
hook Sstore SafeHarness.(slot 49122629484629529244014240937346711770925847994644146912111677022347558721749) address newFallbackHandlerAddress STORAGE {
79+
hook Sstore SafeHarness.(slot 49122629484629529244014240937346711770925847994644146912111677022347558721749) address newFallbackHandlerAddress {
8080
fallbackHandlerAddress = newFallbackHandlerAddress;
8181
}
8282

0 commit comments

Comments
 (0)