Skip to content

Commit

Permalink
fix: merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
ypatil12 committed Feb 16, 2025
1 parent 9c8ba5a commit a78c9ec
Show file tree
Hide file tree
Showing 10 changed files with 27 additions and 425 deletions.
30 changes: 21 additions & 9 deletions .github/configs/solhint.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,26 @@
"rules": {
"max-line-length": "off",
"no-inline-assembly": "off",
"reason-string": ["warn",{"maxLength":160}],
"func-visibility": ["warn",{"ignoreConstructors":true}],
"explicit-types": ["warn","explicit"],
"quotes": ["warn","double"],
"reason-string": [
"warn",
{
"maxLength": 160
}
],
"func-visibility": [
"warn",
{
"ignoreConstructors": true
}
],
"explicit-types": [
"warn",
"explicit"
],
"quotes": [
"warn",
"double"
],
"const-name-snakecase": "off",
"not-rely-on-time": "off",
"avoid-low-level-calls": "off",
Expand All @@ -18,9 +34,5 @@
"no-global-import": "off",
"immutable-vars-naming": "off",
"no-console": "off"
<<<<<<< HEAD:.solhint.json

=======
>>>>>>> dev:.github/configs/solhint.json
}
}
}
2 changes: 1 addition & 1 deletion docs/core/RewardsCoordinator.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<!-- The primary functions of the `RewardsCoordinator` contract are to (i) accept ERC20 rewards from AVSs (Actively Validated Services) to their Operators and delegated Stakers for a given time range; (ii) enable the protocol to provide ERC20 tokens to all stakers over a specified time range; and (iii) allow stakers and operators to claim their accumulated earnings. -->

The `RewardsCoordinator` accepts ERC20s from AVSs alongside rewards submission requests made out to Operators who, during a specified time range, were registered to the AVS in the core [`AllocationManager`](./AllocationManager.md) contract.
The `RewardsCoordinator` accepts ERC20s from AVSs alongside rewards submission requests made out to Operators who, during a specified time range, were registered to the AVS in the core [`AVSDirectory`](./AVSDirectory.md) contract or OperatorSets in the core [`AllocationManager`](./AllocationManager.md) contract.

There are two forms of rewards:
* Rewards v1, also known as rewards submissions.
Expand Down
1 change: 0 additions & 1 deletion docs/core/StrategyManager.md
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,6 @@ Note that the amount of deposit shares removed while in the withdrawal queue may
function addShares(
address staker,
IStrategy strategy,
IERC20 token,
uint256 shares
)
external
Expand Down
3 changes: 0 additions & 3 deletions docs/core/accounting/SharesAccountingEdgeCases.md
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,6 @@ Since the operatorShares are simply incrementing by the exact depositShares, the
Granted the initial deposit amount was `4.418e28` which is magnitudes larger than the discrepancy here but this its important to note the side effects of the redesigned accounting model.
Instead of purely incremented/decremented amounts, we have introduced magnitudes and scaling factor variables which now result in small amounts of rounding error from division in several places. We deem this rounding behavior to be tolerable given the costs associated for the number of transactions to emulate this and the proportional error is very small.

<<<<<<< HEAD
### Slashing and Rounding Up Operator Shares and Rounding down on Staker Withdrawable Shares

As can be observed in the `SlashingLib.sol` library, we round up on the operatorShares when slashing and round down on the staker's withdrawableShares. If we look at a core invariant of the shares accounting model, we ideally want to preserve the following:
Expand All @@ -168,8 +167,6 @@ Upwards rounding on calculating the amount of operatorShares to give to an opera
For calculating a staker's withdrawableShares, there are many different factors to consider such as calculating their depositScalingFactor, their slashingFactor, and calculating the amount of withdrawable shares altogether with their depositShares. These variables are all by default rounded down in calculation and is expected behavior for stakers.


=======
>>>>>>> dev
## Upper bound on Residual Operator Shares

Related to the above rounding error on deposits, we want to calculate what is the worst case rounding error for a staker depositing shares into EigenLayer.
Expand Down
2 changes: 1 addition & 1 deletion src/contracts/core/StrategyManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ contract StrategyManager is
address staker,
IStrategy strategy,
uint256 shares
) external onlyDelegationManager returns (uint256, uint256) {
) external onlyDelegationManager nonReentrant returns (uint256, uint256) {
return _addShares(staker, strategy, shares);
}

Expand Down
30 changes: 0 additions & 30 deletions src/contracts/interfaces/ISignatureUtils.sol

This file was deleted.

85 changes: 0 additions & 85 deletions src/contracts/mixins/SignatureUtils.sol

This file was deleted.

10 changes: 3 additions & 7 deletions src/test/integration/IntegrationBase.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -1787,6 +1787,7 @@ abstract contract IntegrationBase is IntegrationDeployer, TypeImporter {
Magnitudes[] memory magnitudes = _getMagnitudes(operator, strategies);

for (uint i = 0; i < params.strategies.length; i++) {
IStrategy strategy = params.strategies[i];
uint64 halfAvailable = uint64(magnitudes[i].allocatable) / 2;
params.newMagnitudes[i] = allocations[i].currentMagnitude + halfAvailable;
}
Expand Down Expand Up @@ -2570,13 +2571,8 @@ abstract contract IntegrationBase is IntegrationDeployer, TypeImporter {
}

function _getCheckpointPodBalanceGwei(User staker) internal view returns (uint64) {
if (forkType != LOCAL && !isUpgraded) {
IEigenPod_DeprecatedM2 pod = IEigenPod_DeprecatedM2(address(staker.pod()));
return uint64(pod.currentCheckpoint().podBalanceGwei);
} else {
EigenPod pod = staker.pod();
return uint64(pod.currentCheckpoint().podBalanceGwei);
}
EigenPod pod = staker.pod();
return uint64(pod.currentCheckpoint().podBalanceGwei);
}

function _getPrevCheckpointPodBalanceGwei(User staker) internal timewarp() returns (uint64) {
Expand Down
13 changes: 1 addition & 12 deletions src/test/integration/IntegrationChecks.t.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,17 +16,6 @@ contract IntegrationCheckUtils is IntegrationBase {
EIGENPOD CHECKS
*******************************************************************************/

function check_VerifyWC_State(
User_M2 staker,
uint40[] memory validators,
uint64 beaconBalanceGwei
) internal {
uint beaconBalanceWei = beaconBalanceGwei * GWEI_TO_WEI;
assert_Snap_Added_Staker_DepositShares(staker, BEACONCHAIN_ETH_STRAT, beaconBalanceWei, "staker should have added deposit shares to beacon chain strat");
assert_Snap_Added_ActiveValidatorCount(staker, validators.length, "staker should have increased active validator count");
assert_Snap_Added_ActiveValidators(staker, validators, "validators should each be active");
}

function check_VerifyWC_State(
User staker,
uint40[] memory validators,
Expand Down Expand Up @@ -975,4 +964,4 @@ contract IntegrationCheckUtils is IntegrationBase {
}
}
}
}
}
Loading

0 comments on commit a78c9ec

Please sign in to comment.