fix(wallet): pass eth_feeHistory and eth_maxPriorityFeePerGas through the zkEVM provider - #2957
allan-almeida-imtbl wants to merge 1 commit into
Conversation
… the zkEVM provider viem, wagmi and ethers estimate EIP-1559 fees with these two calls. The provider forwarded eth_gasPrice and eth_estimateGas to the node but let these fall through to 'Method not supported', so a dapp doing standard fee estimation against Passport failed before it could send, and the usual workaround was a hardcoded fee. Both methods exist on the current node and are returned as-is, like the other read-only passthroughs. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
View your CI Pipeline Execution ↗ for commit 507ebbe
💡 Verify your cache is correct by running tasks in a sandbox. Read docs ↗ ☁️ Nx Cloud last updated this comment at |
|
Closing unmerged. This is not a migration issue. Both methods exist on immutable-geth today and on op-reth after, and the Passport provider blocks them in both worlds, so the migration neither creates the gap nor is blocked by it. Checking viem 2.18.2 as installed here: The PR description's claim that dapps "hard-error today" was wrong for the common path. Recorded on BLOC-686, which is cancelled. The underlying change is still a reasonable SDK improvement on its own merits: two fewer RPC round trips per send, and an unblocked fee-history path. If it is wanted, it should be raised as ordinary SDK work rather than carried in the migration scope. Branch kept. |
Summary
The Passport zkEVM provider now forwards
eth_feeHistoryandeth_maxPriorityFeePerGasto the node. These are the two calls viem, wagmi and ethers make to estimate EIP-1559 fees; until now they fell through toMethod not supported.Linear: BLOC-686 (parent BLOC-680, Fee model vector, zkEVM → OP Stack migration).
The problem, by example
A dapp built on viem sends a transaction through Passport. Before it signs anything, viem's
estimateFeesPerGasasks the provider two questions:eth_feeHistoryMethod not supported(4200)eth_maxPriorityFeePerGasMethod not supported(4200)eth_gasPriceToday the send fails at the estimation step, before the user sees anything. The common workaround is to hardcode a fee in the dapp. That is the habit the migration has to break: op-reth has no 10 gwei floor, so a hardcoded fee is either overpaying or underpaying from cutover onward. Correct estimation has to be possible through the provider first.
Detail and impact of the change
Fixed
Two method names added to the forward-as-is group in
packages/wallet/src/zkEvm/zkEvmProvider.ts, next toeth_gasPrice. No shape translation; the node's JSON-RPC result is returned unchanged, the same as the other read-only passthroughs. Both methods exist on the current immutable-geth node, so this ships ahead of the migration with no behaviour change for callers not using them.Tests: the two methods are forwarded with their params and the result returned untouched; a method not on the list still throws
Method not supported.Anything else worth calling out?
eth_sendTransactionvia the relayer) is untouched. This only affects dapps that read fees through the provider for their own purposes.no-floating-promises, lines 119/239/435) are pre-existing and not in the changed lines.🤖 Generated with Claude Code