Skip to content

Conversation

8sunyuan
Copy link
Contributor

@8sunyuan 8sunyuan commented Aug 16, 2024

Draft for changing allocate/deallocate to just setAllocations which can specify absolute magnitude values vs previously we had magnitudeDiffs. Depending on the current magnitude value assigned for the (op, Strategy, opSet) tuple, it will either allocate/deallocate accordingly.

NOTE: in setAllocations any magnitude values that are equal to the current value are ignored as it is neither a allocation or deallocation.

Additional changes included:

  • expectedTotalMagnitude check
  • initializeable allocationDelays that could be set one time by an operator's allocator
  • Checkpoints library optimization: reuse length check in upperLookupRecentWithPos

@8sunyuan 8sunyuan marked this pull request as draft August 16, 2024 22:47
Copy link

Reading tracefile ./lcov.info.pruned
                                             |Lines      |Functions|Branches  
Filename                                       |Rate    Num|Rate  Num|Rate   Num
================================================================================
[src/contracts/]
core/AVSDirectory.sol                          |41.7%   144|57.6%  33|    -    0
core/DelegationManager.sol                     |95.5%   200|90.0%  40|    -    0
core/RewardsCoordinator.sol                    |93.2%   148|85.7%  35|    -    0
core/StrategyManager.sol                       |95.2%    83|95.8%  24|    -    0
libraries/BeaconChainProofs.sol                | 100%    22| 100%  11|    -    0
libraries/BytesLib.sol                         | 0.0%   156| 0.0%  14|    -    0
libraries/Checkpoints.sol                      | 0.0%    69| 0.0%  14|    -    0
libraries/EIP1271SignatureUtils.sol            | 100%     3| 100%   1|    -    0
libraries/Endian.sol                           | 100%     2| 100%   1|    -    0
libraries/Merkle.sol                           | 100%    38| 100%   5|    -    0
libraries/StructuredLinkedList.sol             | 0.0%    45| 0.0%  19|    -    0
permissions/Pausable.sol                       |95.7%    23|90.9%  11|    -    0
permissions/PauserRegistry.sol                 | 100%    12| 100%   6|    -    0
pods/EigenPod.sol                              | 100%   122|96.2%  26|    -    0
pods/EigenPodManager.sol                       |98.7%    75|85.7%  14|    -    0
strategies/EigenStrategy.sol                   | 0.0%    10| 0.0%   5|    -    0
strategies/StrategyBase.sol                    |90.9%    44|78.9%  19|    -    0
strategies/StrategyBaseTVLLimits.sol           | 100%    12|83.3%   6|    -    0
strategies/StrategyFactory.sol                 |94.3%    35|88.9%   9|    -    0
token/BackingEigen.sol                         |72.0%    25|50.0%  10|    -    0
token/Eigen.sol                                |38.5%    39|50.0%  12|    -    0
utils/UpgradeableSignatureCheckingUtils.sol    | 0.0%     6| 0.0%   4|    -    0
================================================================================
                                       Total:|67.1%  1313|68.3% 319|    -    0

Copy link

Reading tracefile ./lcov.info.pruned
                                             |Lines      |Functions|Branches  
Filename                                       |Rate    Num|Rate  Num|Rate   Num
================================================================================
[src/contracts/]
core/AVSDirectory.sol                          |41.7%   144|57.6%  33|    -    0
core/DelegationManager.sol                     |95.5%   200|90.0%  40|    -    0
core/RewardsCoordinator.sol                    |93.2%   148|85.7%  35|    -    0
core/StrategyManager.sol                       |95.2%    83|95.8%  24|    -    0
libraries/BeaconChainProofs.sol                | 100%    22| 100%  11|    -    0
libraries/BytesLib.sol                         | 0.0%   156| 0.0%  14|    -    0
libraries/Checkpoints.sol                      | 0.0%    69| 0.0%  14|    -    0
libraries/EIP1271SignatureUtils.sol            | 100%     3| 100%   1|    -    0
libraries/Endian.sol                           | 100%     2| 100%   1|    -    0
libraries/Merkle.sol                           | 100%    38| 100%   5|    -    0
libraries/StructuredLinkedList.sol             | 0.0%    45| 0.0%  19|    -    0
permissions/Pausable.sol                       |95.7%    23|90.9%  11|    -    0
permissions/PauserRegistry.sol                 | 100%    12| 100%   6|    -    0
pods/EigenPod.sol                              | 100%   122|96.2%  26|    -    0
pods/EigenPodManager.sol                       |98.7%    75|85.7%  14|    -    0
strategies/EigenStrategy.sol                   | 0.0%    10| 0.0%   5|    -    0
strategies/StrategyBase.sol                    |90.9%    44|78.9%  19|    -    0
strategies/StrategyBaseTVLLimits.sol           | 100%    12|83.3%   6|    -    0
strategies/StrategyFactory.sol                 |94.3%    35|88.9%   9|    -    0
token/BackingEigen.sol                         |72.0%    25|50.0%  10|    -    0
token/Eigen.sol                                |38.5%    39|50.0%  12|    -    0
utils/UpgradeableSignatureCheckingUtils.sol    | 0.0%     6| 0.0%   4|    -    0
================================================================================
                                       Total:|67.1%  1313|68.3% 319|    -    0

Copy link

Reading tracefile ./lcov.info.pruned
                                             |Lines      |Functions|Branches  
Filename                                       |Rate    Num|Rate  Num|Rate   Num
================================================================================
[src/contracts/]
core/AVSDirectory.sol                          |41.4%   145|57.6%  33|    -    0
core/DelegationManager.sol                     |95.5%   200|90.0%  40|    -    0
core/RewardsCoordinator.sol                    |93.2%   148|85.7%  35|    -    0
core/StrategyManager.sol                       |95.2%    83|95.8%  24|    -    0
libraries/BeaconChainProofs.sol                | 100%    22| 100%  11|    -    0
libraries/BytesLib.sol                         | 0.0%   156| 0.0%  14|    -    0
libraries/Checkpoints.sol                      | 0.0%    69| 0.0%  14|    -    0
libraries/EIP1271SignatureUtils.sol            | 100%     3| 100%   1|    -    0
libraries/Endian.sol                           | 100%     2| 100%   1|    -    0
libraries/Merkle.sol                           | 100%    38| 100%   5|    -    0
libraries/StructuredLinkedList.sol             | 0.0%    45| 0.0%  19|    -    0
permissions/Pausable.sol                       |95.7%    23|90.9%  11|    -    0
permissions/PauserRegistry.sol                 | 100%    12| 100%   6|    -    0
pods/EigenPod.sol                              | 100%   122|96.2%  26|    -    0
pods/EigenPodManager.sol                       |98.7%    75|85.7%  14|    -    0
strategies/EigenStrategy.sol                   | 0.0%    10| 0.0%   5|    -    0
strategies/StrategyBase.sol                    |90.9%    44|78.9%  19|    -    0
strategies/StrategyBaseTVLLimits.sol           | 100%    12|83.3%   6|    -    0
strategies/StrategyFactory.sol                 |94.3%    35|88.9%   9|    -    0
token/BackingEigen.sol                         |72.0%    25|50.0%  10|    -    0
token/Eigen.sol                                |38.5%    39|50.0%  12|    -    0
utils/UpgradeableSignatureCheckingUtils.sol    | 0.0%     6| 0.0%   4|    -    0
================================================================================
                                       Total:|67.0%  1314|68.3% 319|    -    0

This was referenced Aug 17, 2024
@8sunyuan 8sunyuan marked this pull request as ready for review August 19, 2024 18:53
@8sunyuan 8sunyuan merged commit 4956990 into slashing-magnitudes Aug 19, 2024
7 of 11 checks passed
@8sunyuan 8sunyuan deleted the set-allocations branch August 19, 2024 19:14
ypatil12 pushed a commit that referenced this pull request Aug 29, 2024
* feat: set allocations

* cleanup

* fixes

* fix perms on modifyAllocations

* fix initialization issues

* feat: operatorSignature and remove allocator

* build: bindings

* fix: max allocation updates check

---------

Co-authored-by: gpsanant <[email protected]>
8sunyuan added a commit that referenced this pull request Aug 30, 2024
* feat: set allocations

* cleanup

* fixes

* fix perms on modifyAllocations

* fix initialization issues

* feat: operatorSignature and remove allocator

* build: bindings

* fix: max allocation updates check

---------

Co-authored-by: gpsanant <[email protected]>
8sunyuan added a commit that referenced this pull request Sep 12, 2024
* feat: set allocations

* cleanup

* fixes

* fix perms on modifyAllocations

* fix initialization issues

* feat: operatorSignature and remove allocator

* build: bindings

* fix: max allocation updates check

---------

Co-authored-by: gpsanant <[email protected]>
8sunyuan added a commit that referenced this pull request Sep 12, 2024
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]>
8sunyuan added a commit that referenced this pull request Sep 12, 2024
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]>
0xClandestine added a commit that referenced this pull request Sep 17, 2024
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]>
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.

2 participants