You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// nonce, proves that a sufficient amount of computation has been carried out on this block;
/// formally Hm.
pubmix_hash:B256,
/// A 64-bit value which, combined with the mixhash, proves that a sufficient amount of
/// computation has been carried out on this block; formally Hn.
pubnonce:B64,
/// A scalar representing EIP1559 base fee which can move up or down each block according
/// to a formula which is a function of gas used in parent block and gas target
/// (block gas limit divided by elasticity multiplier) of parent block.
/// The algorithm results in the base fee per gas increasing when blocks are
/// above the gas target, and decreasing when blocks are below the gas target. The base fee per
/// gas is burned.
#[cfg_attr(
feature = "serde",
serde(
default,
with = "alloy_serde::quantity::opt",
skip_serializing_if = "Option::is_none"
)
)]
pubbase_fee_per_gas:Option<u128>,
/// The total amount of blob gas consumed by the transactions within the block, added in
/// EIP-4844.
#[cfg_attr(
feature = "serde",
serde(
default,
with = "alloy_serde::quantity::opt",
skip_serializing_if = "Option::is_none"
)
)]
pubblob_gas_used:Option<u128>,
This includes:
gas_limit
gas_used
base_fee_per_gas
blob_gas_used
excess_blob_gas
All these fields are considered as u64 in reth which leads to a lot of unnecessary conversions as pointed out here paradigmxyz/reth#10691 (comment). If there is no particular contraindication, it would be good to make all these fields become u64 directly in alloy to standardize and avoid conversions in reth.
Additional context
No response
The text was updated successfully, but these errors were encountered:
I think if we actually want to do this, any gas fields in alloy should be turned into u64 as otherwise we'd just end up with same conversions but in other places
this will be both breaking and a bit confusing, so would like @mattsse@yash-atreya to confirm that we're fine with doing this in next breaking release before someone starts working on this
also I think base_fee_per_gas should stay as u128, and should be set to u128 in reth too
We had done a numerical audit #454#474 and decided that gas fields should be u128, but makes sense to unify them to u64 since reth and revm both use u64.
also I think base_fee_per_gas should stay as u128, and should be set to u128 in reth too
Component
consensus, eips, genesis
Describe the feature you would like
At the moment, some header gas fields are u128:
alloy/crates/consensus/src/header.rs
Lines 65 to 105 in 002aed5
This includes:
gas_limit
gas_used
base_fee_per_gas
blob_gas_used
excess_blob_gas
All these fields are considered as u64 in reth which leads to a lot of unnecessary conversions as pointed out here paradigmxyz/reth#10691 (comment). If there is no particular contraindication, it would be good to make all these fields become u64 directly in alloy to standardize and avoid conversions in reth.
Additional context
No response
The text was updated successfully, but these errors were encountered: