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

Multi-Withdrawal Transactions not Properly Recognized #56

Open
MSilb7 opened this issue Sep 28, 2024 · 3 comments
Open

Multi-Withdrawal Transactions not Properly Recognized #56

MSilb7 opened this issue Sep 28, 2024 · 3 comments

Comments

@MSilb7
Copy link

MSilb7 commented Sep 28, 2024

Relaying a Multicall withdrawal only relays one of the withdrawals. The second one is unable to be relayed.

L2 Withdrawal (contains 2 withdrawals): https://optimistic.etherscan.io/tx/0x2a523f1b74b93f5d8c1bdc7e5a1d106e7b2c6b1e31c3449a370b05048fec5ada

L1 Prove: https://etherscan.io/tx/0x9e6871eded323816255827798b36ffb547df5ecb30b5b42b0a90b5020100bf5e

L1 Relay (only reads 1 of the withdrawals): https://etherscan.io/tx/0x217bf1d1abbb1805d586ff908373b928a7e63242d2505fd51ef52c5c8d1be4fb

Now, when I look up this transaction on superchainrelayer.xyz it says "Finalized," Etherscan also says "waiting" and I'm unable to relay the other withdrawal from the transaction.

Superchain Relayer
image

Etherscan
image

@MSilb7
Copy link
Author

MSilb7 commented Oct 2, 2024

Another example, seems like only the first indexed withdrawal gets finalized.

L2 tx: https://optimistic.etherscan.io/tx/0x7f10c777aa10550a35562c7960477fd70460e69a5aa9e10c022595eddc970bda

L1 relay: https://etherscan.io/tx/0xd1a29904ad2520bcd1b34ce8c86e94164fb6e334f3b6eea614d66298fad10ad8

Etherscan's relayer fails, saying the transaction has already been withdrawn; however, only 1 of the 3 has been withdrawn.

@nitaliano
Copy link
Contributor

nitaliano commented Oct 2, 2024

One potential solution for this would be:

@nitaliano
Copy link
Contributor

nitaliano commented Nov 27, 2024

Viem now has better support for dealing with transactions that have multiple withdrawals. It's now possible for the relayer to support this flow.

const [withdrawal1, withdrawal2] = getWithdrawals(receipt)

// withdrawal1
const withdrawalStatus = await publicClientL1.getWithdrawalStatus({
    receipt: receipt,
    targetChain: optimism,
    logIndex: 0,
})

// withdrawal2
const withdrawalStatus = await publicClientL1.getWithdrawalStatus({
    receipt: receipt,
    targetChain: optimism,
    logIndex: 1,
})

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

No branches or pull requests

2 participants