Skip to content

Conversation

@dputko
Copy link

@dputko dputko commented Dec 19, 2025

Adds EIP-1898 block identifier support (blockHash/requireCanonical) for state‑reading actions (call, getBalance, getCode, getProof, getStorageAt, getTransactionCount), enabling deterministic state queries. Adds shared formatBlockParameter validation, updates types/docs, and adds tests.
Refs #3165.

What parts require more attention from reviewers?

  • Multicall batching is skipped when blockHash is provided (see alternatives below).
  • Dedupe logic for getCode/getTransactionCount now includes blockHash; please sanity‑check caching expectations.

What other alternatives have you explored?

  • Enable batching for blockHash by resolving blockNumber via eth_getBlockByHash. Rejected: extra RPC/latency and undermines batching.
  • Force deployless multicall for blockHash. Rejected: extra complexity for a narrow path.

@changeset-bot
Copy link

changeset-bot bot commented Dec 19, 2025

🦋 Changeset detected

Latest commit: a1cf5ec

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
viem Minor

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

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