Skip to content

fix(provider): accept nullable raw debug results - #4223

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

decofe merged 3 commits into
mainfrom
centaur/fix-nullable-debug-results-1790085129

Conversation

@decofe

@decofe decofe commented Sep 22, 2026

Copy link
Copy Markdown
Contributor

Motivation

Alloy rejects null from debug_getRawTransaction and debug_getRawReceipts. Reth's raw transaction handler returns an optional result, and geth's raw receipt handler can return null for a missing block number.

Solution

Return Option<Bytes> and Option<Vec<Bytes>> respectively, preserving empty successful values and RPC errors. Document geth's "0x" absence convention in debug and eth raw-transaction lookups: it remains Some(Bytes::new()); no new normalization is introduced. debug_traceTransaction retains its error behavior.

Breaking change: callers of these two debug methods must handle Option. This PR targets main independently.

Validation

Three provider tests cover null, empty, and nonempty raw values; unsupported-method, missing-data, indexing, and unavailable-history errors; and the unchanged debug tracing error path. Nightly formatting and provider clippy pass (existing unrelated warnings). No node-backed tests were run.

PR Checklist

  • Added Tests
  • Added Documentation
  • Breaking changes

Prompted by: @DaniPopes

BREAKING CHANGE: raw debug transaction and receipt lookups return Option. Document and test geth empty-byte responses without normalizing errors.

Co-authored-by: Derek Cofausper <[email protected]>
@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.

also api breaking, and imo non option is more userfriendly

@decofe
decofe merged commit d1a2209 into main Sep 22, 2026
58 of 60 checks passed
@decofe
decofe deleted the centaur/fix-nullable-debug-results-1790085129 branch September 22, 2026 15:01
@github-project-automation github-project-automation Bot moved this from Reviewed to Done in Alloy Sep 22, 2026
decofe added a commit that referenced this pull request Sep 22, 2026
Preserve null raw debug transaction and receipt results as None while keeping empty values and RPC errors unchanged. Document and test raw eth result compatibility.

Co-authored-by: DaniPopes <[email protected]>
Co-authored-by: Derek Cofausper <[email protected]>
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