Skip to content

Commit

Permalink
fix: integration test initialization params (#978)
Browse files Browse the repository at this point in the history
* fix: initialization params

* fix: roll blocks usage
  • Loading branch information
ypatil12 authored Jan 3, 2025
1 parent e39f264 commit 14ca22e
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 7 deletions.
5 changes: 3 additions & 2 deletions script/configs/mainnet.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"config": {
"environment": {
"chainid": 1,
"lastUpdated": "v0.4.2-mainnet-pepe",
"lastUpdated": "slashing-integration-testing",
"name": "mainnet"
},
"params": {
Expand All @@ -16,7 +16,8 @@
"REWARDS_UPDATER_ADDRESS": "0x8f94F55fD8c9E090296283137C303fE97d32A9e2",
"ACTIVATION_DELAY": 604800,
"GLOBAL_OPERATOR_COMMISSION_BIPS": 1000,
"MIN_WITHDRAWAL_DELAY": 7200
"MIN_WITHDRAWAL_DELAY_BLOCKS": 100800,
"ALLOCATION_CONFIGURATION_DELAY": 126000
}
},
"deployment": {
Expand Down
4 changes: 4 additions & 0 deletions script/utils/ExistingDeploymentParser.sol
Original file line number Diff line number Diff line change
Expand Up @@ -683,5 +683,9 @@ contract ExistingDeploymentParser is Script, Logger {
REWARDS_COORDINATOR_MAX_RETROACTIVE_LENGTH = uint32(json.readUint(".config.params.MAX_RETROACTIVE_LENGTH"));
REWARDS_COORDINATOR_MAX_FUTURE_LENGTH = uint32(json.readUint(".config.params.MAX_FUTURE_LENGTH"));
REWARDS_COORDINATOR_GENESIS_REWARDS_TIMESTAMP = uint32(json.readUint(".config.params.GENESIS_REWARDS_TIMESTAMP"));

DEALLOCATION_DELAY = uint32(json.readUint(".config.params.MIN_WITHDRAWAL_DELAY_BLOCKS"));
ALLOCATION_CONFIGURATION_DELAY = uint32(json.readUint(".config.params.ALLOCATION_CONFIGURATION_DELAY"));
DELEGATION_MANAGER_MIN_WITHDRAWAL_DELAY_BLOCKS = uint32(json.readUint(".config.params.MIN_WITHDRAWAL_DELAY_BLOCKS"));
}
}
5 changes: 4 additions & 1 deletion src/test/integration/IntegrationBase.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,10 @@ abstract contract IntegrationBase is IntegrationDeployer {

operator.registerAsOperator();
operator.depositIntoEigenlayer(strategies, tokenBalances);
}

// Roll passed the allocation configuration delay
rollForward({blocks: ALLOCATION_CONFIGURATION_DELAY});
}

assert_Snap_Added_Staker_DepositShares(operator, strategies, addedShares, "_newRandomOperator: failed to add delegatable shares");
assert_Snap_Added_OperatorShares(operator, strategies, addedShares, "_newRandomOperator: failed to award shares to operator");
Expand Down
5 changes: 5 additions & 0 deletions src/test/integration/IntegrationDeployer.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,11 @@ abstract contract IntegrationDeployer is ExistingDeploymentParser {
EmptyContract emptyContract = new EmptyContract();
ethPOSDeposit = new ETHPOSDepositMock();

// Matching parameters to testnet
DELEGATION_MANAGER_MIN_WITHDRAWAL_DELAY_BLOCKS = 50;
DEALLOCATION_DELAY = 50;
ALLOCATION_CONFIGURATION_DELAY = 75;

/**
* First, deploy upgradeable proxy contracts that **will point** to the implementations. Since the implementation contracts are
* not yet deployed, we give these proxies an empty contract as the initial implementation, to act as if they have no code.
Expand Down
9 changes: 6 additions & 3 deletions src/test/integration/tests/Deposit_Delegate_Allocate.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,15 @@ contract Integration_Deposit_Delegate_Allocate is IntegrationCheckUtils {
_upgradeEigenLayerContracts(); // Upgrade contracts if forkType is not local
(AVS avs,) = _newRandomAVS();

// Create an operator set and register an operator.
// 3. Set allocation delay for operator
operator.setAllocationDelay(1);
rollForward({blocks: ALLOCATION_CONFIGURATION_DELAY});

// 4. Create an operator set and register an operator.
OperatorSet memory operatorSet = avs.createOperatorSet(strategies);
operator.registerForOperatorSet(operatorSet);
operator.setAllocationDelay(1);

// 3. Allocate to operator set.
// 5. Allocate to operator set.
IAllocationManagerTypes.AllocateParams memory allocateParams =
operator.modifyAllocations(operatorSet, _randMagnitudes({sum: 1 ether, len: strategies.length}));
assert_Snap_Allocations_Modified(
Expand Down
1 change: 0 additions & 1 deletion src/test/integration/users/User.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,6 @@ contract User is Logger, IDelegationManagerTypes, IAllocationManagerTypes {
_tryPrankAppointee_AllocationManager(IAllocationManager.setAllocationDelay.selector);
allocationManager().setAllocationDelay(address(this), delay);
print.gasUsed();
rollForward({blocks: allocationManager().ALLOCATION_CONFIGURATION_DELAY()});
}

/// -----------------------------------------------------------------------
Expand Down

0 comments on commit 14ca22e

Please sign in to comment.