Skip to content
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

Certora specs #696

Closed
wants to merge 88 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
88 commits
Select commit Hold shift + click to select a range
f65a310
chore: clean up EigenPod file
wadealexc Apr 15, 2024
9f574e3
feat: poc for partial withdrawal batching
wadealexc Apr 16, 2024
f74477e
feat: adjust verifyStaleBalance to allow anyone to start a checkpoint
wadealexc Apr 23, 2024
cdcb714
chore: rename lastFinalizedCheckpoint to lastCheckpointTimestamp
wadealexc Apr 24, 2024
c9d0a57
feat: remove unnecessary state root caching and add ValidatorWithdraw…
wadealexc Apr 25, 2024
a768951
feat: remove all use of the delayed withdrawal router (#524)
wadealexc Apr 25, 2024
864b81a
feat: remove staleness grace period
wadealexc Apr 29, 2024
fd76524
feat: add flag to startCheckpoint to prevent 0-balance checkpoints
wadealexc Apr 29, 2024
27c29c8
chore: move currentCheckpoint to a public getter and update IEigenPod…
wadealexc Apr 29, 2024
f934bc0
feat: skip validator if already checkpointed
wadealexc May 15, 2024
21a58f7
fix: swap inequality check to correctly skip duplicate proofs
wadealexc May 21, 2024
3a7ff2a
test: modify integration test framework to support pepe (#563)
wadealexc May 29, 2024
312534a
feat: checkpoint proofs use balance container root
wadealexc May 30, 2024
0c8763e
chore: remove delayedWithdrawalRouter from EigenPod
wadealexc May 31, 2024
04a9802
feat: adjust storage sizes for fields in checkpoint struct
wadealexc May 31, 2024
42b3399
feat: remove activateRestaking in favor of startCheckpoint (#577)
wadealexc Jun 3, 2024
20297ce
test: add proofgen test contract
gpsanant Jun 3, 2024
e97fcf3
feat: track balance exited for checkpoints
wadealexc Jun 4, 2024
6bf1b1a
chore: deprecate deneb fork timestamp functions in EigenPodManager
wadealexc Jun 4, 2024
5d02d90
test: fix existing integration tests
wadealexc Jun 4, 2024
8a69af4
fix: fixes two issues with verifyWC timing
wadealexc Jun 6, 2024
d2d4ea8
test: fleshed out eigenpod test flows
wadealexc Jun 7, 2024
20189e4
fix: add additional pause condition for verifyStaleBalance
wadealexc Jun 14, 2024
87760bf
docs: add initial EigenPod docs
wadealexc Jun 18, 2024
f0e2b9c
chore: fix gas metering test to be consistent
wadealexc Jun 19, 2024
571cb3d
test: eigenpod unit tests with checkpointing (#591)
8sunyuan Jun 21, 2024
35be765
chore: cleanup dwr and unused code (#593)
8sunyuan Jun 21, 2024
b8be488
feat: remove staleness timing window
wadealexc Jun 21, 2024
cb9d774
chore: fix bindings
wadealexc Jun 21, 2024
b333d9b
test: finish verify start complete flow for pepe integration tests
wadealexc Jun 24, 2024
eb6eef2
test: add slashing and native eth integration tests
wadealexc Jun 24, 2024
a190a01
build: partial withdrawal batching upgrade scripts (#598)
8sunyuan Jun 25, 2024
64b0d0a
chore: add pepe deployment output
wadealexc Jun 25, 2024
4bfc599
docs: finish main eigenpod docs and improve commenting
wadealexc Jun 25, 2024
44115a7
feat: remove hasRestaked and lastCheckpointTimestamp checks
wadealexc Jun 26, 2024
01be04b
test: add tests for constructor and initialize
wadealexc Jun 26, 2024
a9502e4
test: fix mainnet fork tests and compiler warnings
wadealexc Jun 26, 2024
d148952
docs: update diagrams for pepe
wadealexc Jun 26, 2024
0979b36
chore: upgrade preprod eigenpods (#611)
wadealexc Jul 2, 2024
1d117eb
feat: public block root getter (#612)
wadealexc Jul 2, 2024
6321f16
docs: update user flow diagrams to mention supported tokens
wadealexc Jul 8, 2024
333facd
setup
martin-hruska Jul 10, 2024
bc82e9b
run.sh added
otakar-trunda Jul 15, 2024
d2a87e9
github workflows and commit hooks disabled
otakar-trunda Jul 15, 2024
c84f30c
gitignored local runs
otakar-trunda Jul 15, 2024
b540c27
run script updated
otakar-trunda Jul 15, 2024
593b7f5
confs reorganized, cleared
otakar-trunda Jul 15, 2024
dfdc0e3
Conf files reorganized
otakar-trunda Jul 22, 2024
9d1fba3
Added harnesses for EigenPod
otakar-trunda Jul 22, 2024
1b2121e
Specs from the setup phase moved together and reorganized
otakar-trunda Jul 22, 2024
5b61569
Setup updated, some rules added
otakar-trunda Jul 22, 2024
fd02d98
Merge remote-tracking branch 'upstream/feat/partial-withdrawal-batchi…
otakar-trunda Jul 22, 2024
c2261e6
Post-merge fixes
otakar-trunda Jul 22, 2024
77e5b5d
Added setup and rules for endian
otakar-trunda Jul 26, 2024
43826fe
Added setup and rules for Merkle
otakar-trunda Jul 26, 2024
5186fbc
Added rules for EigenPod and EPManager, setup updated
otakar-trunda Jul 29, 2024
09800e9
BeaconChainProofs setup and rules added
otakar-trunda Jul 31, 2024
9bf5b47
Fixed bug in the rule
otakar-trunda Jul 31, 2024
bf4fa77
Setup updated, more rules
otakar-trunda Jul 31, 2024
56cd40b
Code reorganized
otakar-trunda Aug 5, 2024
5da7c23
Rules fixed
otakar-trunda Aug 5, 2024
a5eb974
More rules
otakar-trunda Aug 5, 2024
6e83c06
More rules
otakar-trunda Aug 5, 2024
55e1c7c
added mutations for BeaconChainProof contract
Aug 6, 2024
78c926d
Added EigenPod mutants
0xA5DF Aug 6, 2024
5c201ea
New runs
otakar-trunda Aug 7, 2024
37105be
Documentation added
otakar-trunda Aug 7, 2024
75dc88d
Added EigenPodManager mutations
0xA5DF Aug 7, 2024
c6aa28e
Added EigenPod mutant
0xA5DF Aug 8, 2024
d898f2b
Rename mutation
0xA5DF Aug 9, 2024
563fcdb
Added Merkle mutations
0xA5DF Aug 9, 2024
3521fb0
Added Endian mutations
0xA5DF Aug 9, 2024
501c141
Rule fixed
otakar-trunda Aug 10, 2024
a041a61
Endian mutations
otakar-trunda Aug 10, 2024
69ef55a
Endian mutations
otakar-trunda Aug 10, 2024
27304eb
Merge branch 'otakar/specs' of github.com:Certora/eigenlayer-contract…
otakar-trunda Aug 10, 2024
d571def
Original file removed from mutations
otakar-trunda Aug 11, 2024
37fa88e
New rules, confs for mutations
otakar-trunda Aug 11, 2024
e4d644a
Rules polished
otakar-trunda Aug 13, 2024
f8b4c6f
Mutations merged to original files
otakar-trunda Aug 13, 2024
a84161b
Final polishing
otakar-trunda Aug 14, 2024
4bf01aa
Comments added
otakar-trunda Aug 14, 2024
d6e9dfa
Merge remote-tracking branch 'upstream/dev' into otakar/specs
otakar-trunda Aug 20, 2024
663d1c0
Re-enabling hooks
otakar-trunda Aug 20, 2024
da89231
Obsolete files and rules removed
otakar-trunda Aug 20, 2024
70b18a2
Reverting unintended changes
otakar-trunda Aug 20, 2024
e5b0b01
Removing obsolete scripts
otakar-trunda Aug 20, 2024
9255227
One more
otakar-trunda Aug 20, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ broadcast
# Certora Outputs
.certora_internal/
.certora_recent_jobs.json
emv*certora*/*

#script config file
# script/M1_deploy.config.json
Expand All @@ -44,4 +45,4 @@ test.sh
InheritanceGraph.png
surya_report.md

.idea
.idea
54 changes: 54 additions & 0 deletions certora/confs/beaconChainProofs.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@


{
//"assert_autofinder_success": true,
"files": [
"src/test/utils/BeaconChainProofsWrapper.sol",
"src/contracts/libraries/BeaconChainProofs.sol",
],
"link": [
],
"struct_link": [

],
//"java_args": [ " -ea -Dlevel.setup.helpers=info" ],

"hashing_length_bound": "320",
"optimistic_loop": true,
"optimistic_hashing": true,
"solc": "solc8.12",
"solc_optimize": "200",
"cache": "false",
"solc_via_ir": false,
"server": "production",
"prover_version": "master",
"packages": [
],
//"process": "emv",
"smt_timeout": "6000",
//"auto_nondet_difficult_internal_funcs": true,
"prover_args": [
//"-maxBlockCount 130000", //if running with high loop iter
//"-verifyCache true",
//"-verifyTACDumps true",
//"-testMode true",
//"-checkRuleDigest true",
//"-callTraceHardFail on",
//"-recursionEntryLimit 3",
"-enableCopyLoopRewrites true",
//"-summaryResolutionMode tiered",
//"-enableEqualityReasoning true",
//"-mediumTimeout 5",
//"-depth 0",
//"-smt_initialSplitDepth 3",
//"-s [z3:lia1,yices:def]",
//"-splitParallel true",
//"-splitParallelInitialDepth 6",
//"-splitParallelTimelimit 7200",
],
"loop_iter": "24",

"verify": "BeaconChainProofsWrapper:certora/specs/libraries/BeaconChainProofs.spec",

"msg": "BeaconChainProofs",
}
69 changes: 69 additions & 0 deletions certora/confs/endian.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
//"assert_autofinder_success": true,
"files": [
"certora/harnesses/EndianCaller.sol",
"src/contracts/libraries/Endian.sol",
],
"link": [
],
"struct_link": [

],
//"java_args": [ " -ea -Dlevel.setup.helpers=info" ],

"hashing_length_bound": "320",
"optimistic_loop": true,
"optimistic_hashing": true,
"solc": "solc8.12",
"solc_optimize": "200",
"cache": "false",
"solc_via_ir": false,
"server": "production",
//"server": "staging", // switch to staging when running mutations
"prover_version": "master",
"packages": [
],
//"process": "emv",
"smt_timeout": "6000",
//"auto_nondet_difficult_internal_funcs": true,
"prover_args": [
//"-maxBlockCount 130000", //if running with loop iter >=32
//"-verifyCache true",
//"-verifyTACDumps true",
//"-testMode true",
//"-checkRuleDigest true",
//"-callTraceHardFail on",
//"-recursionEntryLimit 3",
//"-enableCopyLoopRewrites true",
//"-summaryResolutionMode tiered",
//"-enableEqualityReasoning true",
//"-mediumTimeout 5",
//"-depth 0",
//"-smt_initialSplitDepth 3",
//"-s [z3:lia1,yices:def]",
//"-splitParallel true",
//"-splitParallelInitialDepth 6",
//"-splitParallelTimelimit 7200",
"-useBitVectorTheory true",
//"-allowSolidityCallsInQuantifiers true", //needed for fromLittleEndianUint64_isSurjective
//"-smt_groundQuantifiers false", //needed for fromLittleEndianUint64_isSurjective
],
//"disable_local_typechecking": true, //needed for fromLittleEndianUint64_isSurjective
"loop_iter": "4",
"verify": "EndianCaller:certora/specs/libraries/Endian.spec",

"rule": [ "fromLittleEndianUint64_correctness" ],
//"rule": [ "transformationsAreInverse1", "transformationsAreInverse2", ],
"msg": "Endian inverse 4",

"mutations": {
"manual_mutants": [
{
"file_to_mutate": "src/contracts/libraries/Endian.sol",
"mutants_location": "certora/mutations/Edian"
}
]
}
}


124 changes: 124 additions & 0 deletions certora/confs/full.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
{
//"assert_autofinder_success": true,
"files": [
"certora/harnesses/StrategyManagerHarness.sol",
"certora/harnesses/EigenPodManagerHarness.sol",
"certora/harnesses/DummyEigenPodA.sol",
"certora/harnesses/DummyEigenPodB.sol",
"certora/harnesses/ERC20Like/DummyERC20A.sol",
"certora/harnesses/ERC20Like/DummyERC20B.sol",
"certora/harnesses/DelegationManagerHarness.sol",
//"certora/harnesses/SlasherHarness.sol",
"src/contracts/strategies/EigenStrategy.sol",
//"certora/harnesses/PausableHarness.sol",
"src/contracts/permissions/Pausable.sol",
"src/test/mocks/ETHDepositMock.sol:ETHPOSDepositMock",
"lib/openzeppelin-contracts/contracts/mocks/ERC1271WalletMock.sol",
"src/contracts/permissions/PauserRegistry.sol",
],
"link": [
"EigenPodManagerHarness:delegationManager=DelegationManagerHarness",
//"EigenPodManagerHarness:pauserRegistry=PauserRegistry",
//"SlasherHarness:_delegation=DelegationManagerHarness",
"DelegationManagerHarness:pauserRegistry=PauserRegistry",
"DelegationManagerHarness:eigenPodManager=EigenPodManagerHarness",
"DelegationManagerHarness:strategyManager=StrategyManagerHarness",
//"PausableHarness:pauserRegistry=PauserRegistry",
//"EigenPodManagerHarness:beaconChainOracle=TODO",
"EigenStrategy:underlyingToken=DummyERC20A",
//"EigenStrategy:EIGEN=TODO",
//"StrategyManagerHarness:pauserRegistry=PauserRegistry",

"StrategyManagerHarness:delegation=DelegationManagerHarness",
"StrategyManagerHarness:eigenPodManager=EigenPodManagerHarness",
"DummyEigenPodA:ethPOS=ETHPOSDepositMock",
"DummyEigenPodA:eigenPodManager=EigenPodManagerHarness",
"DummyEigenPodB:ethPOS=ETHPOSDepositMock",
"DummyEigenPodB:eigenPodManager=EigenPodManagerHarness",

],
"struct_link": [
"DelegationManagerHarness:delegationApprover=ERC1271WalletMock",

],
//"java_args": [ " -ea -Dlevel.setup.helpers=info" ],

"loop_iter": "3",
"hashing_length_bound": "3200",
"optimistic_loop": true,
"optimistic_hashing": true,
"solc": "solc8.12",
"solc_optimize": "200",
"cache": "false",
"solc_via_ir": false,
"server": "production",
//"server": "staging", // switch to staging when running mutations
"prover_version": "master",
"packages": [
"@commitlint/cli=node_modules/@commitlint/cli",
"@commitlint/config-conventional=node_modules/@commitlint/config-conventional",
"@types/yargs=node_modules/@types",
"chalk=node_modules/chalk",
"dotenv=node_modules/dotenv",
"fs=node_modules/fs",
"hardhat=node_modules/hardhat",
"hardhat-preprocessor=node_modules/hardhat-preprocessor",
"husky=node_modules/husky",
"ts-node=node_modules/ts-node",
"typescript=node_modules/typescript",
"yargs=node_modules/yargs",
"@openzeppelin-upgrades/=lib/openzeppelin-contracts-upgradeable",
"@openzeppelin/=lib/openzeppelin-contracts",
"@openzeppelin-v4.9.0/=lib/openzeppelin-contracts-v4.9.0",
"@openzeppelin-upgrades-v4.9.0/=lib/openzeppelin-contracts-upgradeable-v4.9.0",
"ds-test/=lib/ds-test/src",
"forge-std/=lib/forge-std/src"
],
"rule_sanity": "basic",
//"process": "emv",
"smt_timeout": "6000",
//"auto_nondet_difficult_internal_funcs": true,
"prover_args": [
//"-verifyCache true",
//"-verifyTACDumps true",
//"-testMode true",
//"-checkRuleDigest true",
//"-callTraceHardFail on",
"-recursionEntryLimit 3",
"-enableCopyLoopRewrites true",
//"-summaryResolutionMode tiered",
//"-enableEqualityReasoning true",
//"-mediumTimeout 5",
//"-depth 0",
//"-smt_initialSplitDepth 3",
//"-s [z3:lia1,yices:def]",
//"-splitParallel true",
//"-splitParallelInitialDepth 6",
//"-splitParallelTimelimit 7200",
"-useBitVectorTheory true",
],
//"coverage_info": "advanced", //for unsat cores
"build_cache": true, //to speed up if there were no changes in .sol files
"parametric_contracts": ["DummyEigenPodA", "DummyEigenPodB", "EigenPodManagerHarness", ],

//"verify": "PausableHarness:certora/specs/permissions/Pausable.spec",
//"verify": "DummyEigenPodA:certora/specs/pods/EigenPod.spec",
//"verify": "DummyEigenPodA:certora/specs/pods/EigenPodHooks.spec",
"verify": "EigenPodManagerHarness:certora/specs/pods/EigenPodManager.spec",
//"verify": "EigenPodManagerHarness:certora/specs/globalRules.spec",

//"exclude_rule": [ "methodsOnlyChangeOneValidatorStatus", "activeValidatorsCount_correctness"],
"rule": [ "methodsDontAlwaysRevert", ],
//"rule": [ "verifyWithdrawalCredentials_alwaysReverts", ],

"msg": "methodsAlwaysRevert OL LI3, HB320, OH UC",

"mutations": {
"manual_mutants": [
{
"file_to_mutate": "src/contracts/pods/EigenPod.sol",
"mutants_location": "certora/mutations/EigenPodTest"
}
]
}
}
66 changes: 66 additions & 0 deletions certora/confs/merkle.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
{
//"assert_autofinder_success": true,
"files": [
"certora/harnesses/MerkleCaller.sol",
"src/contracts/libraries/Merkle.sol",
],
"link": [
],
"struct_link": [

],
//"java_args": [ " -ea -Dlevel.setup.helpers=info" ],

"hashing_length_bound": "3200",
//"optimistic_loop": true,
//"optimistic_hashing": true,
"solc": "solc8.12",
"solc_optimize": "200",
"cache": "false",
"solc_via_ir": false,
"server": "production",
//"server": "staging", // switch to staging when running mutations
"prover_version": "master",
"packages": [
],
//"process": "emv",
"smt_timeout": "6000",
//"auto_nondet_difficult_internal_funcs": true,
"prover_args": [
"-maxBlockCount 130000", //needed when running with loop iter > ~30
//"-verifyCache true",
//"-verifyTACDumps true",
//"-testMode true",
//"-checkRuleDigest true",
//"-callTraceHardFail on",
//"-recursionEntryLimit 3",
"-enableCopyLoopRewrites true",
//"-summaryResolutionMode tiered",
//"-enableEqualityReasoning true",
//"-mediumTimeout 5",
//"-depth 0",
//"-smt_initialSplitDepth 3",
//"-s [z3:lia1,yices:def]",
//"-splitParallel true",
//"-splitParallelInitialDepth 6",
//"-splitParallelTimelimit 7200",
"-useBitVectorTheory true",
],
"loop_iter": "32",
//"coverage_info": "advanced", //for unsat cores

"verify": "MerkleCaller:certora/specs/libraries/Merkle.spec",

//"exclude_rule": [ "merkleizeSha256IsInjective_onSameLengths", "merkleizeSha256IsInjective" ],
//"rule": [ "processInclusionProofSha256_SingleValue", ],
"msg": "Merkle processInclusionProofSha256_SingleValue 2",

"mutations": {
"manual_mutants": [
{
"file_to_mutate": "src/contracts/libraries/Merkle.sol",
"mutants_location": "certora/mutations/Merkle"
}
]
}
}
15 changes: 15 additions & 0 deletions certora/harnesses/DummyEigenPodA.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.12;

import "../../src/contracts/pods/EigenPod.sol";
import "./EigenPodHarness.sol";

contract DummyEigenPodA is EigenPodHarness {
constructor(
IETHPOSDeposit _ethPOS,
IEigenPodManager _eigenPodManager,
uint64 _GENESIS_TIME
)
EigenPodHarness(_ethPOS, _eigenPodManager, _GENESIS_TIME) {}

}
15 changes: 15 additions & 0 deletions certora/harnesses/DummyEigenPodB.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.12;

import "../../src/contracts/pods/EigenPod.sol";
import "./EigenPodHarness.sol";

contract DummyEigenPodB is EigenPodHarness {

constructor(
IETHPOSDeposit _ethPOS,
IEigenPodManager _eigenPodManager,
uint64 _GENESIS_TIME
)
EigenPodHarness(_ethPOS, _eigenPodManager, _GENESIS_TIME) {}
}
Loading
Loading