Skip to content

fix(anvil): handle BlockTransactions::Uncle without panic#14135

Merged
zerosnacks merged 1 commit into
foundry-rs:masterfrom
strmfos:fix/anvil-uncle-panic
Apr 7, 2026
Merged

fix(anvil): handle BlockTransactions::Uncle without panic#14135
zerosnacks merged 1 commit into
foundry-rs:masterfrom
strmfos:fix/anvil-uncle-panic

Conversation

@strmfos
Copy link
Copy Markdown
Contributor

@strmfos strmfos commented Apr 4, 2026

Panics in RPC server are not acceptable. When BlockTransactions::Uncle is encountered, return Ok(None) instead of crashing.

This variant appears due to alloy deserialization quirk (alloy-rs/alloy#805) and other anvil handlers already handle it gracefully (api.rs returns 0 for tx count).

Introduced in 51632c4 (#13647).
Related: #8822 (similar panic fix in Otterscan).

Copy link
Copy Markdown
Member

@zerosnacks zerosnacks left a comment

Choose a reason for hiding this comment

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

Thanks @strmfos! Agreed we should not have a panic here

@zerosnacks zerosnacks merged commit 3d26ca0 into foundry-rs:master Apr 7, 2026
15 checks passed
@github-project-automation github-project-automation Bot moved this to Done in Foundry Apr 7, 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