-
Notifications
You must be signed in to change notification settings - Fork 594
Description
Component
consensus, eips, genesis
What version of Alloy are you on?
No response
Operating System
macOS (Apple Silicon)
Describe the bug
AnyHeader::base_fee_per_gas is typed as Option<u64>, which causes deserialization failures on chains where baseFeePerGas exceeds u64::MAX.
We encountered this on a live EVM-compatible chain (Stable, chain ID 988) that returns baseFeePerGas: "0x3635c9adc5dea00000" (10^21) for a range of historical blocks. Deserializing the RPC response fails with:
invalid type: integer `1000000000000000000000`, expected u64
Spec vs implementation
The Ethereum execution spec defines base_fee_per_gas as Uint (arbitrary-precision), while explicitly choosing U64 for blob_gas_used and excess_blob_gas. This distinction appears intentional.
In alloy, AnyHeader uses Option<u64> for base_fee_per_gas, and the BlockHeader trait constrains the return type to Option<u64>.
Suggestion
Change AnyHeader::base_fee_per_gas from Option<u64> to Option<U256> (or Option<u128>). This would be consistent with AnyHeader's documented purpose of accounting for "possible differences in network implementations". Ideally the BlockHeader trait method would also be widened, but even just changing AnyHeader would eliminate the deserialization failure.
The same consideration may apply to gas_limit and gas_used, which the spec also defines as Uint.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status