Skip to content

fix(evmrpc): return empty array instead of null for eth_getFilterLogs and eth_getFilterChanges#3292

Merged
amir-deris merged 2 commits intomainfrom
amir/plt-278-evmrpc-filter-null-response
Apr 21, 2026
Merged

fix(evmrpc): return empty array instead of null for eth_getFilterLogs and eth_getFilterChanges#3292
amir-deris merged 2 commits intomainfrom
amir/plt-278-evmrpc-filter-null-response

Conversation

@amir-deris
Copy link
Copy Markdown
Contributor

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

Summary

eth_getFilterLogs and eth_getFilterChanges were returning null instead of [] when no logs matched — violating the Ethereum JSON-RPC spec, which requires these methods to always return an array.

  • Return []*ethtypes.Log{} instead of nil in GetFilterLogs and GetFilterChanges for all no-result paths (exhausted bounded filters, no matching logs, empty range queries)
  • Export NewFilterMethod and GetFilterLogsMethod constants to replace magic strings in tests
  • Add tests asserting the empty-array contract for both methods

@amir-deris amir-deris self-assigned this Apr 21, 2026
@amir-deris amir-deris changed the title getFilterLogs and getFilterChanges return empty array instead of nil,… fix(evmrpc): return empty array instead of null for eth_getFilterLogs and eth_getFilterChanges Apr 21, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 21, 2026

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

BuildFormatLintBreakingUpdated (UTC)
✅ passed✅ passed✅ passed✅ passedApr 21, 2026, 6:43 PM

@codecov
Copy link
Copy Markdown

codecov Bot commented Apr 21, 2026

Codecov Report

❌ Patch coverage is 25.00000% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 59.36%. Comparing base (f2f5f21) to head (393c2ff).
⚠️ Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
evmrpc/filter.go 25.00% 4 Missing and 2 partials ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##             main    #3292   +/-   ##
=======================================
  Coverage   59.36%   59.36%           
=======================================
  Files        2072     2072           
  Lines      169942   169947    +5     
=======================================
+ Hits       100887   100892    +5     
  Misses      60271    60271           
  Partials     8784     8784           
Flag Coverage Δ
sei-chain-pr 64.43% <25.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/filter.go 69.89% <25.00%> (+0.22%) ⬆️
🚀 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 21, 2026
Merged via the queue into main with commit 0ad5733 Apr 21, 2026
39 checks passed
@amir-deris amir-deris deleted the amir/plt-278-evmrpc-filter-null-response branch April 21, 2026 20:14
yzang2019 added a commit that referenced this pull request Apr 22, 2026
* main:
  Giga store migration guide (#3227)
  Update SS write/read modes into single evm-ss-mode (#3278)
  fix(evmrpc): return empty array instead of null for eth_getFilterLogs and eth_getFilterChanges (#3292)
  feat: add autobahn integration tests - batch 1 (CON-249) (#3234)
  add block height modified to legacy data (#3276)
  Export ProposerPriorityHash metric for divergence monitoring (#3277)
  backport CW/wasmd@76eaff4 (#3258)
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