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: operator sets #607

Closed
wants to merge 38 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
68614a6
Feat/operator sets (#579)
ypatil12 Jun 26, 2024
01d4738
fix: remove unused immutable
0xClandestine Jul 9, 2024
f54b2da
chore: run `forge fmt src/contracts`
0xClandestine Jul 9, 2024
33df2be
nit: improve comments
0xClandestine Jul 9, 2024
4d673dc
refactor: remove isOperatorSetAVS mapping
0xClandestine Jul 9, 2024
7be2297
refactor: remove unused beaconChainETHStrategy constant
0xClandestine Jul 9, 2024
1665dbb
refactor: storage optimization/overhaul
0xClandestine Jul 9, 2024
9bfd91f
nit: move updateStandbyParams fn
0xClandestine Jul 9, 2024
1642ab3
fix: variable name consistency
0xClandestine Jul 10, 2024
edbbcba
chore: improve comments + naming
0xClandestine Jul 10, 2024
02f1284
feat: remove simp mode
0xClandestine Jul 11, 2024
3475bb7
refactor: rename isOperatorInOperatorSet -> isMember
0xClandestine Jul 11, 2024
47c00fc
chore: forge fmt
0xClandestine Jul 12, 2024
a7edaf9
feat: forced opset dereg
0xClandestine Jul 12, 2024
e7657c1
chore: forge fmt src/contracts
0xClandestine Jul 12, 2024
f0c280d
test: forced opset dereg
0xClandestine Jul 12, 2024
1c56728
refactor: remove OperatorSet struct
0xClandestine Jul 12, 2024
83e44d1
feat: add missing interface fns
0xClandestine Jul 15, 2024
ae9307a
feat: add missing interface fns
0xClandestine Jul 15, 2024
3c34094
feat: operator set initialization
0xClandestine Jul 16, 2024
ed3afca
test: operator set initialization
0xClandestine Jul 16, 2024
6b81f3e
feat: operator set migration; completely separate legacy and opset re…
ypatil12 Jul 22, 2024
51982d7
feat: operator commission bips (#627)
8sunyuan Jul 22, 2024
b7f1cca
fix: compiling from conflict fix
8sunyuan Jul 23, 2024
cebf94c
feat: track total members and sets (#649)
0xClandestine Aug 6, 2024
32a120c
feat: operator set rewards (#663)
ypatil12 Aug 8, 2024
b272593
feat: remove storage (#667)
ypatil12 Aug 8, 2024
2fcdeea
chore: address comments
ypatil12 Aug 8, 2024
b953e2a
chore: update gap
ypatil12 Aug 8, 2024
5607fc8
chore: bindings
ypatil12 Aug 8, 2024
5d3bc1b
fix: deployers
ypatil12 Aug 8, 2024
da7ce3b
fix: deploy config
ypatil12 Aug 8, 2024
8b162d7
fix: fix operator commission tests (#673)
8sunyuan Aug 9, 2024
13a00e7
Feat: enumerating sets operators are in (#662)
0xClandestine Aug 9, 2024
f0873d1
chore: compilation & bindings
ypatil12 Aug 12, 2024
d8a8341
build: bindings
8sunyuan Aug 15, 2024
ba0a957
fix: block m2 deregistrations for opset AVSs (#688)
ypatil12 Aug 22, 2024
e45028d
Feat: opSet -> operators enumerable Set (#714)
ypatil12 Aug 29, 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,269 changes: 1,263 additions & 6 deletions pkg/bindings/AVSDirectory/binding.go

Large diffs are not rendered by default.

1,665 changes: 1,487 additions & 178 deletions pkg/bindings/AVSDirectoryStorage/binding.go

Large diffs are not rendered by default.

1,969 changes: 1,969 additions & 0 deletions pkg/bindings/DelayedWithdrawalRouter/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,668 changes: 1,473 additions & 195 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 @@ -95,6 +95,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 @@ -134,6 +136,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 @@ -221,11 +229,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();
_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 @@ -116,6 +116,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;
// EigenPod
Expand Down Expand Up @@ -307,6 +309,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