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 release #311

Merged
merged 56 commits into from
Jan 28, 2025
Merged

feat: slashing release #311

merged 56 commits into from
Jan 28, 2025

Conversation

stevennevins
Copy link
Collaborator

No description provided.

gpsanant and others added 19 commits July 17, 2024 11:42
* chore: update mock contracts with latest interfaces
* chore: checkout migration branch

* feat: implement migration function

* chore: update to release branch

* feat: operator set creation for each quorum number

* feat: migration with merge sorted array of operators and their quorums

* feat: operator set migration working

* chore: revert change from testing

* chore: revert change from testing

* chore: remove extra logging and commented out asserts

* chore: remove unused file

* fix: remove console logs

* refactor: to view functions

* chore: nit and remove unneeded function

* fix: remove duplication of looping for all the operators

* chore: remove comment

* feat: allow migrating in two transactions

* feat: finalization of migration

* chore: use string errors and fix migration issues

* chore: rename

* feat: use library for merge sort

* test: fuzz view function
* chore: checkout migration branch

* feat: implement migration function

* chore: update to release branch

* feat: operator set creation for each quorum number

* feat: migration with merge sorted array of operators and their quorums

* feat: operator set migration working

* chore: revert change from testing

* chore: revert change from testing

* chore: remove extra logging and commented out asserts

* chore: remove unused file

* fix: remove console logs

* feat: create quorum post operator set migration

* test(wip): create quorum test adds new operator set

* test: migration create quorum

* refactor: to view functions

* chore: nit and remove unneeded function

* fix: remove duplication of looping for all the operators

* chore: remove comment

* feat: allow migrating in two transactions

* feat: finalization of migration

* chore: use string errors and fix migration issues

* chore: rename

* feat: use library for merge sort

* test: fuzz view function

* fix: updates from merge

* chore: use interface
* chore: update to latest eigenlayer-contracts feat/operator-set-release

* chore: add method to mock
* feat: update stakes handle direct deregistration on AVSDirectory

* test: update stake for quorum if operator directly unregistered from the AVSDirectory

* chore: simplify setup

* chore: simplify setup

* chore: make service manager immutable on stakeRegistry
* feat: register and deregister to operator sets

* fix: bytecode wrangling

* chore: shorter errors to reduce bytecode

* test: register after migration

* chore: remove stale todos

* chore: add back commented line

* chore: remain consistent with m2 events

* fix: side effect of merge from _deregister function

* fix: bytecode massaging

* chore: rename for clarity

* chore: remove comments and whitespace

* docs: add natspec to the library
* feat: upgrade and test pre prod upgrade and migration

* fix: add param introduced in merge
@stevennevins stevennevins changed the title Feat/slashing release branch feat: slashing release Oct 17, 2024
* chore: bump to slashing branch

* chore: bump compiler version

* fix: dep interface changes

* fix: compiler errors from interface changes and type changes

* fix: compiler errors

* chore: bump dependencies

* chore: bump core dependency and resolve issues

* chore: bump core dependency and fix compiler errors

* feat: integrate AllocationManager

* feat: add a slashing permission to the service manager

* chore: remove unneeded casting

* feat: implement a slasher permission and forward call to AllocationManager

* feat: add simiple slasher starting point

* chore: bump slashing magnitudes

* chore: bump core slashing-magnitudes branch
* chore: bump to slashing branch

* chore: bump compiler version

* fix: dep interface changes

* fix: compiler errors from interface changes and type changes

* fix: compiler errors

* chore: bump dependencies

* chore: bump core dependency and resolve issues

* chore: bump core dependency and fix compiler errors

* feat: integrate AllocationManager

* feat: add a slashing permission to the service manager

* chore: remove unneeded casting

* feat: implement a slasher permission and forward call to AllocationManager

* feat: add simiple slasher starting point

* feat: slashers

* chore: change around slashed event

* fix: call dm

* feat: add proposal mechanism for updating slasher

* fix: set to completed instead of delete

* chore: use struct instead of params directly

* chore: clean up params more

* chore: simplify and organize files

* chore: cleanup logic and couple event with internal func

* fix: pass correct params

* chore: organize and add interface

* chore: nits

* chore: cleanup more nits

* fix: storage gap

* chore: nits refactor

* chore: go back to fulfill being onlySlasher

* test: fixes from core updates

* fix: use delegated stake per operator set instead of per AVS

* fix: update to 14 days

* feat: configurable lookahead and stake type
src/StakeRegistry.sol Outdated Show resolved Hide resolved
stevennevins and others added 4 commits November 18, 2024 13:52
* feat: remove both option

* chore: remove unused test util contracts

* chore: remove diff
#317)

* feat: remove both option

* feat: total delegated stake and total slashable stake per quorum config

* test: resolve some breaking changes to tests

* chore: move stake type to file level definition

* chore: refactor loop

* test: add unit test for slashble stake quorum init

* test: assert on state and event

* test: delegated stake quorum and assertions
@supernovahs
Copy link

Error (9553): Invalid type for argument in function call. Invalid implicit conversion from contract TransparentUpgradeableProxy to contract ITransparentUpgradeableProxy requested.
   --> lib/eigenlayer-middleware/test/utils/MockAVSDeployer.sol:310:17:
    |
310 |                 TransparentUpgradeableProxy(payable(address(registryCoordinator))),
    |                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Error: Compilation failed

getitng this while compiling my contracts in IS with this as submodule

src/StakeRegistry.sol Outdated Show resolved Hide resolved
8sunyuan and others added 5 commits January 17, 2025 15:11
* refactor: uam

* feat: add uam interfaces

* fix: lookahead period to blocks

* fix: tests

* chore: storage report
* feat: ci forge coverage

* fix: ci
* feat: ci forge fmt

* chore: forge fmt
* feat: add register with churn type

* fix: tests for encoded registration type

* feat: add ejector support for operator sets

* refactor: handle operator set dereg

* fix: dereg on churn from ALM if needed
* refactor: slashing registry coordinator

refactor: registry coordinator

refactor: remove sm calls

fix: tests wip

* fix: integration tests

* refactor: internal functions

* fix: remove unused block

* fix: comment out test for now

* build: fmt check run only on src contracts

* fix: call SM only based on m2 quorums (#369)

* feat: update enableOperatorSets flow (#367)

* feat: update enableOperatorSets flow

* fix: dereg op check

* chore: renamed m2 quorums

* fix: msg.sender -> operator

* chore: forge fmt

* fix: tests

---------

Co-authored-by: Yash Patil <[email protected]>
8sunyuan and others added 6 commits January 27, 2025 18:12
* refactor: natspec + interfaces

refactor: natspec + interfaces

refactor: natspec + interfaces

docs: `RegistryCoordinator` natspec

chore: forge fmt

refactor: named mapping params

docs: natspec `BLSApkRegistry`

docs: natspec `BLSApkRegistry`

docs: natspec `BLSApkRegistry`

refactor: interface structure

refactor: separate `BLSSignatureChecker` storage

refactor: rename -> `IECDSAStakeRegistry`

docs: natspec

docs: natspec `ECDSAStakeRegistry`

docs: natspec `EjectionManager` + separate storage

docs: natspec

docs: natspec `IndexRegistry`

refactor: remove `IRegistry`

chore: forge fmt

chore: make storage-report

docs: natspec

refactor: remove `ISocketUpdater`

refactor: use

refactor: remove todo

refactor: `///` -> `/**`

refactor: improve comment

refactor: rename var

refactor: improve comment

* fix: compiling - tests failing

* refactor: test passing **mostly**

* refactor: add missing gap

* refactor: natspec

* fix: test - state changes moved out of internal

* chore: forge fmt

* refactor: reorganize errors

* refactor: remove override

* refactor: note avsd

* Yash/natspec - address comments (#372)

* feat: natpsec with inheritance

* feat: storage

* chore: format

* chore: fmt

* chore: format

* fix: test

* fix: test

---------

Co-authored-by: Michael Sun <[email protected]>
Co-authored-by: Yash Patil <[email protected]>
@stevennevins stevennevins marked this pull request as ready for review January 28, 2025 00:17
Copy link
Contributor

@ypatil12 ypatil12 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@stevennevins stevennevins merged commit 11b0061 into dev Jan 28, 2025
5 checks passed
@stevennevins stevennevins deleted the feat/slashing-release-branch branch January 28, 2025 00:25
IStakeRegistry stakeRegistry = registryCoordinator.stakeRegistry();
IIndexRegistry indexRegistry = registryCoordinator.indexRegistry();
IBLSApkRegistry blsApkRegistry = registryCoordinator.blsApkRegistry();

Operator[][] memory operators = new Operator[][](quorumNumbers.length);
for (uint256 i = 0; i < quorumNumbers.length; i++) {
uint8 quorumNumber = uint8(quorumNumbers[i]);
bytes32[] memory operatorIds = indexRegistry.getOperatorListAtBlockNumber(quorumNumber, blockNumber);
bytes32[] memory operatorIds =
indexRegistry.getOperatorListAtBlockNumber(quorumNumber, blockNumber);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use the ALM's function for operatorSets

* @param quorumNumber The quorum number to set the look ahead period for
* @param _lookAheadBlocks The number of blocks to look ahead when checking shares
*/
function _setLookAheadPeriod(uint8 quorumNumber, uint32 _lookAheadBlocks) internal {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

doesn't check that the quorum is for slashable stake

*/

/// @inheritdoc IStakeRegistry
function isOperatorSetQuorum(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

seems like this should be an external function on the registryCoordinator


if (stakeTypePerQuorum[quorumNumber] == IStakeRegistryTypes.StakeType.TOTAL_SLASHABLE) {
strategyShares = _getSlashableStakePerStrategy(quorumNumber, operator);
for (uint256 i = 0; i < stratsLength; i++) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

move this loop outside the conditional, it is duplicated

) internal view returns (uint256[] memory) {
address[] memory operators = new address[](1);
operators[0] = operator;
uint32 beforeTimestamp =
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

beforeBlock

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants