Skip to content

Backport release/v6.5: fix(evmrpc): return null for out-of-range index in eth_getTransactionByBlock*AndIndex#3367

Merged
masih merged 1 commit intorelease/v6.5from
backport-3320-to-release/v6.5
May 1, 2026
Merged

Backport release/v6.5: fix(evmrpc): return null for out-of-range index in eth_getTransactionByBlock*AndIndex#3367
masih merged 1 commit intorelease/v6.5from
backport-3320-to-release/v6.5

Conversation

@seidroid
Copy link
Copy Markdown

@seidroid seidroid Bot commented May 1, 2026

Backport of #3320 to release/v6.5.

…ByBlock*AndIndex (#3320)

## 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](https://ethereum.github.io/execution-apis/api/methods/eth_getTransactionByBlockNumberAndIndex),
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.

(cherry picked from commit d67dd88)
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 1, 2026

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

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedMay 1, 2026, 8:22 PM

@codecov
Copy link
Copy Markdown

codecov Bot commented May 1, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 58.32%. Comparing base (a89d86b) to head (7701ac3).
⚠️ Report is 1 commits behind head on release/v6.5.

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##           release/v6.5    #3367   +/-   ##
=============================================
  Coverage         58.31%   58.32%           
=============================================
  Files              2093     2093           
  Lines            173242   173229   -13     
=============================================
- Hits             101029   101028    -1     
+ Misses            63152    63142   -10     
+ Partials           9061     9059    -2     
Flag Coverage Δ
sei-chain-pr 63.32% <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 84.53% <100.00%> (ø)

... and 45 files 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.

@masih masih enabled auto-merge (squash) May 1, 2026 20:23
@masih masih merged commit f0a515e into release/v6.5 May 1, 2026
41 of 43 checks passed
@masih masih deleted the backport-3320-to-release/v6.5 branch May 1, 2026 21:48
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.

3 participants