[Application Development] Why is the gas limit returned by estimateGas enough? #320
Replies: 4 comments 4 replies
-
|
Can you walk us through how you estimate gas (a code snippet would be helpful)? and can you confirm you're not using ethers/ext-utils-optimism? Ether's estimateGas
So this would give you the L2 gas, but not the L1 gas. My initial assumption is that using the blob space to write to L1 has reduced the cost enough that at current demand the L1 aspect is negligible. |
Beta Was this translation helpful? Give feedback.
-
|
Up till today, we only did provider.estimateGas without taking into account the l1 data fee. You can see here: https://github.com/safe-global/safe-wallet-web/blob/b0b0106825f7ecc925b57be8e426ef3cab4ccfe9/src/hooks/useGasLimit.ts#L180 - er only did estimateGas and that has worked fine so far. |
Beta Was this translation helpful? Give feedback.
-
|
In OP Mainnet, L1 Data Fee doesn't directly depend on gas usage of L2. So, whether there's an Ecotone update or not, the L2 gas needed for a transaction remains the same. |
Beta Was this translation helpful? Give feedback.
-
|
Hey! Thanks for the reply! I honestly don't get it. Do we need to add the L1 Data fee or not? The docs suggest that we do need it and ext-utils-optimism also ads it. Should we adopt ext-utils-optimism approach? or leave it to ethers provider.estimateGas |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Did you check the documentation?
Did you check for duplicate questions?
Issue Description
I'm trying to figure out how gasEstimation has changed after the ecotone update. According to these docs:
https://docs.optimism.io/builders/app-developers/transactions/fees
In our application we currently only do ehters v6 provider.estimateGas, we don't calculate the l1 data fee. Despite that the TXs are going through. Why is that? If we are supposed to do the estimation with l1data fee it means that currently we are setting our gas limit with 5k (for some txs) less than it should be. However, what I see from the tx execution right now is that the TXs we submit use 94-96% of the set gasLimit. So apparently the default provider.estimateGas returns a high enough value, but why is that?
Additional Information
No response
Feedback
No response
Beta Was this translation helpful? Give feedback.
All reactions