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

Support third party withdrawals with queueWithdrawalsWithSignature #676

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from

Conversation

peitalin
Copy link

@peitalin peitalin commented Aug 10, 2024

Description
Support third party withdrawals by adding a queueWithdrawalWithSignature function in DelegationManager so that a contract can queue withdrawals on behalf of a user with their signature.

Use Cases
At the moment a contract (e.g. a contract facilitating L2 <-> L1 restaking and withdrawing) can conduct deposits on behalf of a staker with depositIntoStrategyWithSignature in the StrategyManager, but can't queue withdrawals on behalf of a staker. Adding this feature would enable withdrawing via L2.

The token which we are using for Dual Staking has most of it's liquidity and users on L2, and so we wanted to allow our users to both stake and withdraw from Eigenlayer from L2 instead of: requiring our users to bridge ETH back to L1, queueWithdrawal from Eigenlayer, waiting for the withdrawal period, completeWithdrawal, then bridging back to L2.

Update:
The Eigenlayer team mentioned this feature existed in the past but was removed due to phishing concerns.
I'm wondering if adding a whitelistThirdPartyWithdrawer(contractAddr, strategy) with checks in the queueWithdrawalWithSignature function addresses these concerns sufficiently.

At the moment, queueWithdrawals already checks if thirdPartyTransfersForbidden = false to allow third party withdrawals, however thirdPartyTransfersForbidden defaults to false in StrategyFactory.deployNewStrategy(), so I'm unsure if the team wants to add a separate thirdPartyWithdrawalsForbidden = false requirement to allow for different defaults for third party deposits, and third party withdrawals.

Happy to add a separate thirdPartyWithdrawalsForbidden feature in the PR as well if the team prefers the latter.

@peitalin
Copy link
Author

peitalin commented Aug 13, 2024

Edit: Seems like this feature puts the DelegationManager contract size just above the size limit:

| Contract                    | Size (B) | Margin (B) |
|-----------------------------|----------|------------|
| DelegationManager           |   25,019 |       -443 |

However if we turn require() error messages into custom errors as in this branch we see:

| Contract                    | Size (B) | Margin (B) |
|-----------------------------|----------|------------|
| DelegationManager           |   23,576 |        1000 |

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.

1 participant