fix(eips): preserve max_blobs_per_tx and blob_base_cost in BlobParams serde#3852
Closed
Aboudjem wants to merge 2 commits intoalloy-rs:mainfrom
Closed
fix(eips): preserve max_blobs_per_tx and blob_base_cost in BlobParams serde#3852Aboudjem wants to merge 2 commits intoalloy-rs:mainfrom
Aboudjem wants to merge 2 commits intoalloy-rs:mainfrom
Conversation
…rams serde roundtrip The `SerdeHelper` for `BlobParams` was dropping `max_blobs_per_tx` and `blob_base_cost` during serialization, causing deserialization to always default `max_blobs_per_tx` to `max_blob_count` and `blob_base_cost` to 0. Add both fields as optional to the serde helper so they are preserved when they differ from their defaults. This fixes the broken serde roundtrip reported in alloy-rs#3103. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
BlobParams uses a custom serde impl with Option fields (via SerdeHelper) that is incompatible with bincode's legacy format. Introduce a direct BincBlobParams wrapper that serializes raw fields without Option, fixing the test_chain_config_bincode_roundtrip test. Also fix rustfmt in eip7840. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
mattsse
reviewed
Apr 8, 2026
Member
mattsse
left a comment
There was a problem hiding this comment.
these can be derived from the eips itself, and this isnt really necessary
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #3103
The
SerdeHelperforBlobParamswas dropping two fields during serialization:max_blobs_per_txwas silently discarded, then defaulted tomax_blob_counton deserializationblob_base_costwas silently discarded, then defaulted to0on deserializationThis broke serde roundtrips for any
BlobParamswheremax_blobs_per_tx != max_blob_countorblob_base_cost != 0(e.g. Osaka configuration).Changes
max_blobs_per_txandblob_base_costasOptionfields toSerdeHelpermax_blob_countand0respectively), keeping backward-compatible JSON output for Cancun/Prague configsTest plan
cargo test -p alloy-eips --features serde -- eip7840— 3 tests passBlobParamsvariants🤖 Generated with Claude Code