Skip to content

fix(scan): probe block-by-hash for 64-hex search queries#55

Merged
github-actions[bot] merged 2 commits into
mainfrom
fix/scan-search-block-by-hash
May 11, 2026
Merged

fix(scan): probe block-by-hash for 64-hex search queries#55
github-actions[bot] merged 2 commits into
mainfrom
fix/scan-search-block-by-hash

Conversation

@satyakwok
Copy link
Copy Markdown
Member

Summary

Surfaced via user report — pasting a 64-hex block hash into V1 scan search returned "Transaction not found" even though block hashes are a legitimate search input.

Root cause: lib/search-validate.ts matched 64-hex with regex but only ran probeTx() on both networks. Block hashes were never probed — so any block-hash query dead-ended at the tx error.

Fix: 4 parallel probes (tx + block on current + other network). Block hits resolve through getBlock({blockHash}) and route to /blocks/<resolved-height> since the block detail route is height-keyed. Tx still wins precedence on ambiguity.

Cost

4 RPC calls instead of 2, but they run via Promise.all → wall time stays bounded by the slowest single probe (~50ms at typical chain RPC latency).

Test plan

  • Paste a known block hash from eth_getBlockByHash → routes to /blocks/<height>
  • Paste a known tx hash → still routes to /tx/<hash> (tx precedence preserved)
  • Paste cross-network block hash → routes with ?network= flip
  • Paste a 64-hex that exists nowhere → still returns "not found" with updated message

satyakwok added 2 commits May 11, 2026 02:10
V2 (scan.sentriscloud.com + scan-testnet.sentriscloud.com) was missing
from the live audit surface. Both stay live alongside V1 per ops
direction; the audit needs to monitor both. Renamed v1 entries with
explicit `-v1` suffix for symmetry.

Verified locally: clean across all 17 surface URLs.
Before: 64-hex regex matched but only ran probeTx() on both networks.
A user pasting a block hash → both probes fail → "Transaction not
found" error message even though the hash IS a valid block hash.

After: 4 parallel probes (tx + block on current + other network).
Block hits resolve through getBlock({blockHash}) and route to
/blocks/<resolved-height> since the block route is height-keyed.
Tx still wins precedence — they're disjoint hash spaces in practice
but the explicit ordering keeps semantics deterministic.

Cost: 4 RPC calls instead of 2, but they run concurrently → wall
time stays bounded by the slowest single probe (~50ms).
@github-actions github-actions Bot enabled auto-merge (squash) May 11, 2026 00:22
@github-actions github-actions Bot merged commit 659456a into main May 11, 2026
5 checks passed
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