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

op-stack: finalize withdraw fails with 'finalization period not elapsed' error #3027

Closed
1 task done
parketh opened this issue Nov 19, 2024 · 2 comments
Closed
1 task done
Labels
needs reproduction Misc: Needs Reproduction

Comments

@parketh
Copy link

parketh commented Nov 19, 2024

Check existing issues

Viem Version

2.21.25

Current Behavior

I am withdrawing ETH from a custom OP stack L2 back to Sepolia L1, following the steps here.

When finalizing the withdraw in the last step, walletClientL1.finalizeWithdrawal fails with a 'proven withdrawal finalization period has not elapsed' error. This error only shows up if triggering the finalize tx immediately after proving. Waiting ~10-20 secs and trying again fixes the error.

ContractFunctionExecutionError: The contract function "finalizeWithdrawalTransaction" reverted with the following reason:
RPC Request failed.

URL: https://eth-sepolia.public.blastapi.io
Request body: {"method":"eth_estimateGas","params":[{"data":"0x8c3152e900000000000000000000000000000000000000000000000000000000000000200001000000000000000000000000000000000000000000000000000000000007000000000000000000000000dd5b44c1d7e3acce9c1183dd52bf20f3e43c0eb2000000000000000000000000dd5b44c1d7e3acce9c1183dd52bf20f3e43c0eb200000000000000000000000000000000000000000000000000038d7ea4c68000000000000000000000000000000000000000000000000000000000000000520800000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000","from":"0xdd5b44c1d7e3acce9c1183dd52bf20f3e43c0eb2","to":"0xFb1E09752dD46A446a28cB249f0a20daaAF9864e"}]}

Details: execution reverted: revert: OptimismPortal: proven withdrawal finalization period has not elapsed
Version: [email protected]

Contract Call:
  address:   0xFb1E09752dD46A446a28cB249f0a20daaAF9864e
  function:  finalizeWithdrawalTransaction((uint256 nonce, address sender, address target, uint256 value, uint256 gasLimit, bytes data))
  args:                                   ({"nonce":"1766847064778384329583297500742918515827483896875618958121606201292619783","sender":"0xdD5b44c1d7E3aCce9C1183dd52bF20f3e43c0eB2","target":"0xdD5b44c1d7E3aCce9C1183dd52bF20f3e43c0eB2","value":"1000000000000000","gasLimit":"21000","data":"0x","withdrawalHash":"0x91fd9a2d09abaa1e3b4077bb9ab95e87795a190fc1a683d742f634d88031f4af"})
  sender:    0xdd5b44c1d7e3acce9c1183dd52bf20f3e43c0eb2

Docs: https://viem.sh/docs/contract/estimateContractGas
Version: 2.21.25
    at getContractError (getContractError.js:34:12)
    at estimateContractGas (estimateContractGas.js:59:98)
    at async finalizeWithdrawal (finalizeWithdrawal.js:45:11)
    at async handleWithdrawFinalize (page.tsx:439:28)Caused by: ContractFunctionRevertedError: The contract function "finalizeWithdrawalTransaction" reverted with the following reason:
RPC Request failed.

URL: https://eth-sepolia.public.blastapi.io
Request body: {"method":"eth_estimateGas","params":[{"data":"0x8c3152e900000000000000000000000000000000000000000000000000000000000000200001000000000000000000000000000000000000000000000000000000000007000000000000000000000000dd5b44c1d7e3acce9c1183dd52bf20f3e43c0eb2000000000000000000000000dd5b44c1d7e3acce9c1183dd52bf20f3e43c0eb200000000000000000000000000000000000000000000000000038d7ea4c68000000000000000000000000000000000000000000000000000000000000000520800000000000000000000000000000000000000000000000000000000000000c00000000000000000000000000000000000000000000000000000000000000000","from":"0xdd5b44c1d7e3acce9c1183dd52bf20f3e43c0eb2","to":"0xFb1E09752dD46A446a28cB249f0a20daaAF9864e"}]}

Details: execution reverted: revert: OptimismPortal: proven withdrawal finalization period has not elapsed
Version: [email protected]

Version: 2.21.25
    at eval (getContractError.js:25:20)
    at getContractError (getContractError.js:33:7)
    at estimateContractGas (estimateContractGas.js:59:98)
    at async finalizeWithdrawal (finalizeWithdrawal.js:45:11)
    at async handleWithdrawFinalize (page.tsx:439:28)

Some other relevant details:

  • FINALIZATION_PERIOD_SECONDS for the L2 is set to 12 secs
  • publicClientL1.waitToFinalize resolves correctly in the previous step, so the finalization period should already be elapsed

Expected Behavior

The finalizeWithdrawal() tx shouldnt throw an error. it should work immediately after the prove tx is confirmed and waitToFinalize resolves.

Steps To Reproduce

  1. Bridge Sepolia ETH to OP stack L2 chain
  2. Initiate withdraw tx
  3. Prove tx
  4. Immedately try to finalize the withdrawal within 10-20 secs of proving tx confirmed

You can try it out using the bridge for our L2 devnet here. Please note this is a testnet running on Sepolia L1 and you will need to manually add the chain to your Metamask:

Link to Minimal Reproducible Example

http://147.182.131.12:3002/

Anything else?

No response

@jxom jxom added the needs reproduction Misc: Needs Reproduction label Nov 19, 2024
Copy link
Contributor

Hello @parketh.

Please provide a minimal reproduction using StackBlitz, TypeScript Playground (for type issues), or a separate minimal GitHub repository.

Minimal reproductions are required as they save us a lot of time reproducing your config/environment and issue, and allow us to help you faster.

Once a minimal reproduction is added, a team member will confirm it works, then re-open the issue.

@jxom
Copy link
Member

jxom commented Nov 19, 2024

minimal reproducible example must be minimal

@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Nov 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needs reproduction Misc: Needs Reproduction
Projects
None yet
Development

No branches or pull requests

2 participants