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: partial withdrawal batching #515

Merged
merged 5 commits into from
Aug 9, 2024
Merged

Conversation

wadealexc
Copy link
Collaborator

@wadealexc wadealexc commented Apr 16, 2024

Mostly uses the design described here, but have made some tweaks.

Notes:

  • Beacon chain timestamps: moving off of Succinct means we actually use timestamps differently, and we need to make sure this doesn't cause any issues.
    • startCheckpoint sets a checkpoint timestamp of block.timestamp and uses the parent beacon block root for checkpoint proofs. This means the checkpoint timestamp technically corresponds to the slot AFTER the beacon block root.
    • OTOH, Succinct's oracle timestamps use the slot that the beacon block root comes from.

*/
function _updateCheckpoint(Checkpoint memory checkpoint) internal {
if (checkpoint.proofsRemaining == 0) {
int256 totalShareDelta =
Copy link
Contributor

Choose a reason for hiding this comment

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

this isn't a delta?

Copy link
Contributor

Choose a reason for hiding this comment

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

in addition, this needs to be a multiple of gwei (required by EPM), which may be invalidated by selfdestruct. we should probably get rid of that requirement

Copy link
Collaborator Author

@wadealexc wadealexc Apr 17, 2024

Choose a reason for hiding this comment

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

this isn't a delta?

yes it is

in addition, this needs to be a multiple of gwei (required by EPM), which may be invalidated by selfdestruct. we should probably get rid of that requirement

it is a multiple of gwei. check the commits/code again, i did some renaming and reorganizing that makes this clearer.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

the question of what to do with any < 1 gwei amount left over is a good question though. i'm not 100% sure what to do with it.

src/contracts/pods/EigenPod.sol Fixed Show fixed Hide fixed
src/contracts/pods/EigenPodStorage.sol Dismissed Show dismissed Hide dismissed
src/contracts/pods/EigenPodManagerStorage.sol Fixed Show fixed Hide fixed
src/contracts/pods/EigenPod.sol Fixed Show fixed Hide fixed
src/contracts/pods/EigenPod.sol Fixed Show fixed Hide fixed
Comment on lines +219 to +198
// The assumption is that if this is the case, any withdrawn ETH was already in
// the pod when `startCheckpoint` was originally called.
Copy link
Contributor

Choose a reason for hiding this comment

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

is this an OK assumption? seems like the ETH could ultimately be recovered/proven in a subsequent checkpoint?
mostly making sure there is no case where ETH could get stuck.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Should be a good assumption! It's kinda the main thing we need to be true, so if there are problems with it, speak up!

I describe how the assumption works here: https://hackmd.io/@-HV50kYcRqOjl_7du8m1AA/SkJPfqBeC#What-Gets-Snapshotted

@gpsanant
Copy link
Contributor

gpsanant commented Apr 24, 2024

@wadealexc can we add an event when a checkpoint is created with the checkpoint timestamp and the beacon block root

also an event with the index of the validator and the checkpoint timestamp whenever a validator is proven for a checkpoint

@wadealexc
Copy link
Collaborator Author

@wadealexc can we add an event when a checkpoint is created with the checkpoint timestamp and the beacon block root

also an event with the index of the validator and the checkpoint timestamp whenever a validator is proven for a checkpoint

Added 705b81d

Copy link
Contributor

@ChaoticWalrus ChaoticWalrus left a comment

Choose a reason for hiding this comment

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

This is looking 🔥
Seems like there's some other work to review + potentially merge into this first -- e.g. #524 -- but I'm not seeing any other big reason to block merging this right now.

The biggest open question for me is if there are any bad side effects of changing the oracle semantics from returning (beacon block root of timestamp) to returning (parent beacon block root of timestamp), but it sounds like worst case we could pause proofs for ~24 hours preceding an upgrade?

I'm going to recommend a bit more discussion + review in general before merging, but if we want to merge and do some of that work later I could be convinced here.

Thanks for the work that went into this; really appreciating all the explanations in HackMD, the PR itself, code comments, and in discussion ❤️

@ChaoticWalrus
Copy link
Contributor

Decide if startCheckpoint should revert if there's no pod balance to prove. Chris says this would be helpful for the frontend, but we may want to allow 0-balance checkpoints sometimes? Maybe only for stale balances?

On this front, its a little unclear to me quite what the desired behavior should be, but I think just auto-completing the checkpoint is OK, and would be nice and simple from a code clarity perspective.
If you short-circuit in this case, it seems you would have to send the user their funds (instead of reverting)? Otherwise can't ETH get stuck in an EigenPod if someone sends the pod ETH but never points any validators to it?

@wadealexc
Copy link
Collaborator Author

This is looking 🔥 Seems like there's some other work to review + potentially merge into this first -- e.g. #524 -- but I'm not seeing any other big reason to block merging this right now.

i think we should keep this as a feature branch for the time being, and merge to dev when we want to start deploying to a testnet/talking about releases?

i gather the vibe was to keep this and slashing on separate branches for the time being to make sure we could launch this without slashing if we wanted to.

@wadealexc
Copy link
Collaborator Author

Decide if startCheckpoint should revert if there's no pod balance to prove. Chris says this would be helpful for the frontend, but we may want to allow 0-balance checkpoints sometimes? Maybe only for stale balances?

On this front, its a little unclear to me quite what the desired behavior should be, but I think just auto-completing the checkpoint is OK, and would be nice and simple from a code clarity perspective.

I don't think we should auto-complete a checkpoint, because that implies all our validator balances are up to date. We may be talking past each other -- I'm seeing 2 concepts here:

  1. Short-circuiting and auto-completing a checkpoint when activeValidatorCount == 0. This should be fine and is already implemented in this PR. It just means the pod owner has no verified withdrawal creds, so nothing to prove.

  2. What to do when there is no ETH in the pod that hasn't already been backed by shares (i.e. podBalanceGwei is calculated to be 0 on this line).

My idea for this second case is that we could add a bool flag to startCheckpoint that allows you to tell the contract to revert in case you don't want to prove a "useless" checkpoint. IMO we should keep the ability to prove a "useless" checkpoint for something like verifyStaleBalance, for example, which would always want to start a checkpoint, even if it's "useless".

@ChaoticWalrus
Copy link
Contributor

I don't think we should auto-complete a checkpoint, because that implies all our validator balances are up to date. We may be talking past each other -- I'm seeing 2 concepts here:

1. Short-circuiting and auto-completing a checkpoint when `activeValidatorCount == 0`. This should be fine and is already implemented in this PR. It just means the pod owner has no verified withdrawal creds, so nothing to prove.

2. What to do when there is no ETH in the pod that hasn't already been backed by shares (i.e. `podBalanceGwei` is calculated to be 0 on [this line](https://github.com/layr-labs/eigenlayer-contracts/blob/ebb1201e3622953e073b7491de1891ed23343c2f/src/contracts/pods/EigenPod.sol#L574)).

My idea for this second case is that we could add a bool flag to startCheckpoint that allows you to tell the contract to revert in case you don't want to prove a "useless" checkpoint. IMO we should keep the ability to prove a "useless" checkpoint for something like verifyStaleBalance, for example, which would always want to start a checkpoint, even if it's "useless".

Yes, I was totally misunderstanding, my bad. It seems to like we basically need to keep the ability to prove a checkpoint that would not award any additional shares (the non-reverting behavior), but I think a flag that the caller can set to revert in such a scenario seems like a reasonable feature addition.

@Layr-Labs Layr-Labs deleted a comment from github-actions bot Jul 23, 2024
/// @notice Allows the owner of a pod to update the proof submitter, a permissioned
/// address that can call `startCheckpoint` and `verifyWithdrawalCredentials`.
/// @dev Note that EITHER the podOwner OR proofSubmitter can access these methods,
/// so it's fine to set your proofSubmitter to 0 if you want the podOwner to be the
Copy link

Choose a reason for hiding this comment

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

Suggested change
/// so it's fine to set your proofSubmitter to 0 if you want the podOwner to be the
/// so it's fine to set your proofSubmitter to address(0) if you want the podOwner to be the

/// @dev Note that EITHER the podOwner OR proofSubmitter can access these methods,
/// so it's fine to set your proofSubmitter to 0 if you want the podOwner to be the
/// only address that can call these methods.
/// @param newProofSubmitter The new proof submitter address. If set to 0, only the
Copy link

Choose a reason for hiding this comment

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

Suggested change
/// @param newProofSubmitter The new proof submitter address. If set to 0, only the
/// @param newProofSubmitter The new proof submitter address. If set to address(0), only the

Copy link

Reading tracefile ./lcov.info.pruned
                                             |Lines      |Functions|Branches  
Filename                                       |Rate    Num|Rate  Num|Rate   Num
================================================================================
[src/contracts/]
core/AVSDirectory.sol                          |77.8%    27|77.8%   9|    -    0
core/AVSDirectoryStorage.sol                   | 0.0%     1| 0.0%   1|    -    0
core/DelegationManager.sol                     |96.4%   196|92.3%  39|    -    0
core/DelegationManagerStorage.sol              | 100%     3| 100%   1|    -    0
core/RewardsCoordinator.sol                    |93.5%   108|83.3%  30|    -    0
core/RewardsCoordinatorStorage.sol             | 0.0%     9| 0.0%   1|    -    0
core/StrategyManager.sol                       |95.2%    83|95.8%  24|    -    0
core/StrategyManagerStorage.sol                | 0.0%     3| 0.0%   1|    -    0
libraries/BeaconChainProofs.sol                | 100%    24| 100%  10|    -    0
libraries/BytesLib.sol                         | 0.0%   160| 0.0%  14|    -    0
libraries/EIP1271SignatureUtils.sol            | 100%     3| 100%   1|    -    0
libraries/Endian.sol                           | 100%     3| 100%   1|    -    0
libraries/Merkle.sol                           |95.0%    40| 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%   124|96.2%  26|    -    0
pods/EigenPodManager.sol                       |98.7%    75|85.7%  14|    -    0
pods/EigenPodManagerStorage.sol                | 0.0%     5| 0.0%   1|    -    0
strategies/EigenStrategy.sol                   | 0.0%    10| 0.0%   5|    -    0
strategies/StrategyBase.sol                    |89.7%    39|77.8%  18|    -    0
strategies/StrategyBaseTVLLimits.sol           | 100%    12|83.3%   6|    -    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:|71.9%  1075|71.4% 269|    -    0

@Layr-Labs Layr-Labs deleted a comment from github-actions bot Jul 25, 2024
@Layr-Labs Layr-Labs deleted a comment from github-actions bot Jul 25, 2024
@Layr-Labs Layr-Labs deleted a comment from github-actions bot Jul 25, 2024
Copy link

Reading tracefile ./lcov.info.pruned
                                             |Lines      |Functions|Branches  
Filename                                       |Rate    Num|Rate  Num|Rate   Num
================================================================================
[src/contracts/]
core/AVSDirectory.sol                          |77.8%    27|77.8%   9|    -    0
core/AVSDirectoryStorage.sol                   | 0.0%     1| 0.0%   1|    -    0
core/DelegationManager.sol                     |96.4%   196|92.3%  39|    -    0
core/DelegationManagerStorage.sol              | 100%     3| 100%   1|    -    0
core/RewardsCoordinator.sol                    |93.5%   108|83.3%  30|    -    0
core/RewardsCoordinatorStorage.sol             | 0.0%     9| 0.0%   1|    -    0
core/StrategyManager.sol                       |95.2%    83|95.8%  24|    -    0
core/StrategyManagerStorage.sol                | 0.0%     3| 0.0%   1|    -    0
libraries/BeaconChainProofs.sol                | 100%    24| 100%  10|    -    0
libraries/BytesLib.sol                         | 0.0%   160| 0.0%  14|    -    0
libraries/EIP1271SignatureUtils.sol            | 100%     3| 100%   1|    -    0
libraries/Endian.sol                           | 100%     3| 100%   1|    -    0
libraries/Merkle.sol                           |95.0%    40| 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%   124|96.2%  26|    -    0
pods/EigenPodManager.sol                       |98.7%    75|85.7%  14|    -    0
pods/EigenPodManagerStorage.sol                | 0.0%     5| 0.0%   1|    -    0
strategies/EigenStrategy.sol                   | 0.0%    10| 0.0%   5|    -    0
strategies/StrategyBase.sol                    |89.7%    39|77.8%  18|    -    0
strategies/StrategyBaseTVLLimits.sol           | 100%    12|83.3%   6|    -    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:|71.9%  1075|71.4% 269|    -    0

@Layr-Labs Layr-Labs deleted a comment from github-actions bot Jul 29, 2024
Copy link

github-actions bot commented Aug 6, 2024

Reading tracefile ./lcov.info.pruned
                                             |Lines      |Functions|Branches  
Filename                                       |Rate    Num|Rate  Num|Rate   Num
================================================================================
[src/contracts/]
core/AVSDirectory.sol                          |77.8%    27|77.8%   9|    -    0
core/AVSDirectoryStorage.sol                   | 0.0%     1| 0.0%   1|    -    0
core/DelegationManager.sol                     |96.4%   196|92.3%  39|    -    0
core/DelegationManagerStorage.sol              | 100%     3| 100%   1|    -    0
core/RewardsCoordinator.sol                    |93.5%   108|83.3%  30|    -    0
core/RewardsCoordinatorStorage.sol             | 0.0%     9| 0.0%   1|    -    0
core/StrategyManager.sol                       |95.2%    83|95.8%  24|    -    0
core/StrategyManagerStorage.sol                | 0.0%     3| 0.0%   1|    -    0
libraries/BeaconChainProofs.sol                | 100%    24| 100%  10|    -    0
libraries/BytesLib.sol                         | 0.0%   160| 0.0%  14|    -    0
libraries/EIP1271SignatureUtils.sol            | 100%     3| 100%   1|    -    0
libraries/Endian.sol                           | 100%     3| 100%   1|    -    0
libraries/Merkle.sol                           |95.0%    40| 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%   124|96.2%  26|    -    0
pods/EigenPodManager.sol                       |98.7%    75|85.7%  14|    -    0
pods/EigenPodManagerStorage.sol                | 0.0%     5| 0.0%   1|    -    0
strategies/EigenStrategy.sol                   | 0.0%    10| 0.0%   5|    -    0
strategies/StrategyBase.sol                    |89.7%    39|77.8%  18|    -    0
strategies/StrategyBaseTVLLimits.sol           | 100%    12|83.3%   6|    -    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:|71.9%  1075|71.4% 269|    -    0

Copy link

github-actions bot commented Aug 9, 2024

Reading tracefile ./lcov.info.pruned
                                             |Lines      |Functions|Branches  
Filename                                       |Rate    Num|Rate  Num|Rate   Num
================================================================================
[src/contracts/]
core/AVSDirectory.sol                          |77.8%    27|77.8%   9|    -    0
core/AVSDirectoryStorage.sol                   | 0.0%     1| 0.0%   1|    -    0
core/DelegationManager.sol                     |96.4%   196|92.3%  39|    -    0
core/DelegationManagerStorage.sol              | 100%     3| 100%   1|    -    0
core/RewardsCoordinator.sol                    |93.5%   108|83.3%  30|    -    0
core/RewardsCoordinatorStorage.sol             | 0.0%     9| 0.0%   1|    -    0
core/StrategyManager.sol                       |95.2%    83|95.8%  24|    -    0
core/StrategyManagerStorage.sol                | 0.0%     3| 0.0%   1|    -    0
libraries/BeaconChainProofs.sol                | 100%    26| 100%  11|    -    0
libraries/BytesLib.sol                         | 0.0%   160| 0.0%  14|    -    0
libraries/EIP1271SignatureUtils.sol            | 100%     3| 100%   1|    -    0
libraries/Endian.sol                           | 100%     3| 100%   1|    -    0
libraries/Merkle.sol                           |95.0%    40| 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%   125|96.2%  26|    -    0
pods/EigenPodManager.sol                       |98.7%    75|85.7%  14|    -    0
pods/EigenPodManagerStorage.sol                | 0.0%     5| 0.0%   1|    -    0
strategies/EigenStrategy.sol                   | 0.0%    10| 0.0%   5|    -    0
strategies/StrategyBase.sol                    |89.7%    39|77.8%  18|    -    0
strategies/StrategyBaseTVLLimits.sol           | 100%    12|83.3%   6|    -    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:|72.0%  1078|71.5% 270|    -    0

@wadealexc wadealexc force-pushed the feat/partial-withdrawal-batching branch from 193f592 to 60340a8 Compare August 9, 2024 19:01
Copy link

github-actions bot commented Aug 9, 2024

Reading tracefile ./lcov.info.pruned
                                             |Lines      |Functions|Branches  
Filename                                       |Rate    Num|Rate  Num|Rate   Num
================================================================================
[src/contracts/]
core/AVSDirectory.sol                          |77.8%    27|77.8%   9|    -    0
core/AVSDirectoryStorage.sol                   | 0.0%     1| 0.0%   1|    -    0
core/DelegationManager.sol                     |96.4%   196|92.3%  39|    -    0
core/DelegationManagerStorage.sol              | 100%     3| 100%   1|    -    0
core/RewardsCoordinator.sol                    |93.5%   108|83.3%  30|    -    0
core/RewardsCoordinatorStorage.sol             | 0.0%     9| 0.0%   1|    -    0
core/StrategyManager.sol                       |95.2%    83|95.8%  24|    -    0
core/StrategyManagerStorage.sol                | 0.0%     3| 0.0%   1|    -    0
libraries/BeaconChainProofs.sol                | 100%    26| 100%  11|    -    0
libraries/BytesLib.sol                         | 0.0%   160| 0.0%  14|    -    0
libraries/EIP1271SignatureUtils.sol            | 100%     3| 100%   1|    -    0
libraries/Endian.sol                           | 100%     3| 100%   1|    -    0
libraries/Merkle.sol                           |95.0%    40| 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%   125|96.2%  26|    -    0
pods/EigenPodManager.sol                       |98.7%    75|85.7%  14|    -    0
pods/EigenPodManagerStorage.sol                | 0.0%     5| 0.0%   1|    -    0
strategies/EigenStrategy.sol                   | 0.0%    10| 0.0%   5|    -    0
strategies/StrategyBase.sol                    |89.7%    39|77.8%  18|    -    0
strategies/StrategyBaseTVLLimits.sol           | 100%    12|83.3%   6|    -    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:|72.0%  1078|71.5% 270|    -    0

wadealexc and others added 3 commits August 9, 2024 19:43
* move state into Storage contract
* remove withdrawal proof method

* feat: poc for partial withdrawal batching
* feat: remove beaconChainOracle in favor of 4788
* modify verifyStaleBalance to use plural form
* add pause flags for new methods
* deprecate old state variables
* minor cleanup and commenting
* chore: get things compiling
* i commented out/deleted a bajillion tests
* fix: adjust storage footprint to be consistent with m2

* feat: adjust verifyStaleBalance to allow anyone to start a checkpoint
* removes staleness concept from pod and manager state

* clean: clean up start checkpoint logic

* clean: remove comments

* clean: remove outdated comment and rename proofs method

* fix: remove unused variable and deprecate another

* chore: rename lastFinalizedCheckpoint to lastCheckpointTimestamp

* feat: add events for checkpoint creation and progression

* feat: remove unneeded oracle interface from EigenPodManager

* feat: remove unnecessary state root caching and add ValidatorWithdrawn event

* feat: remove all use of the delayed withdrawal router (#524)
* modify activateRestaking flow to use checkpointing
* remove withdrawNonBeaconChainETHBalanceWei in favor of checkpointing

* feat: remove staleness grace period

* feat: add flag to startCheckpoint to prevent 0-balance checkpoints

* chore: move currentCheckpoint to a public getter and update IEigenPod interface

* chore: fix comment, update interfaces, add event

* chore: clarify comment on activateRestaking

* feat: skip validator if already checkpointed

* fix: finish rebase

* chore: make bindings

* fix: swap inequality check to correctly skip duplicate proofs

* chore: make bindings

* test: modify integration test framework to support pepe (#563)

* test: basic epoch processing
* wip: balance proofs somewhat functional
* test: flesh out beacon chain abi and test workflow
* test: cleanup
* test: add basic invariant checks for checkpoint proofs
* test: add tests for full exits

* feat: checkpoint proofs use balance container root
* also refactors and cleans up BeaconChainProofs
* more refactor/cleanup to come

* chore: more proof library cleanup, removing unused constants

* chore: additional cleanup and renaming of proof constants for consistency

* chore: clean comments and reorganize constants

* chore: remove delayedWithdrawalRouter from EigenPod

* feat: adjust storage sizes for fields in checkpoint struct

* feat: remove activateRestaking in favor of startCheckpoint (#577)

* see PR comment for details

* test: add proofgen test contract

* fix: rename and add balance proof

* feat: track balance exited for checkpoints

* chore: deprecate deneb fork timestamp functions in EigenPodManager

* test: fix existing integration tests

* test: fix some unit tests and remove many outdated tests

* test: start setting up new integration tests

* fix: fixes two issues with verifyWC timing
* verifyWC -> startCheckpoint in the same block no longer results in a bricked checkpoint
* verifyWC using a timestamp older than the current checkpoint no longer allows you to submit a checkpoint proof for the new validator

* chore: fix outdated comment

* test: fleshed out eigenpod test flows
* also reduced number of validators being generated by tests (for speed)

* test: flesh out additional pod flows

* chore: make bindings

* test: add checks for several integration tests

* fix: add additional pause condition for verifyStaleBalance

* docs: add initial EigenPod docs

* docs: clean and update EigenPodManager docs

* chore: small wip to eigenpod docs and contract comment cleanup

* chore: fix gas metering test to be consistent
* also minor clarity tweak in verifyCheckpointProofs

* test: eigenpod unit tests with checkpointing (#591)

* test: testings init

* test: eigenpod unit tests refactor

* test: startCheckpoint unit tests

* test: pod unit tests

* fix: rebase changes
* chore: make bindings

* chore: revert pod changes

* test: add several tests and checks

---------

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

* chore: cleanup dwr and unused code (#593)

* chore: cleanup dwr and unused code

* chore: comment out pod specs

* feat: remove staleness timing window
* chore: update IEigenPod interface with updated comments

* chore: fix bindings

* test: finish verify start complete flow for pepe integration tests

* chore: fix bindings

* test: add slashing and native eth integration tests

* build: partial withdrawal batching upgrade scripts (#598)

* build: preprod pod upgrade scripts

* chore: cleanup unused files

* chore: add pepe deployment output

* docs: finish main eigenpod docs and improve commenting

* docs: finish main eigenpod docs

* feat: remove hasRestaked and lastCheckpointTimestamp checks

* test: add tests for constructor and initialize

* test: fix mainnet fork tests and compiler warnings

* docs: update diagrams for pepe

* chore: upgrade preprod eigenpods (#611)

* chore: upgrade preprod eigenpods

* chore: remove unneeded logs

* chore: deploy and update deployment addresses

* feat: public block root getter (#612)

* docs: update user flow diagrams to mention supported tokens
* also increases resolution

* feat: add proof submitter address (#629)

* feat: add proof submitter address

* test: add event emission test

* docs: fix comments and add proof submitter to docs

* chore: add sigma prime audit

* feat: deploy new pods to holesky preprod
* includes proofSubmitter address

* feat: update PEPE events (#632)

* feat: mock out new events for EigenPodManager

* chore: make bindings

* feat: remove unneeded event change and update tests

* chore: make bindings

* fix: final event versions

* chore: upgrade preprod with new PEPE events

* docs: update audit report
* fix: reject credential proofs if activation epoch is not set

* chore: make bindings
* fix: fix borked addresses in holesky config

* chore: fix formatting again
@wadealexc wadealexc force-pushed the feat/partial-withdrawal-batching branch from 60340a8 to 6116bb3 Compare August 9, 2024 20:24
Copy link

github-actions bot commented Aug 9, 2024

Reading tracefile ./lcov.info.pruned
                                             |Lines      |Functions|Branches  
Filename                                       |Rate    Num|Rate  Num|Rate   Num
================================================================================
[src/contracts/]
core/AVSDirectory.sol                          |77.8%    27|77.8%   9|    -    0
core/DelegationManager.sol                     |96.5%   198|92.3%  39|    -    0
core/RewardsCoordinator.sol                    |90.8%   119|81.2%  32|    -    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/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:|74.1%  1096|72.9% 277|    -    0

Copy link

github-actions bot commented Aug 9, 2024

Reading tracefile ./lcov.info.pruned
                                             |Lines      |Functions|Branches  
Filename                                       |Rate    Num|Rate  Num|Rate   Num
================================================================================
[src/contracts/]
core/AVSDirectory.sol                          |77.8%    27|77.8%   9|    -    0
core/DelegationManager.sol                     |96.5%   198|92.3%  39|    -    0
core/RewardsCoordinator.sol                    |90.8%   119|81.2%  32|    -    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/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:|74.1%  1096|72.9% 277|    -    0

1 similar comment
Copy link

github-actions bot commented Aug 9, 2024

Reading tracefile ./lcov.info.pruned
                                             |Lines      |Functions|Branches  
Filename                                       |Rate    Num|Rate  Num|Rate   Num
================================================================================
[src/contracts/]
core/AVSDirectory.sol                          |77.8%    27|77.8%   9|    -    0
core/DelegationManager.sol                     |96.5%   198|92.3%  39|    -    0
core/RewardsCoordinator.sol                    |90.8%   119|81.2%  32|    -    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/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:|74.1%  1096|72.9% 277|    -    0

@wadealexc wadealexc merged commit b4fa900 into dev Aug 9, 2024
19 checks passed
@wadealexc wadealexc deleted the feat/partial-withdrawal-batching branch August 9, 2024 22:30
Copy link

github-actions bot commented Aug 9, 2024

Reading tracefile ./lcov.info.pruned
                                             |Lines      |Functions|Branches  
Filename                                       |Rate    Num|Rate  Num|Rate   Num
================================================================================
[src/contracts/]
core/AVSDirectory.sol                          |77.8%    27|77.8%   9|    -    0
core/DelegationManager.sol                     |96.5%   198|92.3%  39|    -    0
core/RewardsCoordinator.sol                    |90.8%   119|81.2%  32|    -    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/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:|74.1%  1096|72.9% 277|    -    0

3 similar comments
Copy link

github-actions bot commented Aug 9, 2024

Reading tracefile ./lcov.info.pruned
                                             |Lines      |Functions|Branches  
Filename                                       |Rate    Num|Rate  Num|Rate   Num
================================================================================
[src/contracts/]
core/AVSDirectory.sol                          |77.8%    27|77.8%   9|    -    0
core/DelegationManager.sol                     |96.5%   198|92.3%  39|    -    0
core/RewardsCoordinator.sol                    |90.8%   119|81.2%  32|    -    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/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:|74.1%  1096|72.9% 277|    -    0

Copy link

Reading tracefile ./lcov.info.pruned
                                             |Lines      |Functions|Branches  
Filename                                       |Rate    Num|Rate  Num|Rate   Num
================================================================================
[src/contracts/]
core/AVSDirectory.sol                          |77.8%    27|77.8%   9|    -    0
core/DelegationManager.sol                     |96.5%   198|92.3%  39|    -    0
core/RewardsCoordinator.sol                    |90.8%   119|81.2%  32|    -    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/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:|74.1%  1096|72.9% 277|    -    0

Copy link

Reading tracefile ./lcov.info.pruned
                                             |Lines      |Functions|Branches  
Filename                                       |Rate    Num|Rate  Num|Rate   Num
================================================================================
[src/contracts/]
core/AVSDirectory.sol                          |77.8%    27|77.8%   9|    -    0
core/DelegationManager.sol                     |96.5%   198|92.3%  39|    -    0
core/RewardsCoordinator.sol                    |90.8%   119|81.2%  32|    -    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/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:|74.1%  1096|72.9% 277|    -    0

8sunyuan pushed a commit that referenced this pull request Aug 12, 2024
* feat: implement pepe
* move state into Storage contract
* remove withdrawal proof method

* feat: poc for partial withdrawal batching
* feat: remove beaconChainOracle in favor of 4788
* modify verifyStaleBalance to use plural form
* add pause flags for new methods
* deprecate old state variables
* minor cleanup and commenting
* chore: get things compiling
* i commented out/deleted a bajillion tests
* fix: adjust storage footprint to be consistent with m2

* feat: adjust verifyStaleBalance to allow anyone to start a checkpoint
* removes staleness concept from pod and manager state

* clean: clean up start checkpoint logic

* clean: remove comments

* clean: remove outdated comment and rename proofs method

* fix: remove unused variable and deprecate another

* chore: rename lastFinalizedCheckpoint to lastCheckpointTimestamp

* feat: add events for checkpoint creation and progression

* feat: remove unneeded oracle interface from EigenPodManager

* feat: remove unnecessary state root caching and add ValidatorWithdrawn event

* feat: remove all use of the delayed withdrawal router (#524)
* modify activateRestaking flow to use checkpointing
* remove withdrawNonBeaconChainETHBalanceWei in favor of checkpointing

* feat: remove staleness grace period

* feat: add flag to startCheckpoint to prevent 0-balance checkpoints

* chore: move currentCheckpoint to a public getter and update IEigenPod interface

* chore: fix comment, update interfaces, add event

* chore: clarify comment on activateRestaking

* feat: skip validator if already checkpointed

* fix: finish rebase

* chore: make bindings

* fix: swap inequality check to correctly skip duplicate proofs

* chore: make bindings

* test: modify integration test framework to support pepe (#563)

* test: basic epoch processing
* wip: balance proofs somewhat functional
* test: flesh out beacon chain abi and test workflow
* test: cleanup
* test: add basic invariant checks for checkpoint proofs
* test: add tests for full exits

* feat: checkpoint proofs use balance container root
* also refactors and cleans up BeaconChainProofs
* more refactor/cleanup to come

* chore: more proof library cleanup, removing unused constants

* chore: additional cleanup and renaming of proof constants for consistency

* chore: clean comments and reorganize constants

* chore: remove delayedWithdrawalRouter from EigenPod

* feat: adjust storage sizes for fields in checkpoint struct

* feat: remove activateRestaking in favor of startCheckpoint (#577)

* see PR comment for details

* test: add proofgen test contract

* fix: rename and add balance proof

* feat: track balance exited for checkpoints

* chore: deprecate deneb fork timestamp functions in EigenPodManager

* test: fix existing integration tests

* test: fix some unit tests and remove many outdated tests

* test: start setting up new integration tests

* fix: fixes two issues with verifyWC timing
* verifyWC -> startCheckpoint in the same block no longer results in a bricked checkpoint
* verifyWC using a timestamp older than the current checkpoint no longer allows you to submit a checkpoint proof for the new validator

* chore: fix outdated comment

* test: fleshed out eigenpod test flows
* also reduced number of validators being generated by tests (for speed)

* test: flesh out additional pod flows

* chore: make bindings

* test: add checks for several integration tests

* fix: add additional pause condition for verifyStaleBalance

* docs: add initial EigenPod docs

* docs: clean and update EigenPodManager docs

* chore: small wip to eigenpod docs and contract comment cleanup

* chore: fix gas metering test to be consistent
* also minor clarity tweak in verifyCheckpointProofs

* test: eigenpod unit tests with checkpointing (#591)

* test: testings init

* test: eigenpod unit tests refactor

* test: startCheckpoint unit tests

* test: pod unit tests

* fix: rebase changes
* chore: make bindings

* chore: revert pod changes

* test: add several tests and checks

---------

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

* chore: cleanup dwr and unused code (#593)

* chore: cleanup dwr and unused code

* chore: comment out pod specs

* feat: remove staleness timing window
* chore: update IEigenPod interface with updated comments

* chore: fix bindings

* test: finish verify start complete flow for pepe integration tests

* chore: fix bindings

* test: add slashing and native eth integration tests

* build: partial withdrawal batching upgrade scripts (#598)

* build: preprod pod upgrade scripts

* chore: cleanup unused files

* chore: add pepe deployment output

* docs: finish main eigenpod docs and improve commenting

* docs: finish main eigenpod docs

* feat: remove hasRestaked and lastCheckpointTimestamp checks

* test: add tests for constructor and initialize

* test: fix mainnet fork tests and compiler warnings

* docs: update diagrams for pepe

* chore: upgrade preprod eigenpods (#611)

* chore: upgrade preprod eigenpods

* chore: remove unneeded logs

* chore: deploy and update deployment addresses

* feat: public block root getter (#612)

* docs: update user flow diagrams to mention supported tokens
* also increases resolution

* feat: add proof submitter address (#629)

* feat: add proof submitter address

* test: add event emission test

* docs: fix comments and add proof submitter to docs

* chore: add sigma prime audit

* feat: deploy new pods to holesky preprod
* includes proofSubmitter address

* feat: update PEPE events (#632)

* feat: mock out new events for EigenPodManager

* chore: make bindings

* feat: remove unneeded event change and update tests

* chore: make bindings

* fix: final event versions

* chore: upgrade preprod with new PEPE events

* docs: update audit report

* fix: reject credential proofs if activation epoch is not set (#668)

* fix: reject credential proofs if activation epoch is not set

* chore: make bindings

* chore: fix formatting and borked config

* fix: fix borked addresses in holesky config

* chore: fix formatting again

* chore: upgrade preprod with new credential check

* chore: deploy pepe to holesky
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.

6 participants