Skip to content

Fix eth_getStorageAt batch QUANTITY encoding for Base RPC - #20

Merged
dominicletz merged 2 commits into
mainfrom
fix/eth-getstorageat-quantity-encoding
Aug 1, 2026
Merged

Fix eth_getStorageAt batch QUANTITY encoding for Base RPC#20
dominicletz merged 2 commits into
mainfrom
fix/eth-getstorageat-quantity-encoding

Conversation

@dominicletz

Copy link
Copy Markdown
Member

Summary

  • get_storage_many was sending padded block hex (e.g. 0x02f1cf00) via batch_call, which bypasses rpc/3/normalize_args.
  • Strict Base RPC providers reject that as -32602 invalid params, raising in EdgeV2 and dropping the connection.
  • Route batch storage params through normalize_args so blocks use short JSON-RPC QUANTITY encoding (0x2f1cf00).

Test plan

  • DIODE_MINIMAL_TEST=1 mix test --no-start test/remote_chain/rpc_cache_test.exs
  • Confirm Base getaccountvalues / storage reads no longer crash EdgeV2 with -32602

Made with Cursor

dominicletz and others added 2 commits August 1, 2026 22:10
get_storage_many bypassed normalize_args and encoded blocks like 0x02f1cf00, which Base RPC rejects as -32602 invalid params and crashed EdgeV2 connections.

Co-authored-by: Cursor <cursoragent@cursor.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
@dominicletz

Copy link
Copy Markdown
Member Author

CI was red on mix format --check-formatted: wrapped the long normalize_args call in rpc_cache.ex, and formatted a pre-existing scripts/bns.exs line that was already failing on main.

@dominicletz
dominicletz merged commit 43c83dd into main Aug 1, 2026
2 checks passed
@dominicletz
dominicletz deleted the fix/eth-getstorageat-quantity-encoding branch August 1, 2026 14:39
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.

1 participant