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 magnitude poc #672

Closed
wants to merge 43 commits into from
Closed
Show file tree
Hide file tree
Changes from 36 commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
d7c6f3f
Feat/operator sets (#579)
ypatil12 Jun 26, 2024
80857d4
fix: remove unused immutable
0xClandestine Jul 9, 2024
f803295
chore: run `forge fmt src/contracts`
0xClandestine Jul 9, 2024
5ed166f
nit: improve comments
0xClandestine Jul 9, 2024
d44f280
refactor: remove isOperatorSetAVS mapping
0xClandestine Jul 9, 2024
dea2473
refactor: remove unused beaconChainETHStrategy constant
0xClandestine Jul 9, 2024
2d60939
refactor: storage optimization/overhaul
0xClandestine Jul 9, 2024
8d67ab8
nit: move updateStandbyParams fn
0xClandestine Jul 9, 2024
5867547
fix: variable name consistency
0xClandestine Jul 10, 2024
da8077f
chore: improve comments + naming
0xClandestine Jul 10, 2024
b54fc08
feat: remove simp mode
0xClandestine Jul 11, 2024
e0cf6fd
refactor: rename isOperatorInOperatorSet -> isMember
0xClandestine Jul 11, 2024
a51f94d
chore: forge fmt
0xClandestine Jul 12, 2024
71bc740
feat: forced opset dereg
0xClandestine Jul 12, 2024
3af0eda
chore: forge fmt src/contracts
0xClandestine Jul 12, 2024
02fff3d
test: forced opset dereg
0xClandestine Jul 12, 2024
776611d
refactor: remove OperatorSet struct
0xClandestine Jul 12, 2024
819fea8
feat: add missing interface fns
0xClandestine Jul 15, 2024
c246585
feat: add missing interface fns
0xClandestine Jul 15, 2024
7d4c2cf
feat: operator set initialization
0xClandestine Jul 16, 2024
555bf98
test: operator set initialization
0xClandestine Jul 16, 2024
7d1d1e7
feat: operator set migration; completely separate legacy and opset re…
ypatil12 Jul 22, 2024
8940535
feat: operator commission bips (#627)
8sunyuan Jul 22, 2024
4ec0a16
fix: compiling from conflict fix
8sunyuan Jul 23, 2024
c0396ca
feat: track total members and sets (#649)
0xClandestine Aug 6, 2024
d6da053
feat: operator set rewards (#663)
ypatil12 Aug 8, 2024
3decaea
feat: remove storage (#667)
ypatil12 Aug 8, 2024
21e5330
chore: address comments
ypatil12 Aug 8, 2024
e71a0b8
chore: update gap
ypatil12 Aug 8, 2024
88a4829
chore: bindings
ypatil12 Aug 8, 2024
3e36c1b
fix: deployers
ypatil12 Aug 8, 2024
e957fed
fix: deploy config
ypatil12 Aug 8, 2024
191e7fe
fix: fix operator commission tests (#673)
8sunyuan Aug 9, 2024
cfca835
Feat: enumerating sets operators are in (#662)
0xClandestine Aug 9, 2024
c4a4ed0
feat: draft with pending todos
8sunyuan Aug 9, 2024
d795e1c
chore: rename back to checkpoints
8sunyuan Aug 12, 2024
0408749
feat: partial withdrawal batching (#515)
wadealexc Aug 9, 2024
7a35c7b
Feat/operator sets (#579)
ypatil12 Jun 26, 2024
7dac94e
fix: remove unused immutable
0xClandestine Jul 9, 2024
86a2397
feat: operator commission bips (#627)
8sunyuan Jul 22, 2024
080372e
feat: operator set rewards (#663)
ypatil12 Aug 8, 2024
74e4bee
fix: fix operator commission tests (#673)
8sunyuan Aug 9, 2024
ab78633
chore: compilation & bindings
ypatil12 Aug 12, 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
1,207 changes: 1,201 additions & 6 deletions pkg/bindings/AVSDirectory/binding.go

Large diffs are not rendered by default.

1,200 changes: 1,177 additions & 23 deletions pkg/bindings/AVSDirectoryStorage/binding.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/bindings/DelegationManager/binding.go

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pkg/bindings/EigenPodManager/binding.go

Large diffs are not rendered by default.

1,170 changes: 1,131 additions & 39 deletions pkg/bindings/IAVSDirectory/binding.go

Large diffs are not rendered by default.

473 changes: 441 additions & 32 deletions pkg/bindings/IRewardsCoordinator/binding.go

Large diffs are not rendered by default.

585 changes: 566 additions & 19 deletions pkg/bindings/RewardsCoordinator/binding.go

Large diffs are not rendered by default.

579 changes: 563 additions & 16 deletions pkg/bindings/RewardsCoordinatorStorage/binding.go

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@
"rewards_updater_address": "0x18a0f92Ad9645385E8A8f3db7d0f6CF7aBBb0aD4",
"activation_delay": 7200,
"calculation_interval_seconds": 604800,
"global_operator_commission_bips": 1000
"global_operator_commission_bips": 1000,
"OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP": 1720656000,
"OPERATOR_SET_MAX_RETROACTIVE_LENGTH": 2592000
},
"ethPOSDepositAddress": "0x00000000219ab540356cBB839Cbe05303d7705Fa"
}
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,9 @@
"rewards_updater_address": "0x18a0f92Ad9645385E8A8f3db7d0f6CF7aBBb0aD4",
"activation_delay": 7200,
"calculation_interval_seconds": 604800,
"global_operator_commission_bips": 1000
"global_operator_commission_bips": 1000,
"OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP": 1720656000,
"OPERATOR_SET_MAX_RETROACTIVE_LENGTH": 2592000
},
"avsDirectory": {
"init_paused_status": 0
Expand Down
13 changes: 12 additions & 1 deletion script/deploy/devnet/M2_Deploy_From_Scratch.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,8 @@ contract Deployer_M2 is Script, Test {
uint32 REWARDS_COORDINATOR_ACTIVATION_DELAY;
uint32 REWARDS_COORDINATOR_CALCULATION_INTERVAL_SECONDS;
uint32 REWARDS_COORDINATOR_GLOBAL_OPERATOR_COMMISSION_BIPS;
uint32 REWARDS_COORDINATOR_OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP;
uint32 REWARDS_COORDINATOR_OPERATOR_SET_MAX_RETROACTIVE_LENGTH;

// one week in blocks -- 50400
uint32 STRATEGY_MANAGER_INIT_WITHDRAWAL_DELAY_BLOCKS;
Expand Down Expand Up @@ -145,6 +147,12 @@ contract Deployer_M2 is Script, Test {
REWARDS_COORDINATOR_GLOBAL_OPERATOR_COMMISSION_BIPS = uint32(
stdJson.readUint(config_data, ".rewardsCoordinator.global_operator_commission_bips")
);
REWARDS_COORDINATOR_OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP = uint32(
stdJson.readUint(config_data, ".rewardsCoordinator.OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP")
);
REWARDS_COORDINATOR_OPERATOR_SET_MAX_RETROACTIVE_LENGTH = uint32(
stdJson.readUint(config_data, ".rewardsCoordinator.OPERATOR_SET_MAX_RETROACTIVE_LENGTH")
);

STRATEGY_MANAGER_INIT_WITHDRAWAL_DELAY_BLOCKS = uint32(
stdJson.readUint(config_data, ".strategyManager.init_withdrawal_delay_blocks")
Expand Down Expand Up @@ -245,11 +253,14 @@ contract Deployer_M2 is Script, Test {
rewardsCoordinatorImplementation = new RewardsCoordinator(
delegation,
strategyManager,
avsDirectory,
REWARDS_COORDINATOR_CALCULATION_INTERVAL_SECONDS,
REWARDS_COORDINATOR_MAX_REWARDS_DURATION,
REWARDS_COORDINATOR_MAX_RETROACTIVE_LENGTH,
REWARDS_COORDINATOR_MAX_FUTURE_LENGTH,
REWARDS_COORDINATOR_GENESIS_REWARDS_TIMESTAMP
REWARDS_COORDINATOR_GENESIS_REWARDS_TIMESTAMP,
REWARDS_COORDINATOR_OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP,
REWARDS_COORDINATOR_OPERATOR_SET_MAX_RETROACTIVE_LENGTH
);

// Third, upgrade the proxy contracts to use the correct implementation contracts and initialize them.
Expand Down
10 changes: 8 additions & 2 deletions script/deploy/holesky/Deploy_Test_RewardsCoordinator.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,14 @@ contract Deploy_Test_RewardsCoordinator is ExistingDeploymentParser {
rewardsCoordinatorImplementation = new RewardsCoordinator(
delegationManager,
strategyManager,
avsDirectory,
REWARDS_COORDINATOR_CALCULATION_INTERVAL_SECONDS,
REWARDS_COORDINATOR_MAX_REWARDS_DURATION,
REWARDS_COORDINATOR_MAX_RETROACTIVE_LENGTH,
REWARDS_COORDINATOR_MAX_FUTURE_LENGTH,
REWARDS_COORDINATOR_GENESIS_REWARDS_TIMESTAMP
REWARDS_COORDINATOR_GENESIS_REWARDS_TIMESTAMP,
REWARDS_COORDINATOR_OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP,
REWARDS_COORDINATOR_OPERATOR_SET_MAX_RETROACTIVE_LENGTH
);
rewardsCoordinator = RewardsCoordinator(
address(
Expand Down Expand Up @@ -79,11 +82,14 @@ contract Deploy_Test_RewardsCoordinator is ExistingDeploymentParser {
rewardsCoordinatorImplementation = new RewardsCoordinator(
delegationManager,
strategyManager,
avsDirectory,
REWARDS_COORDINATOR_CALCULATION_INTERVAL_SECONDS,
REWARDS_COORDINATOR_MAX_REWARDS_DURATION,
REWARDS_COORDINATOR_MAX_RETROACTIVE_LENGTH,
REWARDS_COORDINATOR_MAX_FUTURE_LENGTH,
REWARDS_COORDINATOR_GENESIS_REWARDS_TIMESTAMP
REWARDS_COORDINATOR_GENESIS_REWARDS_TIMESTAMP,
REWARDS_COORDINATOR_OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP,
REWARDS_COORDINATOR_OPERATOR_SET_MAX_RETROACTIVE_LENGTH
);

eigenLayerProxyAdmin.upgrade(
Expand Down
61 changes: 61 additions & 0 deletions script/deploy/mainnet/Deploy_Strategy_Factory.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
// SPDX-License-Identifier: BUSL-1.1
pragma solidity ^0.8.12;

import "@openzeppelin/contracts/utils/Create2.sol";
import "../../utils/ExistingDeploymentParser.sol";

import "../../../src/contracts/strategies/StrategyFactory.sol";

/**
* @notice Script used for the first deployment of EigenLayer core contracts to Holesky
* FORK LOCAL
* anvil --fork-url $RPC_MAINNET
* forge script script/deploy/mainnet/Deploy_Strategy_Factory.s.sol:MainnetStrategyFactoryDeploy --rpc-url http://127.0.0.1:8545 --private-key $PRIVATE_KEY --broadcast -vvvv
*
* MAINNET
* forge script script/deploy/mainnet/Deploy_Strategy_Factory.s.sol:MainnetStrategyFactoryDeploy --rpc-url $RPC_MAINNET --private-key $PRIVATE_KEY --verify --broadcast -vvvv
*
*/

contract MainnetStrategyFactoryDeploy is ExistingDeploymentParser {
function run() external virtual {
// Use rewards config
_parseInitialDeploymentParams(
"script/configs/mainnet/v0.3.0-mainnet-rewards.config.json"
);
_parseDeployedContracts(
"script/configs/mainnet/Mainnet_curent_deployment.config.json"
);

// START RECORDING TRANSACTIONS FOR DEPLOYMENT
vm.startBroadcast();

emit log_named_address("Deployer Address", msg.sender);

_deployStrategyFactory();

// STOP RECORDING TRANSACTIONS FOR DEPLOYMENT
vm.stopBroadcast();

// Sanity Checks
_verifyContractPointers();
_verifyImplementations();
_verifyContractsInitialized({isInitialDeployment: true});
_verifyInitializationParams();

logAndOutputContractAddresses("script/output/mainnet/v0.3.2-mainnet-strategy-factory.output.json");
}

/**
* @notice Deploy StrategyFactory for Mainnet
*/

function _deployStrategyFactory() internal {
strategyFactoryImplementation = new StrategyFactory(
strategyManager
);



}
}
10 changes: 8 additions & 2 deletions script/deploy/mainnet/v0.3.0-mainnet-rewards.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,14 @@ contract MainnetRewardsCoordinatorDeploy is ExistingDeploymentParser {
rewardsCoordinatorImplementation = new RewardsCoordinator(
delegationManager,
strategyManager,
avsDirectory,
REWARDS_COORDINATOR_CALCULATION_INTERVAL_SECONDS,
REWARDS_COORDINATOR_MAX_REWARDS_DURATION,
REWARDS_COORDINATOR_MAX_RETROACTIVE_LENGTH,
REWARDS_COORDINATOR_MAX_FUTURE_LENGTH,
REWARDS_COORDINATOR_GENESIS_REWARDS_TIMESTAMP
REWARDS_COORDINATOR_GENESIS_REWARDS_TIMESTAMP,
REWARDS_COORDINATOR_OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP,
REWARDS_COORDINATOR_OPERATOR_SET_MAX_RETROACTIVE_LENGTH
);
rewardsCoordinator = RewardsCoordinator(
address(
Expand Down Expand Up @@ -85,11 +88,14 @@ contract MainnetRewardsCoordinatorDeploy is ExistingDeploymentParser {
rewardsCoordinatorImplementation = new RewardsCoordinator(
delegationManager,
strategyManager,
avsDirectory,
REWARDS_COORDINATOR_CALCULATION_INTERVAL_SECONDS,
REWARDS_COORDINATOR_MAX_REWARDS_DURATION,
REWARDS_COORDINATOR_MAX_RETROACTIVE_LENGTH,
REWARDS_COORDINATOR_MAX_FUTURE_LENGTH,
REWARDS_COORDINATOR_GENESIS_REWARDS_TIMESTAMP
REWARDS_COORDINATOR_GENESIS_REWARDS_TIMESTAMP,
REWARDS_COORDINATOR_OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP,
REWARDS_COORDINATOR_OPERATOR_SET_MAX_RETROACTIVE_LENGTH
);

eigenLayerProxyAdmin.upgrade(
Expand Down
8 changes: 8 additions & 0 deletions script/utils/ExistingDeploymentParser.sol
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,8 @@ contract ExistingDeploymentParser is Script, Test {
uint32 REWARDS_COORDINATOR_ACTIVATION_DELAY;
uint32 REWARDS_COORDINATOR_CALCULATION_INTERVAL_SECONDS;
uint32 REWARDS_COORDINATOR_GLOBAL_OPERATOR_COMMISSION_BIPS;
uint32 REWARDS_COORDINATOR_OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP;
uint32 REWARDS_COORDINATOR_OPERATOR_SET_MAX_RETROACTIVE_LENGTH;
// EigenPodManager
uint256 EIGENPOD_MANAGER_INIT_PAUSED_STATUS;
uint64 EIGENPOD_MANAGER_DENEB_FORK_TIMESTAMP;
Expand Down Expand Up @@ -326,6 +328,12 @@ contract ExistingDeploymentParser is Script, Test {
REWARDS_COORDINATOR_GLOBAL_OPERATOR_COMMISSION_BIPS = uint32(
stdJson.readUint(initialDeploymentData, ".rewardsCoordinator.global_operator_commission_bips")
);
REWARDS_COORDINATOR_OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP = uint32(
stdJson.readUint(initialDeploymentData, ".rewardsCoordinator.OPERATOR_SET_GENESIS_REWARDS_TIMESTAMP")
);
REWARDS_COORDINATOR_OPERATOR_SET_MAX_RETROACTIVE_LENGTH = uint32(
stdJson.readUint(initialDeploymentData, ".rewardsCoordinator.OPERATOR_SET_MAX_RETROACTIVE_LENGTH")
);
// AVSDirectory
AVS_DIRECTORY_INIT_PAUSED_STATUS = stdJson.readUint(initialDeploymentData, ".avsDirectory.init_paused_status");
// EigenPodManager
Expand Down
Loading
Loading