-
Notifications
You must be signed in to change notification settings - Fork 1.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feat: add blobs to eth history #6469
Feat: add blobs to eth history #6469
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice,
we're missing one thing:
title: baseFeePerBlobGasArray
description: An array of block base fees per blob gas. This includes the next block after the newest of the returned range, because this value can be derived from the newest block. Zeroes are returned for pre-EIP-4844 blocks.
Same goes for base_fee_per_gas
which we include for the next block:
https://github.com/paradigmxyz/reth/blob/main/crates/rpc/rpc/src/eth/api/fees.rs#L149-L154
https://github.com/paradigmxyz/reth/blob/main/crates/rpc/rpc/src/eth/api/fees.rs#L203-L208
base_fee_per_blob_gas: block.blob_fee(), | ||
blob_gas_used_ratio: block.blob_gas_used() as f64 / | ||
reth_primitives::constants::eip4844::MAX_DATA_GAS_PER_BLOCK as f64, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this looks correct to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fyi reth/crates/primitives/src/header.rs Line 242 in e085f45
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
awesome,
I realize that there's one thing missing here, the base_fee_per_blob_gas for the next block if we're having cached entries.
The FeeEntry currently doesn't have the required data to derive that for the next block
what we can do instead is storing the excess blob gas and the blob gas used in the cache entry
https://github.com/paradigmxyz/reth/blob/main/crates/primitives/src/header.rs#L258-L263
and compute the relevant fields via functions on the cache entry
https://github.com/paradigmxyz/reth/blob/main/crates/rpc/rpc/src/eth/api/fee_history.rs#L351-L351
this way we can also derive the values for the next block
https://github.com/paradigmxyz/reth/blob/main/crates/primitives/src/header.rs#L261-L262
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
draft for: #6330