Skip to content

Conversation

@neowangreal
Copy link
Contributor

@neowangreal neowangreal commented Feb 11, 2026

When FilterBlockOption is AtBlockHash, matches_block_range() implicitly returns true (no range bounds to check), which short-circuits the OR in matches_block() and makes the block hash constraint a no-op.

e.g. filter set to at_block_hash(0xaaa...), calling matches_block({ number: 99, hash: 0xbbb... }):

  • matches_block_range(99) → true (AtBlockHash has no from/to, so both checks are skipped)
  • true || matches_block_hash(0xbbb...) → true (short-circuit, hash never checked)

Switch to matching on the block option variant directly so AtBlockHash only checks the hash and Range only checks the number range.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

1 participant