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

feat: slashing release #679

Open
wants to merge 47 commits into
base: custom-errors
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
c430691
chore: move custom errors to sep branch
8sunyuan Sep 12, 2024
090d955
chore: forge fmt src/contracts
8sunyuan Sep 12, 2024
ed2ad0a
fix: ci and bindings
8sunyuan Sep 12, 2024
e6bbf91
chore: dmgr error tweaks
wadealexc Sep 12, 2024
0b5790b
feat: operatorSets in AVSDirectory
ypatil12 Jun 26, 2024
4163212
feat: operator commission bips (#627)
8sunyuan Jul 22, 2024
04e1a47
feat: slashing and magnitude allocations
8sunyuan Aug 12, 2024
275694f
start on scaledShares (#695)
gpsanant Aug 27, 2024
f2cd18d
fix: wrong uint16 value
8sunyuan Aug 28, 2024
8fc5105
feat: simplify deallocation now that only 1 max alloc/dealloc
ypatil12 Aug 28, 2024
88d7ae6
docs: add clarifying comment on not updating pending allocs on dealloc
ypatil12 Aug 28, 2024
c1c5356
fix: compile
ypatil12 Aug 29, 2024
95c19c0
chore: some changes for making deployments (#716)
shrimalmadhur Aug 30, 2024
f53ebc9
fix: numPendingAllocations check
8sunyuan Sep 4, 2024
4d393c3
fix(optimize): condense storage
0xClandestine Sep 4, 2024
4b56eaf
chore: add missing deploy script (#725)
shrimalmadhur Sep 4, 2024
8af9d89
fix: add missing struct defintion
0xClandestine Sep 4, 2024
a2e26c6
feat: refactor to staker scaling factors
8sunyuan Sep 7, 2024
90c6630
chore: cleanup and snapshots rename
8sunyuan Sep 7, 2024
7d1ce72
feat: split allocation logic to `AllocationManager` (#730)
0xClandestine Sep 9, 2024
9d967b7
feat: slashing magnitudes custom errors (#733)
0xClandestine Sep 11, 2024
a82b083
feat: legacy withdrawals and cleanup for DelegationManager (#738)
8sunyuan Sep 11, 2024
2e10f7d
fix: scaledStakerShares equation
8sunyuan Sep 12, 2024
8223b44
chore: rebase cleanup and fmt
8sunyuan Sep 12, 2024
c29e9e8
chore: rebase gap fix
8sunyuan Sep 12, 2024
38109d6
fix: immutables and slashinglib
8sunyuan Sep 13, 2024
5e5895a
chore: fmt
8sunyuan Sep 13, 2024
1ec813a
feat: add pending allocations methods (#744)
shrimalmadhur Sep 13, 2024
8950c4c
chore: rm avsd from strategymanager
8sunyuan Sep 13, 2024
d94cd80
fix: rearrange scaling factor eqtn
8sunyuan Sep 13, 2024
4543960
fix: reinit staker scaling factor on undelegate
8sunyuan Sep 13, 2024
73fae80
refactor: receive as shares callback (#746)
8sunyuan Sep 13, 2024
fe6a5aa
add allocation delay (#748)
gpsanant Sep 13, 2024
b871886
feat: add `registerAsOperator` delay config back (#752)
0xClandestine Sep 17, 2024
f82bc02
chore: make storage-report
0xClandestine Sep 17, 2024
cd892cf
fix: pending dealloc bug (#757)
shrimalmadhur Sep 17, 2024
caf1814
fix: fix timestamp check (#761)
shrimalmadhur Sep 17, 2024
69f7012
actually decrement (#765)
gpsanant Sep 18, 2024
bf3bed9
fix _getPendingFreeMagnitude (#769)
gpsanant Sep 18, 2024
9def3e5
fix_allocationDelay (#770)
gpsanant Sep 19, 2024
0e0a423
fix: patch ordering (#771)
shrimalmadhur Sep 19, 2024
13bd4c4
fix: patch getallocatable mag (#772)
shrimalmadhur Sep 19, 2024
44c260e
Dm cleanup (#776)
gpsanant Sep 20, 2024
85a3840
don't fucking include bindings
gpsanant Sep 20, 2024
55ae3e3
add share lib (#777)
gpsanant Sep 20, 2024
c7b8d63
simplify wraps
gpsanant Sep 21, 2024
bc51d3c
update comment
gpsanant Sep 21, 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
2 changes: 1 addition & 1 deletion .github/workflows/certora-prover.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
- name: Install solc
run: |
pip install solc-select
solc-select use 0.8.12 --always-install
solc-select use 0.8.27 --always-install
- name: Verify rule ${{ matrix.params }}
run: |
bash ${{ matrix.params }}
Expand Down
23 changes: 12 additions & 11 deletions .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,19 +26,20 @@ jobs:
id: get_issue_number
with:
script: |
if (context.issue && context.issue.number) {
// Return issue number if present
return context.issue.number;
let issue_number;
// Attempt to find a pull request associated with the commit
const pullRequests = await github.rest.repos.listPullRequestsAssociatedWithCommit({
commit_sha: context.sha,
owner: context.repo.owner,
repo: context.repo.repo,
});

if (pullRequests.data.length > 0) {
issue_number = pullRequests.data[0].number;
} else {
// Otherwise return issue number from commit
return (
await github.rest.repos.listPullRequestsAssociatedWithCommit({
commit_sha: context.sha,
owner: context.repo.owner,
repo: context.repo.repo,
})
).data[0].number;
throw new Error('No associated issue or pull request found.');
}
return issue_number;
result-encoding: string
- name: Checkout code
uses: actions/checkout@v2
Expand Down
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,7 @@ InheritanceGraph.png
surya_report.md

.idea

*state.json
deployed_strategies.json
populate_src*
2 changes: 1 addition & 1 deletion certora/harnesses/DelegationManagerHarness.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.12;
pragma solidity ^0.8.27;

import "../../src/contracts/core/DelegationManager.sol";

Expand Down
2 changes: 1 addition & 1 deletion certora/harnesses/EigenPodHarness.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.12;
pragma solidity ^0.8.27;

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

Expand Down
2 changes: 1 addition & 1 deletion certora/harnesses/EigenPodManagerHarness.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.12;
pragma solidity ^0.8.27;

import "../../src/contracts/pods/EigenPodManager.sol";

Expand Down
2 changes: 1 addition & 1 deletion certora/harnesses/PausableHarness.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.12;
pragma solidity ^0.8.27;

import "../../src/contracts/permissions/Pausable.sol";

Expand Down
2 changes: 1 addition & 1 deletion certora/harnesses/SlasherHarness.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.12;
pragma solidity ^0.8.27;

import "../../src/contracts/core/Slasher.sol";

Expand Down
2 changes: 1 addition & 1 deletion certora/harnesses/StrategyManagerHarness.sol
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.12;
pragma solidity ^0.8.27;

import "../../src/contracts/core/StrategyManager.sol";

Expand Down
2 changes: 1 addition & 1 deletion certora/scripts/core/verifyDelegationManager.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ then
RULE="--rule $2"
fi

solc-select use 0.8.12
solc-select use 0.8.27

certoraRun certora/harnesses/DelegationManagerHarness.sol \
lib/openzeppelin-contracts/contracts/token/ERC20/ERC20.sol lib/openzeppelin-contracts/contracts/mocks/ERC1271WalletMock.sol \
Expand Down
2 changes: 1 addition & 1 deletion certora/scripts/core/verifyStrategyManager.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ then
RULE="--rule $2"
fi

solc-select use 0.8.12
solc-select use 0.8.27

certoraRun certora/harnesses/StrategyManagerHarness.sol \
lib/openzeppelin-contracts/contracts/token/ERC20/ERC20.sol lib/openzeppelin-contracts/contracts/mocks/ERC1271WalletMock.sol \
Expand Down
2 changes: 1 addition & 1 deletion certora/scripts/libraries/verifyStructuredLinkedList.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ then
RULE="--rule $2"
fi

solc-select use 0.8.12
solc-select use 0.8.27

certoraRun certora/harnesses/StructuredLinkedListHarness.sol \
--verify StructuredLinkedListHarness:certora/specs/libraries/StructuredLinkedList.spec \
Expand Down
2 changes: 1 addition & 1 deletion certora/scripts/permissions/verifyPausable.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ then
RULE="--rule $2"
fi

solc-select use 0.8.12
solc-select use 0.8.27

certoraRun certora/harnesses/PausableHarness.sol \
src/contracts/permissions/PauserRegistry.sol \
Expand Down
2 changes: 1 addition & 1 deletion certora/scripts/pods/verifyEigenPod.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ then
RULE="--rule $2"
fi

# solc-select use 0.8.12
# solc-select use 0.8.27

# certoraRun certora/harnesses/EigenPodHarness.sol \
# src/contracts/core/DelegationManager.sol src/contracts/pods/EigenPodManager.sol \
Expand Down
2 changes: 1 addition & 1 deletion certora/scripts/pods/verifyEigenPodManager.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ then
RULE="--rule $2"
fi

# solc-select use 0.8.12
# solc-select use 0.8.27

# certoraRun certora/harnesses/EigenPodManagerHarness.sol \
# src/contracts/core/DelegationManager.sol src/contracts/pods/EigenPod.sol src/contracts/strategies/StrategyBase.sol src/contracts/core/StrategyManager.sol \
Expand Down
2 changes: 1 addition & 1 deletion certora/scripts/strategies/verifyStrategyBase.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ then
RULE="--rule $2"
fi

solc-select use 0.8.12
solc-select use 0.8.27

certoraRun src/contracts/strategies/StrategyBase.sol \
lib/openzeppelin-contracts/contracts/token/ERC20/ERC20.sol \
Expand Down
37 changes: 21 additions & 16 deletions docs/storage-report/AVSDirectory.md
Original file line number Diff line number Diff line change
@@ -1,16 +1,21 @@
| Name | Type | Slot | Offset | Bytes | Contract |
|---------------------|------------------------------------------------------------------------------------------|------|--------|-------|--------------------------------------------------|
| _initialized | uint8 | 0 | 0 | 1 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| _initializing | bool | 0 | 1 | 1 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| __gap | uint256[50] | 1 | 0 | 1600 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| _owner | address | 51 | 0 | 20 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| __gap | uint256[49] | 52 | 0 | 1568 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| pauserRegistry | contract IPauserRegistry | 101 | 0 | 20 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| _paused | uint256 | 102 | 0 | 32 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| __gap | uint256[48] | 103 | 0 | 1536 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| _DOMAIN_SEPARATOR | bytes32 | 151 | 0 | 32 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| avsOperatorStatus | mapping(address => mapping(address => enum IAVSDirectory.OperatorAVSRegistrationStatus)) | 152 | 0 | 32 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| operatorSaltIsSpent | mapping(address => mapping(bytes32 => bool)) | 153 | 0 | 32 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| __gap | uint256[47] | 154 | 0 | 1504 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| _status | uint256 | 201 | 0 | 32 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| __gap | uint256[49] | 202 | 0 | 1568 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| Name | Type | Slot | Offset | Bytes | Contract |
|-----------------------|---------------------------------------------------------------------------------------------------------------|------|--------|-------|--------------------------------------------------|
| _initialized | uint8 | 0 | 0 | 1 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| _initializing | bool | 0 | 1 | 1 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| __gap | uint256[50] | 1 | 0 | 1600 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| _owner | address | 51 | 0 | 20 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| __gap | uint256[49] | 52 | 0 | 1568 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| pauserRegistry | contract IPauserRegistry | 101 | 0 | 20 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| _paused | uint256 | 102 | 0 | 32 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| __gap | uint256[48] | 103 | 0 | 1536 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| _DOMAIN_SEPARATOR | bytes32 | 151 | 0 | 32 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| avsOperatorStatus | mapping(address => mapping(address => enum IAVSDirectory.OperatorAVSRegistrationStatus)) | 152 | 0 | 32 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| operatorSaltIsSpent | mapping(address => mapping(bytes32 => bool)) | 153 | 0 | 32 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| isOperatorSetAVS | mapping(address => bool) | 154 | 0 | 32 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| isOperatorSet | mapping(address => mapping(uint32 => bool)) | 155 | 0 | 32 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| _operatorSetsMemberOf | mapping(address => struct EnumerableSet.Bytes32Set) | 156 | 0 | 32 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| _operatorSetMembers | mapping(bytes32 => struct EnumerableSet.AddressSet) | 157 | 0 | 32 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| operatorSetStatus | mapping(address => mapping(address => mapping(uint32 => struct IAVSDirectory.OperatorSetRegistrationStatus))) | 158 | 0 | 32 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| __gap | uint256[42] | 159 | 0 | 1344 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| _status | uint256 | 201 | 0 | 32 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
| __gap | uint256[49] | 202 | 0 | 1568 | src/contracts/core/AVSDirectory.sol:AVSDirectory |
17 changes: 11 additions & 6 deletions docs/storage-report/AVSDirectoryStorage.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
| Name | Type | Slot | Offset | Bytes | Contract |
|---------------------|------------------------------------------------------------------------------------------|------|--------|-------|----------------------------------------------------------------|
| _DOMAIN_SEPARATOR | bytes32 | 0 | 0 | 32 | src/contracts/core/AVSDirectoryStorage.sol:AVSDirectoryStorage |
| avsOperatorStatus | mapping(address => mapping(address => enum IAVSDirectory.OperatorAVSRegistrationStatus)) | 1 | 0 | 32 | src/contracts/core/AVSDirectoryStorage.sol:AVSDirectoryStorage |
| operatorSaltIsSpent | mapping(address => mapping(bytes32 => bool)) | 2 | 0 | 32 | src/contracts/core/AVSDirectoryStorage.sol:AVSDirectoryStorage |
| __gap | uint256[47] | 3 | 0 | 1504 | src/contracts/core/AVSDirectoryStorage.sol:AVSDirectoryStorage |
| Name | Type | Slot | Offset | Bytes | Contract |
|-----------------------|---------------------------------------------------------------------------------------------------------------|------|--------|-------|----------------------------------------------------------------|
| _DOMAIN_SEPARATOR | bytes32 | 0 | 0 | 32 | src/contracts/core/AVSDirectoryStorage.sol:AVSDirectoryStorage |
| avsOperatorStatus | mapping(address => mapping(address => enum IAVSDirectory.OperatorAVSRegistrationStatus)) | 1 | 0 | 32 | src/contracts/core/AVSDirectoryStorage.sol:AVSDirectoryStorage |
| operatorSaltIsSpent | mapping(address => mapping(bytes32 => bool)) | 2 | 0 | 32 | src/contracts/core/AVSDirectoryStorage.sol:AVSDirectoryStorage |
| isOperatorSetAVS | mapping(address => bool) | 3 | 0 | 32 | src/contracts/core/AVSDirectoryStorage.sol:AVSDirectoryStorage |
| isOperatorSet | mapping(address => mapping(uint32 => bool)) | 4 | 0 | 32 | src/contracts/core/AVSDirectoryStorage.sol:AVSDirectoryStorage |
| _operatorSetsMemberOf | mapping(address => struct EnumerableSet.Bytes32Set) | 5 | 0 | 32 | src/contracts/core/AVSDirectoryStorage.sol:AVSDirectoryStorage |
| _operatorSetMembers | mapping(bytes32 => struct EnumerableSet.AddressSet) | 6 | 0 | 32 | src/contracts/core/AVSDirectoryStorage.sol:AVSDirectoryStorage |
| operatorSetStatus | mapping(address => mapping(address => mapping(uint32 => struct IAVSDirectory.OperatorSetRegistrationStatus))) | 7 | 0 | 32 | src/contracts/core/AVSDirectoryStorage.sol:AVSDirectoryStorage |
| __gap | uint256[42] | 8 | 0 | 1344 | src/contracts/core/AVSDirectoryStorage.sol:AVSDirectoryStorage |
21 changes: 21 additions & 0 deletions docs/storage-report/AllocationManager.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
| Name | Type | Slot | Offset | Bytes | Contract |
|----------------------------|-----------------------------------------------------------------------------------------------------|------|--------|-------|------------------------------------------------------------|
| _initialized | uint8 | 0 | 0 | 1 | src/contracts/core/AllocationManager.sol:AllocationManager |
| _initializing | bool | 0 | 1 | 1 | src/contracts/core/AllocationManager.sol:AllocationManager |
| __gap | uint256[50] | 1 | 0 | 1600 | src/contracts/core/AllocationManager.sol:AllocationManager |
| _owner | address | 51 | 0 | 20 | src/contracts/core/AllocationManager.sol:AllocationManager |
| __gap | uint256[49] | 52 | 0 | 1568 | src/contracts/core/AllocationManager.sol:AllocationManager |
| pauserRegistry | contract IPauserRegistry | 101 | 0 | 20 | src/contracts/core/AllocationManager.sol:AllocationManager |
| _paused | uint256 | 102 | 0 | 32 | src/contracts/core/AllocationManager.sol:AllocationManager |
| __gap | uint256[48] | 103 | 0 | 1536 | src/contracts/core/AllocationManager.sol:AllocationManager |
| _DOMAIN_SEPARATOR | bytes32 | 151 | 0 | 32 | src/contracts/core/AllocationManager.sol:AllocationManager |
| operatorSaltIsSpent | mapping(address => mapping(bytes32 => bool)) | 152 | 0 | 32 | src/contracts/core/AllocationManager.sol:AllocationManager |
| _totalMagnitudeUpdate | mapping(address => mapping(contract IStrategy => struct Snapshots.History)) | 153 | 0 | 32 | src/contracts/core/AllocationManager.sol:AllocationManager |
| _magnitudeUpdate | mapping(address => mapping(contract IStrategy => mapping(bytes32 => struct Snapshots.History))) | 154 | 0 | 32 | src/contracts/core/AllocationManager.sol:AllocationManager |
| operatorMagnitudeInfo | mapping(address => mapping(contract IStrategy => struct IAllocationManager.OperatorMagnitudeInfo)) | 155 | 0 | 32 | src/contracts/core/AllocationManager.sol:AllocationManager |
| _pendingFreeMagnitude | mapping(address => mapping(contract IStrategy => struct IAllocationManager.PendingFreeMagnitude[])) | 156 | 0 | 32 | src/contracts/core/AllocationManager.sol:AllocationManager |
| _queuedDeallocationIndices | mapping(address => mapping(contract IStrategy => mapping(bytes32 => uint256[]))) | 157 | 0 | 32 | src/contracts/core/AllocationManager.sol:AllocationManager |
| _allocationDelayInfo | mapping(address => struct IAllocationManager.AllocationDelayInfo) | 158 | 0 | 32 | src/contracts/core/AllocationManager.sol:AllocationManager |
| __gap | uint256[42] | 159 | 0 | 1344 | src/contracts/core/AllocationManager.sol:AllocationManager |
| _status | uint256 | 201 | 0 | 32 | src/contracts/core/AllocationManager.sol:AllocationManager |
| __gap | uint256[49] | 202 | 0 | 1568 | src/contracts/core/AllocationManager.sol:AllocationManager |
Loading
Loading