Skip to content

Comments

fix(contract): propagate TransportError when all eth_call overrides fail#3316

Merged
mattsse merged 1 commit intoalloy-rs:mainfrom
phrwlk:fix/storage-slot-finder-error-propagation
Jan 22, 2026
Merged

fix(contract): propagate TransportError when all eth_call overrides fail#3316
mattsse merged 1 commit intoalloy-rs:mainfrom
phrwlk:fix/storage-slot-finder-error-propagation

Conversation

@phrwlk
Copy link
Contributor

@phrwlk phrwlk commented Dec 9, 2025

This change ensures StorageSlotFinder::find_slot does not silently return Ok(None) when every eth_call with state overrides fails. We keep iterating on per-slot failures to tolerate intermittent RPC issues, but if no call succeeds we now return the last TransportError. This aligns behavior with the method’s documentation and avoids masking provider configurations that don’t support state overrides. Decode errors remain skipped as before since the API returns only TransportError

@mattsse mattsse force-pushed the fix/storage-slot-finder-error-propagation branch from bc7d9ff to e394610 Compare January 22, 2026 23:21
@github-project-automation github-project-automation bot moved this to Reviewed in Alloy Jan 22, 2026
@mattsse mattsse enabled auto-merge (squash) January 22, 2026 23:22
When all eth_call attempts with state overrides fail (e.g., RPC down,
auth errors), StorageSlotFinder::find_slot now propagates the first
error instead of silently returning Ok(None).

Changes:
- Track any_call_succeeded and first_call_err
- Use get_or_insert to capture first error (more deterministic)
- Propagate error only when no call succeeded
@mattsse mattsse force-pushed the fix/storage-slot-finder-error-propagation branch from e394610 to cc275e1 Compare January 22, 2026 23:23
@mattsse mattsse disabled auto-merge January 22, 2026 23:31
@mattsse mattsse merged commit 5e322de into alloy-rs:main Jan 22, 2026
28 of 30 checks passed
@github-project-automation github-project-automation bot moved this from Reviewed to Done in Alloy Jan 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants