Skip to content

Commit

Permalink
chore: fix compile + tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ypatil12 committed Feb 19, 2025
1 parent db4db08 commit cf9a938
Show file tree
Hide file tree
Showing 22 changed files with 2,205 additions and 7,283 deletions.
28 changes: 0 additions & 28 deletions docs/core/AllocationManager.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@ The `AllocationManager` manages AVS metadata registration, registration and dere

---

<<<<<<< HEAD
## AVS Metadata

AVSs must register their metadata to declare themselves who they are as the first step, before they can create operator sets or register operators into operator sets. `AllocationManager` keeps track of AVSs that have registered metadata.
Expand Down Expand Up @@ -139,8 +138,6 @@ Later on, once AVSs have created operator sets, content in their metadata URI ca
* Caller MUST be authorized, either as the AVS itself or an admin/appointee (see [`PermissionController.md`](../permissions/PermissionController.md))


=======
>>>>>>> dev
## Operator Sets

Operator sets, as described in [ELIP-002](https://github.com/eigenfoundation/ELIPs/blob/main/ELIPs/ELIP-002.md#operator-sets), are useful for AVSs to configure operator groupings which can be assigned different tasks, rewarded based on their strategy allocations, and slashed according to different rules. Operator sets are defined in [`libraries/OperatorSetLib.sol`](../../src/contracts/libraries/OperatorSetLib.sol):
Expand Down Expand Up @@ -248,10 +245,7 @@ Optionally, the `avs` can provide a list of `strategies`, specifying which strat

*Requirements*:
* Caller MUST be authorized, either as the AVS itself or an admin/appointee (see [`PermissionController.md`](../permissions/PermissionController.md))
<<<<<<< HEAD
* AVS MUST have registered metadata
=======
>>>>>>> dev
* For each `CreateSetParams` element:
* Each `params.operatorSetId` MUST NOT already exist in `_operatorSets[avs]`

Expand Down Expand Up @@ -570,11 +564,7 @@ _Note: this method can be called directly by an operator, or by a caller authori

This function is called by an operator to EITHER increase OR decrease the slashable magnitude allocated from a strategy to an operator set. As input, the operator provides an operator set as the target, and a list of strategies and corresponding `newMagnitudes` to allocate. The `newMagnitude` value is compared against the operator's current `Allocation` for that operator set/strategy:
* If `newMagnitude` is _greater than_ `Allocation.currentMagnitude`, this is an allocation
<<<<<<< HEAD
* If `newMagnitude` is _less than_ `Allocation.currentMagnitude`, this is a dellocation
=======
* If `newMagnitude` is _less than_ `Allocation.currentMagnitude`, this is a deallocation
>>>>>>> dev
* If `newMagnitude` is _equal to_ `Allocation.currentMagnitude`, this is invalid (revert)

Allocation modifications play by different rules depending on a few factors. Recall that at all times, the `encumberedMagnitude` for a strategy may not exceed that strategy's `maxMagnitude`. Additionally, note that _before processing a modification for a strategy,_ the `deallocationQueue` for that strategy is first cleared. This ensures any completable deallocations are processed first, freeing up magnitude for allocation. This process is further explained in [`clearDeallocationQueue`](#cleardeallocationqueue).
Expand Down Expand Up @@ -661,11 +651,7 @@ This queue contains a per-strategy ordered list of operator sets that, due to pr
This method stops iterating when: the queue is empty, a deallocation is reached that cannot be completed yet, or when it has cleared `numToClear` entries from the queue.

*Effects*:
<<<<<<< HEAD
* For each `strategy` and _completeable_ deallocation in `deallocationQueue[operator][strategy]`:
=======
* For each `strategy` and _completable_ deallocation in `deallocationQueue[operator][strategy]`:
>>>>>>> dev
* Pops the corresponding operator set from the `deallocationQueue`
* Reduces `allocation.currentMagnitude` by the deallocated amount
* Sets `allocation.pendingDiff` and `allocation.effectBlock` to 0
Expand Down Expand Up @@ -700,7 +686,6 @@ struct SlashingParams {
}
/**
<<<<<<< HEAD
* @notice Called by an AVS to slash an operator in a given operator set. The operator must be registered
* and have slashable stake allocated to the operator set.
*
Expand All @@ -721,9 +706,6 @@ struct SlashingParams {
* @dev Small slashing amounts may not result in actual token burns due to
* rounding, which will result in small amounts of tokens locked in the contract
* rather than fully burning through the burn mechanism.
=======
* @notice Called by an AVS to slash an operator in a given operator set
>>>>>>> dev
*/
function slashOperator(
address avs,
Expand All @@ -740,11 +722,7 @@ AVSs use slashing as a punitive disincentive for misbehavior. For details and ex

In order to slash an eligible operator, the AVS specifies which operator set the operator belongs to, the `strategies` the operator should be slashed for, and for each strategy, the _proportion of the operator's allocated magnitude_ that should be slashed (given by `wadsToSlash`). An optional `description` string allows the AVS to add context to the slash.

<<<<<<< HEAD
Once triggered in the `AllocationManager`, slashing is instant and irreversable. For each slashed strategy, the operator's `maxMagnitude` and `encumberedMagnitude` are decreased, and the allocation made to the given operator set has its `currentMagnitude` reduced. See [TODO - Accounting Doc]() for details on how slashed amounts are calculated.

Check warning on line 725 in docs/core/AllocationManager.md

View workflow job for this annotation

GitHub Actions / Typo Linting

"irreversable" should be "irreversible".
=======
Once triggered in the `AllocationManager`, slashing is instant and irreversible. For each slashed strategy, the operator's `maxMagnitude` and `encumberedMagnitude` are decreased, and the allocation made to the given operator set has its `currentMagnitude` reduced. See [TODO - Accounting Doc]() for details on how slashed amounts are calculated.
>>>>>>> dev

There are two edge cases to note for this method:
1. In the process of slashing an `operator` for a given `strategy`, if the `Allocation` being slashed has a `currentMagnitude` of 0, the call will NOT revert. Instead, the `strategy` is skipped and slashing continues with the next `strategy` listed. This is to prevent an edge case where slashing occurs on or around a deallocation's `effectBlock` -- if the call reverted, the entire slash would fail. Skipping allows any valid slashes to be processed without requiring resubmission.
Expand Down Expand Up @@ -788,10 +766,7 @@ Once slashing is processed for a strategy, [slashed stake is burned via the `Del
**Methods:**
* [`setAllocationDelay`](#setallocationdelay)
* [`setAVSRegistrar`](#setavsregistrar)
<<<<<<< HEAD
=======
* [`updateAVSMetadataURI`](#updateavsmetadatauri)
>>>>>>> dev

#### `setAllocationDelay`

Expand Down Expand Up @@ -882,8 +857,6 @@ Note that when an operator registers, registration will FAIL if the call to `IAV

*Requirements*:
* Caller MUST be authorized, either as the AVS itself or an admin/appointee (see [`PermissionController.md`](../permissions/PermissionController.md))
<<<<<<< HEAD
=======

#### `updateAVSMetadataURI`

Expand Down Expand Up @@ -960,4 +933,3 @@ Below is the format AVSs should use when updating their metadata URI. This is no

*Requirements*:
* Caller MUST be authorized, either as the AVS itself or an admin/appointee (see [`PermissionController.md`](../permissions/PermissionController.md))
>>>>>>> dev
2 changes: 1 addition & 1 deletion foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
# Specifies the exact version of Solidity to use, overriding auto-detection.
solc_version = '0.8.27'
# If enabled, treats Solidity compiler warnings as errors, preventing artifact generation if warnings are present.
deny_warnings = true
deny_warnings = false
# If set to true, changes compilation pipeline to go through the new IR optimizer.
via_ir = false
# Whether or not to enable the Solidity optimizer.
Expand Down
75 changes: 45 additions & 30 deletions script/output/devnet/M2_from_scratch_deployment_data.json
Original file line number Diff line number Diff line change
@@ -1,33 +1,48 @@
{
"addresses": {
"avsDirectory": "0x5FC8d32690cc91D4c39d9d3abcBD16989F875707",
"avsDirectoryImplementation": "0x9A676e781A523b5d0C0e43731313A708CB607508",
"baseStrategyImplementation": "0x7a2088a1bFc9d81c55368AE168C2C02570cB814F",
"delayedWithdrawalRouter": "0x2279B7A0a67DB372996a5FaB50D91eAA73d2eBe6",
"delayedWithdrawalRouterImplementation": "0x9A9f2CCfdE556A7E9Ff0848998Aa4a0CFD8863AE",
"delegation": "0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9",
"delegationImplementation": "0xA51c1fc2f0D1a1b8494Ed1FE312d7C3a78Ed91C0",
"eigenLayerPauserReg": "0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512",
"eigenLayerProxyAdmin": "0x5FbDB2315678afecb367f032d93F642f64180aa3",
"eigenPodBeacon": "0xB7f8BC63BbcaD18155201308C8f3540b07f84F5e",
"eigenPodImplementation": "0x610178dA211FEF7D417bC0e6FeD39F05609AD788",
"eigenPodManager": "0xa513E6E4b8f2a923D98304ec87F64353C4D5C853",
"eigenPodManagerImplementation": "0x959922bE3CAee4b8Cd9a407cc3ac1C251C2007B1",
"emptyContract": "0x9fE46736679d2D9a65F0992F2272dE9f3c7fa6e0",
"rewardsCoordinator": "0x8A791620dd6260079BF849Dc5567aDC3F2FdC318",
"rewardsCoordinatorImplementation": "0x68B1D87F95878fE05B998F19b66F4baba5De1aed",
"slasher": "0x0165878A594ca255338adfa4d48449f69242Eb8F",
"slasherImplementation": "0x0B306BF915C4d645ff596e518fAf3F9669b97016",
"strategies": "",
"strategyManager": "0xDc64a140Aa3E981100a9becA4E685f962f0cF6C9",
"strategyManagerImplementation": "0x0DCd1Bf9A1b36cE34237eEaFef220932846BCD82"
"addresses": {
"allocationManager": "0xD718d5A27a29FF1cD22403426084bA0d479869a0",
"allocationManagerImplementation": "0x20A42a5a785622c6Ba2576B2D6e924aA82BFA11D",
"avsDirectory": "0x50EEf481cae4250d252Ae577A09bF514f224C6C4",
"avsDirectoryImplementation": "0x8B71b41D4dBEb2b6821d44692d3fACAAf77480Bb",
"baseStrategyImplementation": "0x29C66C9208f106f34754814f488FA80b6d566790",
"delegationManager": "0xBb2180ebd78ce97360503434eD37fcf4a1Df61c3",
"delegationManagerImplementation": "0x4C52a6277b1B84121b3072C0c92b6Be0b7CC10F1",
"eigenLayerPauserReg": "0x90193C961A926261B756D1E5bb255e67ff9498A1",
"eigenLayerProxyAdmin": "0x34A1D3fff3958843C43aD80F30b94c510645C316",
"eigenPodBeacon": "0xd21060559c9beb54fC07aFd6151aDf6cFCDDCAeB",
"eigenPodImplementation": "0x416C42991d05b31E9A6dC209e91AD22b79D87Ae6",
"eigenPodManager": "0x62c20Aa1e0272312BC100b4e23B4DC1Ed96dD7D1",
"eigenPodManagerImplementation": "0x1c23A6d89F95ef3148BCDA8E242cAb145bf9c0E4",
"emptyContract": "0xA8452Ec99ce0C64f20701dB7dD3abDb607c00496",
"numStrategiesDeployed": 0,
"permissionController": "0x4f559F30f5eB88D635FDe1548C4267DB8FaB0351",
"permissionControllerImplementation": "0xDeF3bca8c80064589E6787477FFa7Dd616B5574F",
"rewardsCoordinator": "0xDEb1E9a6Be7Baf84208BB6E10aC9F9bbE1D70809",
"rewardsCoordinatorImplementation": "0x0c8b5822b6e02CDa722174F19A1439A7495a3fA6",
"strategies": {
"WETH": "0xC92B57772d68b7445F19ef9f08226f4C8C74E499"
},
"chainInfo": {
"chainId": 31337,
"deploymentBlock": 0
},
"parameters": {
"executorMultisig": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
"operationsMultisig": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266"
"strategyManager": "0xDB8cFf278adCCF9E9b5da745B44E754fC4EE3C76",
"strategyManagerImplementation": "0x978e3286EB805934215a88694d80b09aDed68D90",
"token": {
"tokenProxyAdmin": "0x0000000000000000000000000000000000000000",
"EIGEN": "0x0000000000000000000000000000000000000000",
"bEIGEN": "0x0000000000000000000000000000000000000000",
"EIGENImpl": "0x0000000000000000000000000000000000000000",
"bEIGENImpl": "0x0000000000000000000000000000000000000000",
"eigenStrategy": "0x0000000000000000000000000000000000000000",
"eigenStrategyImpl": "0x0000000000000000000000000000000000000000"
}
}
},
"chainInfo": {
"chainId": 31337,
"deploymentBlock": 1
},
"parameters": {
"communityMultisig": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
"executorMultisig": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
"operationsMultisig": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
"pauserMultisig": "0xf39Fd6e51aad88F6F4ce6aB8827279cffFb92266",
"timelock": "0x0000000000000000000000000000000000000000"
}
}
152 changes: 0 additions & 152 deletions script/releases/v1.1.0-slashing/1-eoa.s.sol

This file was deleted.

Loading

0 comments on commit cf9a938

Please sign in to comment.