Skip to content

fix(provider): handle nullable trace collection results - #4219

Merged
decofe merged 5 commits into
mainfrom
centaur/fix-nullable-trace-results-1790085129
Sep 22, 2026
Merged

decofe merged 5 commits into
mainfrom
centaur/fix-nullable-trace-results-1790085129

Conversation

@decofe

@decofe decofe commented Sep 22, 2026 •

Copy link
Copy Markdown
Contributor

Motivation

Trace collection methods reject successful JSON-RPC null responses. Banteg's H06 report distinguishes missing data from empty results and unavailable history.

Solution

Return Option<Vec<_>> from trace_transaction, trace_block, and trace_replay_block_transactions. Preserve [] as Some(vec![]) and propagate RPC errors unchanged. Document that some nodes, including Reth's current trace_block handler, error on missing blocks rather than returning null.

Breaking change: callers must handle Option after awaiting these three methods. This PR targets main and has no PR dependencies. Individual replay and trace_get are handled in #4221 and #4220.

Validation

Two provider regression tests cover null versus empty results and unchanged error codes across all three methods. Nightly formatting passes. No node-backed tests were run.

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

Prompted by: @DaniPopes

BREAKING CHANGE: trace lookup methods return Option to distinguish missing data from empty results.

Co-authored-by: Derek Cofausper <[email protected]>
@decofe
decofe added this pull request to stack #4222 September 22, 2026 13:56
@decofe
decofe removed this pull request from stack #4222 September 22, 2026 14:00
Clarify client-specific missing-block errors and keep trace_get and individual replay changes in their independent PRs.

Co-authored-by: Derek Cofausper <[email protected]>
@decofe decofe changed the title fix(provider): handle nullable trace lookup results fix(provider): handle nullable trace collection results Sep 22, 2026
@github-project-automation github-project-automation Bot moved this to Reviewed in Alloy Sep 22, 2026

@mattsse mattsse left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

these are breaking, i think from user pov, non option is actually more user friendly here

@decofe
decofe merged commit b989e82 into main Sep 22, 2026
31 checks passed
@decofe
decofe deleted the centaur/fix-nullable-trace-results-1790085129 branch September 22, 2026 14:57
@github-project-automation github-project-automation Bot moved this from Reviewed to Done in Alloy Sep 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.

3 participants