Skip to content

Conversation

@0x0aa0
Copy link
Contributor

@0x0aa0 0x0aa0 commented Dec 19, 2024

No description provided.

stevennevins and others added 30 commits April 5, 2024 12:42
* chore: use foundry.toml settings from core

* chore: update pragma from =0.8.12 to ^0.8.12

* chore: update submodules
* Update README.md

* docs: mainnet deployment

* nit: mainnet branch

* docs: expand proxy addresses and reference mainnet branch

---------

Co-authored-by: wadealexc <[email protected]>
* feat: ejector

* improvments

- trailing window
- try/catch ejection

* percentage

* fix

* nits

* feat: non signing metric helpers

- adds operatorId on reg and dereg events
- adds function to OperatorStateRetriever to get bitmaps for a set of operators at a timestamp

* fix: conflict

* refactor: ejection

* fix: stake recording

* test: unit

* style: natspec

* fix: totalEjected > totalEjectable

nit: else
* Use uint32 for number of ejected operators

* fix test
* feat: service manager payments

* test: unit tests

* feat: refactor serviceManager interfaces

* chore: requested changes
* feat: batch operator id conversions

* docs: natspec
* fix: vm assume too many rejections

* fix: typo
* feat: rereg delay

* test: fix tests

* chore: natspec

* test: unit

* fix: grief

* refactor: ejection manager

* fix: units

* fix: name nit

* docs: ejector dev tag
* feat: add ecdsa service manager

* feat: split up signature checking from stake regsitry

* feat(wip): add external calls to stake registry from signature checker

* test: setup signature checker unit tests

* feat: add ui related function implementations

* chore: remove separating signature checker for now

* chore: remove unused test file

* docs: add natspec and inherit doc for clarity

* docs: add more natspec documentation

* refactor: update logic to internal functions that are internal and virtual

* docs: add more documentation to the internal functions

* chore: update external functions to also be overrideable
#251)

* fix: init function for staleStakesForbidden in BLSSignatureChecker

* chore: formatting use forge fmt

* chore: remove initialiable
* chore: update license

adds an Additional Use Grant and updates the change dates of the repository

* chore: formatting. add line breaks for consistency
* feat: add operator key rotation

* test: update existing tests to account for signing key

* fix: frontrunning with different signing key

* test: verify the checkpoint logic for the signing keys

* feat: improve event for signing key update

* chore: clean up test function names and order functions

* fix: storage layout gap

* feat: prevent signing at current block

* test: add two more test cases for RBN

* fix: typo in function signature

* chore: remove unnecessary test contract

* fix: typo for invalid quorum

* fix: invalidQuorum -> validQuorum for NotOwner test
* feat: payment initiator integration

- creating ServiceManagerBaseStorage
- adding paymentInitiator storage var to ServiceManagerBase
- adding ability for owner to change paymentInitiator
- formatting based on forge fmt for contracts modified

* fix: typos

* fix: remediations

- removing erroneous gap from `ServiceManagerBase`
- typo 50 to 49
- making inheritance backward compatible
…269)

* fix: deprecated struct field for earning receiver

* perf: move modifier logic to internal function
* fix: deprecated struct field for earning receiver

* perf: move modifier logic to internal function
…#266)

* fix: deprecated struct field for earning receiver

* refactor: require statements to internal functions

* test: update revert reason strings
stevennevins and others added 29 commits January 27, 2025 19:25
* Update LICENSE (#285)

* chore: upgrade core to target operator set release

* chore: update mock contracts with latest interfaces (#293)

* chore: update mock contracts with latest interfaces

* chore: bump to latest operator set release commits

* chore: fixes for depedency bump

* feat: operator set migration-1-migration (#286)

* 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

* feat: operator set migration-2-create quorum (#287)

* 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: bump operator set release dependency in core

* chore: updates from dependency bump

* feat: add natspec

* docs: add natspec

* feat: add checks operator was registered for quorums when migrating

* fix: resolve code size issue in RegistryCoordinator

* chore: update to latest core (#299)

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

* chore: add method to mock

* feat(op sets): update stakes when forceUnregister (#300)

* 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(op sets): register and deregister (#301)

* 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(op sets): upgrade and migrate script (#303)

* feat: upgrade and test pre prod upgrade and migration

* fix: add param introduced in merge

* chore: bump slashing core dependency (#312)

* 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

* feat: slasher templates / examples (#310)

* 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

* chore: remove unused test util contracts (#319)

* feat: remove both option

* chore: remove unused test util contracts

* chore: remove diff

* feat: remove both option

* fix: storage gap remove one slot (#320)

* feat: track total slashable stake and total delegated stake per quorum (#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

* fix: use libraries with only internal vis (#324)

* fix: revert making library function vis external

* fix: signature checker internal

* feat: avs registrar registration flow changes (#318)

* feat: remove both option

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

* test: resolve some breaking changes to tests

* chore: bump core dependency

* chore: bump dependency

* chore: bump to latest slashing mags

* fix: creation of registry coordinator

* test: wip

* feat: integrate registrar interfaces

* test: add function to delegation mock to set operator status

* test: additional test case

* chore: bumping core dep and adding UAM (#325)

* test: use permission controller mock

* chore: label fuzz tests

* test: various fixes from config changes

* chore: remove comment

* test: fix permission controlled functions

* test: fix config issue in integration tests

* test: fix avs directory initialize

* feat: wip prevent m2 registration flows after migration

* feat: registration changes part 2

* 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

* chore: bump dependency for slashing mags updates (#329)

* fix: internal slashing security review (#332)

* 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: revert cases

* chore: bump core dependency to pull in latest updates

* fix: slashing review fixes (#333)

* 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

* chore: bump core dependency

* chore: bump forge-std

* docs: update readme with note on slashing (#341)

* chore: bump core fix iface changes (#352)

* chore: bump dep

* fix: iface changes and param names

* feat: ci storage reports (#347)

* feat: storage reports

* fix: storage report

* fix: storage report

* fix: ci

* fix: ci

* fix: ci

* fix: ci

* fix: ci

* fix: prevent calling enable operator sets twice and use internal function for checkALM

* chore: address review comments

* refactor: custom errors in middleware (#355)

* refactor: custom errors

* fix: unit tests

* chore: review remove setStakeType

* fix: wire up stake registry to call add and rm strategies for op set

* refactor: slashing UAM (#357)

* refactor: uam

* feat: add uam interfaces

* fix: lookahead period to blocks

* fix: tests

* chore: storage report

* feat: ci forge coverage (#349)

* feat: ci forge coverage

* fix: ci

* feat: add forge fmt to ci (#363)

* feat: ci forge fmt

* chore: forge fmt

* feat: add register with churn type (#360)

* 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 (#361)

* 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]>

* fix: commented out view (#373)

* refactor: natspec + interface changes (#364)

* 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]>

* chore: forge fmt

* feat: storage gap on socket registry

* chore: remove unused storage; update bindings

* chore: nuke storage report script for now on ci

---------

Co-authored-by: Gautham Anant <[email protected]>
Co-authored-by: Madhur Shrimal <[email protected]>
Co-authored-by: Nadir Akhtar <[email protected]>
Co-authored-by: clandestine.eth <[email protected]>
Co-authored-by: Michael Sun <[email protected]>
Co-authored-by: Yash Patil <[email protected]>
Co-authored-by: Michael Sun <[email protected]>
* refactor: ci

* fix: ci

* fix(test): remove vm assumes

* chore: forge fmt
* chore(deps): update submodule lib/eigenlayer-contracts to rewardsv2.1 commit (5341ef)

* chore: address build issues after updating dependency

* chore: run forge fmt

* chore: bumped foundry version
Co-authored-by: Noel <[email protected]>
Co-authored-by: Yash Patil <[email protected]>
Co-authored-by: steven <[email protected]>
Co-authored-by: afk <[email protected]>
Co-authored-by: Gautham Anant <[email protected]>
Co-authored-by: Michael Sun <[email protected]>
Co-authored-by: Michael Sun <[email protected]>
Co-authored-by: Nadir Akhtar <[email protected]>
Co-authored-by: gpsanant <[email protected]>
Co-authored-by: steven <[email protected]>
Rationale:

- Maintaining arbitrary block range log indexing offchain is very
expensive (rpc calls), error prone, and introduces a lot of bug vectors
- The added gas cost in comparison to the rest of the transaction is
negligible
- This would enable retrieving all information needed for the
`checkSignatures` entrypoint from a view function, instead of needing to
maintain offchain indexing services coupled to signature verification
for an arbitrary submitter of signatures




cc @stevennevins @supernovahs

---------

Co-authored-by: steven <[email protected]>
Co-authored-by: 0xwildhare <[email protected]>
**Motivation:**

Increase coverage over `ServiceManagerBase` 

**Modifications:**

Add unit tests for `setClaimerFor`

**Result:**

Increased coverage
)

**Motivation:**

Increases coverage of `IndexRegsitry`

**Modifications:**

Add unit test for `getQuorumUpdateAtIndex`

**Result:**

Coverage increase

Co-authored-by: steven <[email protected]>
**Motivation:**

This PR extends the test coverage of the `StakeRegistry`. 



**Modifications:**
Specifically targeting coverage over the following functions:

`getStakeHistory`
`getStakeHistoryAtIndex`
`setSlashableStakeLookAhead`
Fuzzing unit tests have been for each of the above as well as including
`getStakeHistory` and `getStakeHistoryAtIndex` into the fuzzing operator
registration and deregistration tests.

**Result:**

Increased coverage
**Motivation:**

Documentation is out of date wrt to the code. 

**Modifications:**

Update the `avs-guide`

**Result:**

up to date documentation and increased devex
…or` (#420)

**Motivation:**

With the slashing release documentation updates are needed

**Modifications:**

Updated `RegistryCoordinator.md`, add `SlashingRegistryCoordinator.md.`

**Result:**

*After your change, what will change.*
**Motivation:**

Documentation was missing for the `EjectionManager`

**Modifications:**

Add `EjectionManager.md`

**Result:**

Increased documentation coverage

---------

Co-authored-by: steven <[email protected]>
**Motivation:**

There is no documentation for the slasher contracts

**Modifications:**

Added:
- `SlasherBase.md`
- `VetoableSlasher.md`
- `InstantSlasher.md`

**Result:**

Increased documentation coverage

---------

Co-authored-by: steven <[email protected]>
**Motivation:**

Registry contracts are out of date

**Modifications:**

Updated the existing registry docs and added `SocketRegistry.md`

**Result:**

---------

Co-authored-by: steven <[email protected]>
**Motivation:**

The `ServiceManager` docs were out of date with the new slashing release

**Modifications:**

Updated `ServiceManager.md`

**Result:**

Updated `ServiceManager` documentation to match the new code changes

---------

Co-authored-by: steven <[email protected]>
**Motivation:**

`OperatorStateRetriever` had no documentation

**Modifications:**

Added `OperatorStateRetriever.md`

**Result:**

Increase documentation coverage

---------

Co-authored-by: steven <[email protected]>
**Motivation:**

The documentation is out of date

**Modifications:**

Updated `docs/README.md`

**Result:**

Updated documentation

---------

Co-authored-by: steven <[email protected]>
Motivation:
The core dependency was updated to OZ 4.9.0 a while ago. Now, it uses a
contract only in 4.9.0, making it incompatible with 4.7.1 in this repo.
Updating to 4.9.0 results in a breaking change to the
TransparentUpgradeableProxy interface. These changes need to be
addressed to maintain compatibility with the core protocol.

Modifications:
Updated TransparentUpgradeableProxy usage:
Modified imports to include ITransparentUpgradeableProxy alongside
TransparentUpgradeableProxy
Updated proxy upgrade calls to cast to ITransparentUpgradeableProxy
instead of TransparentUpgradeableProxy
Fixed ERC20Mock constructor errors:
Updated ERC20Mock in test files to use the new constructor pattern
Removed parameters from ERC20Mock constructor calls as the new version
no longer accepts name, symbol, initialAccount, and initialBalance
parameters

Result:
After these changes, middleware is compatible with the future EigenLayer
core v1.3.0
**Motivation:**

absolute imports cause issues for integrators and downstream
dependencies

**Modifications:**

Updated absolute import paths to be relative 

**Result:**

No more absolute imports used in the repo
**Motivation:**

Right now we only have integration tests for the slashing registry
coordinator

**Modifications:**

Add helpers, setup, and unit tests for the slashing registry coordinator

**Result:**

have code coverage for this contract
**Motivation:**

At high fuzz runs the tests for the getting an apk before the first
update rejects too many inputs

**Modifications:**

Bound the input and reuse those thrown away inputs

**Result:**

CI should pass
**Motivation:**

Need for a full e2e test against holesky.

**Modifications:**

Added `End2End.t.sol` 

**Result:**

increased coverage of M2 migration flow for the registry coordinator
**Motivation:**

Workflow is error prone and not providing value

**Modifications:**

Removing code size checking diff from CI we are already failing if we go
over the code size limit which is the most important check

**Result:**

Less finicky CI runs
**Motivation:**

Tagging a branch with updated core dependency for testing CLI/SDKs

**Modifications:**

Fix build issues and update inputs for rewards tests

**Result:**

Working build for generating bindings for sdks/clis/examples
**Motivation:**

EIP712 in 4.7.0 did not have any storage. In 4.9.0 it has 2 slots of
storage which would have caused a storage layout shift based on it's
location in the inheritance graph for RegistryCoordinators going through
an upgrade

**Modifications:**

Reorder inheritance, switch to the upgradeable version, and fix build
issues that arose from the updates by adding the constructor params to a
struct

**Result:**

Fixed the storage layout issue that would have arisen
**Motivation:**

It's more intuitive to slash and operator and atomically update their
weight

**Modifications:**

add a call to updateOperators to update the view the AVS has of their
weight in the registry coordinator

**Result:**

More intutive UX
**Motivation:**

Needs to be maintained for storage layout compatibility for the
RegistryCoordinator

**Modifications:**

Add back the registries array as a place holder for the slot it used to
take up

**Result:**

Storage layout will be compatible with prior version
**Motivation:**

The core contracts will be deploying v1.4.0 to testnet tomorrow. This
release bumps the core contracts to that release to be compatible with
what will be live on holesky

**Modifications:**

Bump the core protocol dependency

**Result:**

Up to date with core contract release 1.4.0
**Motivation:**

Improve coverage on ECDSA Stake Registry 

**Modifications:**

Add tests for edge cases for reverts with Quorum Config updates and
tests for event emission

**Result:**

improved test coverage
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.