ethereum / ethereum/staking-launchpad

Deposit out of gas errors and gas estimate

Open
#674 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
TypeScript
Stars
304
Forks
226
PR merge metrics
No merged PRs in 30d

Description

Thank @parithosh and users for helping report it.

## Issue

#### Issue on Holesky:
> A lot of deposits are randomly failing via the official launchpad due to Warning! Error encountered during contract execution [out of gas]
https://holesky.etherscan.io/address/0x4242424242424242424242424242424242424242
> example txn: https://holesky.etherscan.io/tx/0xda360eb53f1d55afedde9077120a8a278ad692364b641462514eed182462cf62
> I also looked at other transactions on the contract and it seems that other users have also been observing this behavior for a few days

#### Issue on Mainnet:

I checked the deposit txs since January 1st, 2023, and there are 32 similar cases by 4 different senders.
For example: https://etherscan.io/tx/0x1f0058046a81d08edcf2c6cd720836434269ee22121e5425311f760451feb0ca

Note: not sure if they used launchpad or other tools

## Potential cause
From my poor Dapp experience and code trace, I think [Launchpad doesn’t set a specific gas limit](https://github.com/ethereum/staking-launchpad/blob/e092fa428532a55b5f9ff2764e2e416478856040/src/pages/Transactions/transactionUtils.tsx#L73), so it is using the `eth_gasEstimate` RPC call result to set the gas limit.

[The deposit contract FV report](https://github.com/runtimeverification/deposit-contract-verification/blob/96434de/deposit-contract-verification.pdf) said the best-to-worst gas cost is between [46162, 157642].

#### A hypothesis

I suspect the gas estimate was inaccurate when deposit call congestion happened because the TX ordering was unknown; therefore, the user may get out of gas error. Does that make sense?

However, in my previous deposit on Holesky launchpad (via metamask, see [here](https://holesky.beaconcha.in/tx/0xad2e486fe37aa3612be53171fa42e96d4094fbacf7e4517ce7312f69725489d6)), the gas limit was much larger than the gas used.

/cc @CarlBeek @wackerow for consulting 🙏

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.