Repository navigation
Conversation
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 28 minutes. View limit details
Warning Billing warning: we have not been able to collect payment for this subscription for more than 72 hours. Please update the payment method or pay any pending invoices in Billing to avoid service interruption. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
panos-xyz
added a commit
that referenced
this pull request
Nov 28, 2026
…develop # Conflicts: # crates/node/tests/it/rpc.rs # crates/rpc/src/eth/transaction.rs
panos-xyz
added a commit
that referenced
this pull request
Dec 1, 2026
…develop # Conflicts: # crates/node/tests/it/rpc.rs # crates/rpc/src/eth/transaction.rs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes two RPC fee-suggestion / gas-estimation issues observed on live Morph Mainnet and Hoodi testnet
morph-rethRPC nodes:1.
LoadFee::suggested_priority_fee(crates/rpc/src/eth/mod.rs)GasPriceOracle::suggest_tip_cappushesU256::ZEROfor every empty block and scans up to2 * max_block_history(2,048) blocks against a 1,024-entry LRU cache. Because Morph L2 blocks are frequently empty (74%+ on mainnet, 90%+ on Hoodi testnet),eth_maxPriorityFeePerGascollapsed to0x0,eth_gasPricereturned onlybaseFee(0xf4240),MORPH_DEFAULT_PRIORITY_FEE(0.001 Gwei) became dead code after block 0, and very quiet networks risked 2,048-block LRU thrashing under the global oracle lock.LoadFee::suggested_priority_feeonMorphEthApito useGasPriceOracle::op_suggest_tip_capwithdefault_suggested_fee.unwrap_or(MORPH_DEFAULT_PRIORITY_FEE)as the minimum floor:O(1), no 2,048-block back-scan or LRU thrashing).MORPH_DEFAULT_PRIORITY_FEE = 1_000_000 weiby default, honoring--gpo.default-suggested-feeand--gpo.maxprice) whenever the latest block has spare gas capacity.110%of the latest block's median effective tip when the block reaches capacity (gas_used + max_tx_gas_used > gas_limit), safely skippingL1MessageTxviafilter_map(effective_tip_per_gas).2. Zero-tip simulation requests without
maxFeePerGas(crates/rpc/src/eth/transaction.rs)eth_estimateGas/eth_callwithmaxPriorityFeePerGas: "0x0"and omitsmaxFeePerGas(with no legacygasPrice),alloy-evm'sCallFees::ensure_feespriced the call atbase_fee + 0instead of0. For zero-balance callers this triggeredcaller_gas_allowanceand failed withinsufficient funds for l1 fee, diverging frommorph-geth(ToMessage/DoEstimateGas) and from passing(0, 0)or omitting both fields.gas_price: None, max_fee_per_gas: None, max_priority_fee_per_gas: Some(0)inMorphTransactionRequest::try_into_tx_envby settingmax_fee_per_gas = Some(0)before delegating toinner.try_into_tx_env, while preserving allowance enforcement for explicit non-zeromaxFeePerGas/ non-zeromaxPriorityFeePerGasand conflict errors when legacygasPriceis also set.Tests
try_into_tx_env_zero_tip_without_max_fee_is_zero_pricedincrates/rpc/src/eth/transaction.rs.gas_price_oracle_returns_floor_on_empty_blocks_and_scales_at_capacityandestimate_gas_allows_zero_priority_fee_without_max_fee_for_zero_balance_senderincrates/node/tests/it/rpc.rs.Verification
cargo fmt --all -- --check— passcargo clippy --workspace --all-targets -- -D warnings— passcargo test -p morph-rpc— 128/128 passedcargo test -p morph-node --features test-utils --test it rpc— 29/29 passed