Skip to content

fix(rpc): emit null for absent Morph receipt fee fields - #192

Open
panos-xyz wants to merge 1 commit into
mainfrom
fix/rpc-receipt-null-fee-fields
Open

fix(rpc): emit null for absent Morph receipt fee fields#192
panos-xyz wants to merge 1 commit into
mainfrom
fix/rpc-receipt-null-fee-fields

Conversation

@panos-xyz

Copy link
Copy Markdown
Contributor

Summary

  • eth_getTransactionReceipt now serializes unset Morph fee pointers (feeTokenID, feeRate, tokenScale, feeLimit) as JSON null, matching morph-geth. Previously unwrap_or_default() turned every Legacy/EIP-1559/L1-message receipt into "0x0".
  • MorphTx v1 paying ETH still emits "feeTokenID": "0x0" (stored Some(0)), so clients can distinguish “not a MorphTx” (null) from “MorphTx, pay with ETH” ("0x0").
  • Fixes fix(rpc): eth_getTransactionReceipt returns "0x0" instead of null for non-MorphTx fee fields #185. @morph-network/viem and indexers that use receipt.feeTokenID != null were misclassifying every standard transaction as alt-fee.

Test plan

  • cargo nextest run -p morph-rpc eth::receipt
  • e2e standard_transaction_receipt_exposes_null_fee_fields_over_rpc
  • e2e transaction_receipt_exposes_morph_fields_over_rpc (MorphTx still "0x1")
  • After merge, drop/update the morph-cross-client-tests runbook line that claimed geth exposes absent numeric receipt metadata as 0x0

morph-geth serializes unset feeTokenID/feeRate/tokenScale/feeLimit as
JSON null, not "0x0". The previous unwrap_or_default made every standard
tx look like MorphTx paying with token 0, which breaks viem/indexer
checks of `feeTokenID != null`. Keep Some(0) for MorphTx v1 ETH-fee.
@coderabbitai

coderabbitai Bot commented Sep 7, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 27 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Team

Run ID: a78a52a2-3be2-4a34-8d21-7cbcaa2c3ab3

📥 Commits

Reviewing files that changed from the base of the PR and between aecae0f and eff7f51.

📒 Files selected for processing (2)
  • crates/node/tests/it/rpc.rs
  • crates/rpc/src/eth/receipt.rs

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

let (mut nodes, wallet) = TestNodeBuilder::new().build().await?;
let mut node = nodes.pop().unwrap();

let raw_tx = make_transfer_tx(wallet.chain_id, wallet.inner.clone(), 0).await;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(rpc): eth_getTransactionReceipt returns "0x0" instead of null for non-MorphTx fee fields

2 participants