Skip to content

fix(evmrpc): return null for out-of-range index in eth_getTransactionByBlock*AndIndex#3320

Merged
amir-deris merged 1 commit intomainfrom
amir/plt-287-evmrpc-TransactionByBlockNumberOrHashAndIndex-error
Apr 28, 2026
Merged

fix(evmrpc): return null for out-of-range index in eth_getTransactionByBlock*AndIndex#3320
amir-deris merged 1 commit intomainfrom
amir/plt-287-evmrpc-TransactionByBlockNumberOrHashAndIndex-error

Conversation

@amir-deris
Copy link
Copy Markdown
Contributor

@amir-deris amir-deris commented Apr 27, 2026

Summary

  • eth_getTransactionByBlockNumberAndIndex and eth_getTransactionByBlockHashAndIndex were returning a JSON-RPC error when the requested transaction index exceeded the number of transactions in the block.
  • Per the Ethereum JSON-RPC spec, these methods must return null (not an error) when no transaction exists at the given index.
  • Changed getTransactionWithBlock to return (nil, nil) instead of (nil, error) on out-of-range index, and updated the corresponding test.

@amir-deris amir-deris self-assigned this Apr 27, 2026
@amir-deris amir-deris changed the title Fixed evmrpc index out of range error fix(evmrpc): return null for out-of-range index in eth_getTransactionByBlock*AndIndex Apr 27, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 27, 2026

The latest Buf updates on your PR. Results from workflow Buf / buf (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedApr 30, 2026, 4:10 PM

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 27, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.17%. Comparing base (10c2d92) to head (b08463b).
⚠️ Report is 19 commits behind head on main.

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3320   +/-   ##
=======================================
  Coverage   59.16%   59.17%           
=======================================
  Files        2093     2093           
  Lines      171972   171990   +18     
=======================================
+ Hits       101755   101773   +18     
  Misses      61401    61401           
  Partials     8816     8816           
Flag Coverage Δ
sei-chain-pr 64.52% <100.00%> (?)
sei-db 70.41% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
evmrpc/tx.go 85.01% <100.00%> (ø)

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@amir-deris amir-deris added this pull request to the merge queue Apr 28, 2026
Merged via the queue into main with commit d67dd88 Apr 28, 2026
44 checks passed
@amir-deris amir-deris deleted the amir/plt-287-evmrpc-TransactionByBlockNumberOrHashAndIndex-error branch April 28, 2026 00:38
@masih
Copy link
Copy Markdown
Collaborator

masih commented May 1, 2026

/backport

@seidroid
Copy link
Copy Markdown

seidroid Bot commented May 1, 2026

masih pushed a commit that referenced this pull request May 1, 2026
…dex in eth_getTransactionByBlock*AndIndex (#3367)

Backport of #3320 to `release/v6.5`.

Co-authored-by: Amir <amir@seinetwork.io>
masih pushed a commit that referenced this pull request May 4, 2026
…dex in eth_getTransactionByBlock*AndIndex (#3367)

Backport of #3320 to `release/v6.5`.

Co-authored-by: Amir <amir@seinetwork.io>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants