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

stake root #723

Open
wants to merge 60 commits into
base: slashing-magnitudes
Choose a base branch
from
Open

stake root #723

wants to merge 60 commits into from

Conversation

gpsanant
Copy link
Contributor

@gpsanant gpsanant commented Sep 2, 2024

The StakeRootCompendium

core

  • MAX_TOTAL_CHARGE make this a storage var and settable
  • fix reversion of getOperatorSetLeaves for >=150 operators
  • keep strategies around after rejoining
  • Not blocking initial review or merging
    • actual proof verification.
    • operatorSetRoot proofs
    • blacklisting protocol
    • submission consumption library

misc

  • the setters and externally callable functions need natspec
  • better line comments where helpful
  • a better name for
    • MIN_PROOFS_DURATION
    • chargePerProof
    • rootConfirmer

notes for the initial review

We mainly want feedback on

  • large architectural suggestions
  • disagreements on behavior in certain cases
  • suggestions for a blacklisting protocol
    • currently im thinking the pauser can blacklist on the ops can reverse a blacklist, but im not sure...

src/contracts/core/AVSDirectory.sol Fixed Show fixed Hide fixed
src/contracts/core/StakeRootCompendium.sol Fixed Show fixed Hide fixed
src/contracts/core/StakeRootCompendium.sol Fixed Show fixed Hide fixed
src/contracts/core/StakeRootCompendium.sol Fixed Show fixed Hide fixed
src/contracts/core/StakeRootCompendium.sol Fixed Show fixed Hide fixed
src/contracts/core/StakeRootCompendium.sol Fixed Show fixed Hide fixed
src/contracts/core/StakeRootCompendium.sol Fixed Show fixed Hide fixed
src/contracts/core/StakeRootCompendium.sol Fixed Show fixed Hide fixed
@8sunyuan 8sunyuan force-pushed the slashing-magnitudes branch 4 times, most recently from 33c32ac to 835a62f Compare September 12, 2024 22:01
src/contracts/core/AVSDirectory.sol Fixed Show fixed Hide fixed
src/contracts/core/AVSDirectory.sol Fixed Show fixed Hide fixed
src/contracts/core/AVSDirectory.sol Fixed Show fixed Hide fixed
src/contracts/pods/EigenPodManager.sol Fixed Show fixed Hide fixed
src/contracts/core/StakeRootCompendium.sol Fixed Show fixed Hide fixed
src/contracts/core/StakeRootCompendium.sol Fixed Show fixed Hide fixed
src/contracts/core/StakeRootCompendium.sol Fixed Show fixed Hide fixed
src/contracts/core/StakeRootCompendium.sol Fixed Show fixed Hide fixed
src/contracts/core/StakeRootCompendium.sol Fixed Show fixed Hide fixed
src/contracts/core/StakeRootCompendium.sol Fixed Show fixed Hide fixed
src/contracts/core/StakeRootCompendium.sol Fixed Show fixed Hide fixed
src/contracts/core/StakeRootCompendium.sol Fixed Show fixed Hide fixed
8sunyuan and others added 19 commits September 17, 2024 12:25
* feat: functionality

* test: add tests

* chore: address comments

* chore: bindigns and fmt

fix: block m2 deregistrations for opset AVSs (#688)

* fix: prevent opSet AVS from m2 dereg

* fix: naming

build: bindings

chore: compilation & bindings

Feat: enumerating sets operators are in (#662)

* feat: track sets operators in

* feat: add natspec

* refactor: reorganize

* fix: tests passing

* fix: compile warnings

* fix: test passing

* feat: add `operatorSetsMemberOf` pagination

* test: add coverage

* chore: bindings

---------

fix: fix operator commission tests (#673)

* fix: flakey tests

* build: bindings

* fix: out of gas error

fix: deploy config

fix: deployers

chore: bindings

chore: update gap

chore: address comments

feat: remove storage (#667)

feat: operator set rewards (#663)

* feat: operator set rewards

* chore: forge fmt

* feat: add operator set retroactive length & genesis timestamp

* docs: add deprecation note and fix typo

* build: bindings

* feat: add tests

* chore: bindings

---------

feat: track total members and sets (#649)

* feat: track total members and sets

* test: track total members and sets

* fix: review changes

* refactor: review changes

* test: register multiple sets

* test: deregister multiple sets

* test: fuzz set creation

fix: compiling from conflict fix

also pushed updated bindings

feat: operator commission bips (#627)

* feat: operator commission bips

configured with a delay

* build: bindings

* fix: interfaces and comments

* fix: storage gap and comments

* chore: tests cleanup

* build: bindings

* chore: `forge fmt src/contracts`

* feat: `operatorCommissionUpdates` length getter

* fix: remove unused imports

* fix: optimizations

* chore: uncheckeds and remove dup view

* build: bindings

* chore: format

---------

feat: operator set migration; completely separate legacy and opset reg (#636)

* feat: bring back full storage; segregate events

* feat: make operator set creation w/arrays; update interface

* fix: update natspec

* feat: update force dereg func

* chore: fmt

* feat: operator set migration (#637)

* feat: add migration

* test: add unit tests for migration

* chore: format

* fix: check operator set avs in parent func

* fix: compilation

* chore: format

* feat: bring back opertor set struct (#639)

test: operator set initialization

feat: operator set initialization

feat: add missing interface fns

feat: add missing interface fns

refactor: remove OperatorSet struct

test: forced opset dereg

chore: forge fmt src/contracts

feat: forced opset dereg

chore: forge fmt

refactor: rename isOperatorInOperatorSet -> isMember

feat: remove simp mode

chore: improve comments + naming

fix: variable name consistency

nit: move updateStandbyParams fn

refactor: storage optimization/overhaul

refactor: remove unused beaconChainETHStrategy constant

refactor: remove isOperatorSetAVS mapping

nit: improve comments

chore: run `forge fmt src/contracts`

chore: run

fix: remove unused immutable

Feat/operator sets (#579)

* feat: operator set scaffold

* fix: impl/storage compile errors; pending updating of tests

* chore: `forge fmt`

* fix: `OperatorSet` struct misuse

* fix: comment

* chore: verbose use of `OperatorSet`

* test: `registerOperatorToOperatorSet`

* feat: `registerOperatorToOperatorSets`

Enables registering multiple operator sets in a single call.

* chore: `forge fmt`

* feat: interface changes

* fix: operator set digest

* fix: `OPERATOR_SET_REGISTRATION_TYPEHASH`

* chore: `forge fmt`

* test: wrong avs using signature

* fix: optimize for SSTOREs

* test: `deregisterOperatorFromOperatorSets`

* chore: rename `operatorSetStrategies`

* test: `addStrategiesToOperatorSet`

* test: `removeStrategiesFromOperatorSet`

* test: more coverage

* chore: improve natspec

* WIP: simp mode

* WIP: simp mode

* WIP: simp mode

- includes interface change, specifically the `StandbyParams` structure. `id` isn't needed for storage.

* test: simp mode

* test: simp mode

* test: simp mode

* refactor: simp mode storage

* Revert "refactor: simp mode storage"

This reverts commit 3b0450e.

* Reapply "refactor: simp mode storage"

This reverts commit 5f90d78.

* feat: simp mode

* fix(optimize): salt cancellation

- remove check

* test: improvements

* test: improvements

* fix: move `isOperatorSetAVS` update out of loop

ooops

* fix: standby update typehash

* test: cleanup

* fix: move mutation out of loop

* nit: cleanup

* fix: remove unused events

---------

Co-Authored-By: Yash Patil <[email protected]>
Co-Authored-By: clandestine.eth <[email protected]>
* feat: operator commission bips

configured with a delay

* build: bindings

* fix: interfaces and comments

* fix: storage gap and comments

* chore: tests cleanup

* build: bindings

* chore: `forge fmt src/contracts`

* feat: `operatorCommissionUpdates` length getter

* fix: remove unused imports

* fix: optimizations

* chore: uncheckeds and remove dup view

* build: bindings

* chore: format

---------

Co-authored-by: clandestine.eth <[email protected]>
feat: encoded operatorSet mapping keys and duplicate check (#704)

* feat: operatorSet encoded mapping keys

* chore: natspec

* refactor: add allocationDelay require

chore: add back legacy functions

chore: update interfaces and nits

feat: update to max 1 alloc/dealloc (#703)

* feat: update to max 1 alloc/dealloc

* fix: naming

* fix: compile

build: bindings

feat: getAllocatableMagnitude

feat: set allocations (#691)

* feat: set allocations

* cleanup

* fixes

* fix perms on modifyAllocations

* fix initialization issues

* feat: operatorSignature and remove allocator

* build: bindings

* fix: max allocation updates check

---------

feat: allocator signatures allocate/deallocate (#690)

* feat: operator commission bips (#627)

* feat: operator commission bips

configured with a delay

* build: bindings

* fix: interfaces and comments

* fix: storage gap and comments

* chore: tests cleanup

* build: bindings

* chore: `forge fmt src/contracts`

* feat: `operatorCommissionUpdates` length getter

* fix: remove unused imports

* fix: optimizations

* chore: uncheckeds and remove dup view

* build: bindings

* chore: format

---------

* feat: refactor to free all opsets on allo/deallo

* refactor: pendingFreeMagnitude and index pointers

* feat: numToComplete and rebase cleanup

* feat: allocator signature

* feat: allocator function in DM

fixed checkpoints typo as well

* build: bindings

---------

Co-authored-by: clandestine.eth <[email protected]>

feat: refactor to free all opsets on allo/deallo (#680)

* feat: operator commission bips (#627)

* feat: operator commission bips

configured with a delay

* build: bindings

* fix: interfaces and comments

* fix: storage gap and comments

* chore: tests cleanup

* build: bindings

* chore: `forge fmt src/contracts`

* feat: `operatorCommissionUpdates` length getter

* fix: remove unused imports

* fix: optimizations

* chore: uncheckeds and remove dup view

* build: bindings

* chore: format

---------

* feat: refactor to free all opsets on allo/deallo

* refactor: pendingFreeMagnitude and index pointers

* chore: nits

* chore: reorder storage

* feat: numToComplete and rebase cleanup

---------

Co-authored-by: clandestine.eth <[email protected]>

chore: add check for pending deallocations

build: bindings

chore: rename back to checkpoints
Co-Authored-By: gpsanant <[email protected]>
Co-Authored-By: clandestine.eth <[email protected]>
* feat: set allocations

* cleanup

* fixes

* fix perms on modifyAllocations

* fix initialization issues

* start on scaledShares

* feat: scale shares on deposits into SM

* chore: cleanup and comment out tests

* feat: withdraws and using timestamps

* chore: delete and comment test files

* fix: descale timestamp

fix descaledShares timestamp and added back
deleted test files but commented out

* chore: add back test files

* fix: _delegate with scaledshares

also removed scaling from strategymanager
and added some additional view functions
Note _delegate still has a pending todo

* fix: _delegate scaled shares

* feat: eigenpodManager scaled shares (#706)

* feat: draft for scaled shares epm

* chore: fix compile

* chore: fmt

* nit: comment

* fix: add comment suggestion

Co-authored-by: Gautham Anant <[email protected]>

---------

Co-authored-by: Gautham Anant <[email protected]>

* feat: move allocationDelay to delegationManager

* fix: incorrect inequality check

* chore: rename epm internal function to scaled

* fix: external interface nits

* chore: cleanup sharescaling lib

* chore: fix variable naming nit

---------

Co-authored-by: Michael Sun <[email protected]>
Co-authored-by: Michael Sun <[email protected]>
* chore: some changes for making deployments

* fix: addressed comments

* fix: addressed comments
also avoids sload in a few cases
* chore: add missing deploy script

* chore: delete src files
gpsanant and others added 3 commits September 20, 2024 15:30
* add share lib

* feat: share lib cleanup (#778)

* refactor: review changes

* chore: forge fmt src/contracts

* refactor: more explicit share names

* rename share

* fmt

---------

Co-authored-by: gpsanant <[email protected]>

* remove unused

* remove unused

---------

Co-authored-by: clandestine.eth <[email protected]>
* cleanup am

* timestmaps and inequalities

* remove unused view funcs
gpsanant and others added 11 commits September 24, 2024 11:12
* chore: forge fmt src/contracts

* nit: organize imports

* fix: bump pragma -> ^0.8.27

* refactor(optimization): significantly reduce sloads/sstores

* refactor: custom errors

* refactor(optimization): significantly reduce sloads/sstores

missed some stuff

* refactor: rename compendium -> manager

* refactor: more storage optmizations

* feat: safe eth transfer helper

* refactor: manager -> compendium

* refactor: variable renaming

* refactor: rename compendium -> manager

* feat: add `proofIntervalSeconds` getter

* feat: fixed accounting bug and refactoring (#767)

* refactor: review reconciliations

* refactor: review reconciliations

* fix: rename colluding param

* fix: types and naming

* fix: revert stakeroot calculation changes

* fix: revert stakeRoot calc views

---------

Co-authored-by: shotaro <[email protected]>
bytes32 public immutable imageId;

/// @notice the total number of strategies among all operator sets (with duplicates)
uint256 public totalStrategies;

Check warning

Code scanning / Slither

State variables that could be declared constant Warning

@wadealexc wadealexc force-pushed the slashing-magnitudes branch 2 times, most recently from f62d94e to 069c669 Compare October 4, 2024 15:06
@ypatil12 ypatil12 force-pushed the slashing-magnitudes branch 5 times, most recently from e94d7d9 to d98c5a7 Compare October 17, 2024 07:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants