Skip to content

Comments

fix(transport): eagerly format itertools to prevent double-format panic#3668

Merged
mattsse merged 1 commit intomainfrom
dani/fix-itertools-format-panic
Feb 9, 2026
Merged

fix(transport): eagerly format itertools to prevent double-format panic#3668
mattsse merged 1 commit intomainfrom
dani/fix-itertools-format-panic

Conversation

@gakonst
Copy link
Member

@gakonst gakonst commented Feb 9, 2026

Summary

Fixes the panic introduced in f69665c when #[instrument] formats the itertools Format struct more than once.

Changes

  • Call .to_string() on .format(", ") in both hyper_transport.rs and reqwest_transport.rs to eagerly evaluate the formatter

Context

itertools::Format panics with "Format: was already formatted once" if Display is called twice. The #[instrument] macro can format span fields multiple times, triggering this at runtime.

Closes #3666

`.format()` from itertools returns a `Format` struct that panics if
displayed more than once. The `#[instrument]` macro may format span
fields multiple times, causing a panic at runtime.

Fixes #3666

Amp-Thread-ID: https://ampcode.com/threads/T-019c42f3-5cf9-75b1-81a1-cb2a6029a2db
Co-authored-by: Amp <[email protected]>
@github-project-automation github-project-automation bot moved this to Reviewed in Alloy Feb 9, 2026
@mattsse mattsse enabled auto-merge (squash) February 9, 2026 15:19
@mattsse mattsse merged commit f809b3d into main Feb 9, 2026
30 checks passed
@mattsse mattsse deleted the dani/fix-itertools-format-panic branch February 9, 2026 15:20
@github-project-automation github-project-automation bot moved this from Reviewed to Done in Alloy Feb 9, 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.

[Bug] Panic when retrieving block number

3 participants