Repository navigation
gas parameters in estimateGas #3801
|
Is there a reason gas related parameters are added to the estimateGas call here: viem/src/actions/public/estimateGas.ts Lines 178 to 182 in 6051ca3 As far as I'm aware this call is to determine the amount of gas needed for this transaction. Would gas price have any impact on this call? (there are certain chain providers that simply fail if these additional properties are provided such as Mantle hence I'm trying to understand if they are required at all) Seems like |
Replies: 2 comments
|
The reason these parameters are passed to Here is the technical breakdown of why they are included and how to handle strict providers: Why Gas & Fee Parameters Impact
|
Hi, Did you try my solution? |
The reason these parameters are passed to
eth_estimateGasin Viem is to support EVM network execution nuances and conditional contract logic that depends on gas limits or transaction fee properties.Here is the technical breakdown of why they are included and how to handle strict providers:
Why Gas & Fee Parameters Impact
eth_estimateGasState Execution & Conditional Logic (
gas)Contracts frequently contain logic like
gasleft()or explicit checks on remaining gas. If a custom or boundedgasparameter is provided in the call, the node executes the EVM bytecode under that limit. Passinggasallows users to test whether an execution succeeds under a specific gas constraint.EIP-1559 and…