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

Draft
wants to merge 45 commits into
base: dev
Choose a base branch
from
Draft

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

Comment on lines 33 to 39
function registerOperatorToOperatorSets(
address operator,
uint32[] calldata operatorSetIds,
ISignatureUtils.SignatureWithSaltAndExpiry memory operatorSignature
) external {}

function deregisterOperatorFromOperatorSets(address operator, uint32[] calldata operatorSetIds) external{}

Choose a reason for hiding this comment

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

these can be directly called by the operator right? Or is it necessary to route these through service manager?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

These have to be routed through the service manager currently, but that will likely change post-UAM

They won't be called directly by the operator on the service manager, though. The flow would be

Registry -> ServiceManager -> AllocationManager

Choose a reason for hiding this comment

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

what is UAM?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

universal access managemnent

stevennevins and others added 10 commits December 9, 2024 13:05
* chore: add note

* fix: remove handling of forceDeregistration

* fix: fix total delegated stake usage

* fix: integration tests

* test: fix remaining integration tests

* test: add back log check

* test: add additional tests for transition to operator sets

* test: add more test cases

* feat: record m2 quorums on migration

* chore: add note about churn support

* fix: prevent operator set registration changes for m2 quorums

* feat: require strings

* chore: add dev note and add require string
* docs: match file and library name, and add docstrings

* docs: update error strings to match function

* style: forge fmt + moving variables around + fixing error strings

* fix: enforce max quorum count for EjectionManager

* style: more error string fixes + formatting

* fix: correctly set StakeRegistryStorage gap

* style: more error string corrections + typos
* fix: withdrawal delay check

* fix: add operator set strategies (#334)

* fix: remove registerOperatorToOperatorSet interface function

* fix: update interface functions with alm interface

* fix: operator set strategies in ALM

* chore: remove todo

* fix: add strategies by stake registry

* fix: params for deregister

* chore: remove old migration functions

* chore: check quorum exists before setting params

* fix: deregister flow for operator set quorums

* test: fix test for DM withdrawal delay blocks

* chore: update all pragmas to 0.8.27 (#336)

* feat: custom require errors for registry coordinator (#337)

* feat: custom require errors for registry coordinator

* ci: update the ci to use the correct compiler settings
) external override onlyWhenNotPaused(PAUSED_REGISTER_OPERATOR) {
require(isUsingOperatorSets(), OperatorSetsNotEnabled());
for (uint256 i = 0; i < operatorSetIds.length; i++) {
require(!isM2Quorum[uint8(operatorSetIds[i])], OperatorSetsNotSupported());
Copy link
Collaborator

Choose a reason for hiding this comment

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

can't we just make isM2Quorum a uint256 and do bitwise and to check this?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

don't see a huge benefit of this

Copy link
Collaborator

Choose a reason for hiding this comment

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

This interface really should contain the register/registerWithChurn/deregister interfaces.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

yeah makes sense

stevennevins and others added 5 commits January 8, 2025 08:15
* chore: bump dep

* fix: iface changes and param names
* feat: storage reports

* fix: storage report

* fix: storage report

* fix: ci

* fix: ci

* fix: ci

* fix: ci

* fix: ci
* refactor: custom errors

* fix: unit tests
src/StakeRegistry.sol Outdated Show resolved Hide resolved
}

function isUsingOperatorSets() public view returns (bool) {
return isOperatorSetAVS;
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think this should just be default to true in the initialize function. OperatorSet quorums should be the new normal as the AVSD is planned to be deprecated in some future release.

emit OperatorSocketUpdate(operatorId, socket);

// If the operator wasn't registered for any quorums, update their status
// and register them with this AVS in EigenLayer core (DelegationManager)
Copy link
Collaborator

Choose a reason for hiding this comment

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

comment needs updating

SignatureWithSaltAndExpiry memory churnApproverSignature,
SignatureWithSaltAndExpiry memory operatorSignature
) external onlyWhenNotPaused(PAUSED_REGISTER_OPERATOR) {
require(operatorKickParams.length == quorumNumbers.length, "RegistryCoordinator.registerOperatorWithChurn: input length mismatch");

require(!isUsingOperatorSets(), OperatorSetsEnabled());
Copy link
Contributor

Choose a reason for hiding this comment

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

If we want to enable the same functionality pre and post operatorSets, how do we handle churn once an AVS has started using operatorSets?

_cancelSlashingRequest(requestId);
}

function fulfillSlashingRequest(uint256 requestId) external virtual onlySlasher {
Copy link
Collaborator

Choose a reason for hiding this comment

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

This modifier is a bit confusing because from the SM perspective this contract is the Slasher but the VetoableSlasher also has a designated slasher address? I guess this can be overrided to be permissionless or to be some other permissioned contract 'slasher'

* refactor: uam

* feat: add uam interfaces

* fix: lookahead period to blocks

* fix: tests

* chore: storage report
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