-
Notifications
You must be signed in to change notification settings - Fork 174
fix(l1): use current header instead of parent to get excess blob gas #5706
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| @@ -1,4 +1,3 @@ | ||||||||||||||||
| use ethrex_blockchain::find_parent_header; | ||||||||||||||||
| use ethrex_rlp::encode::RLPEncode; | ||||||||||||||||
| use serde_json::Value; | ||||||||||||||||
| use tracing::debug; | ||||||||||||||||
|
|
@@ -311,14 +310,9 @@ impl RpcHandler for GetBlobBaseFee { | |||||||||||||||
| Some(header) => header, | ||||||||||||||||
| _ => return Err(RpcErr::Internal("Could not get block header".to_owned())), | ||||||||||||||||
| }; | ||||||||||||||||
| let parent_header = match find_parent_header(&header, &context.storage) { | ||||||||||||||||
| Ok(option_header) => option_header, | ||||||||||||||||
| Err(error) => return Err(RpcErr::Internal(error.to_string())), | ||||||||||||||||
| }; | ||||||||||||||||
|
|
||||||||||||||||
| let config = context.storage.get_chain_config(); | ||||||||||||||||
| let blob_base_fee = calculate_base_fee_per_blob_gas( | ||||||||||||||||
| parent_header.excess_blob_gas.unwrap_or_default(), | ||||||||||||||||
| header.excess_blob_gas.unwrap_or_default(), | ||||||||||||||||
| config | ||||||||||||||||
| .get_fork_blob_schedule(header.timestamp) | ||||||||||||||||
| .map(|schedule| schedule.base_fee_update_fraction) | ||||||||||||||||
|
|
@@ -341,8 +335,6 @@ pub async fn get_all_block_rpc_receipts( | |||||||||||||||
| if header.parent_hash.is_zero() { | ||||||||||||||||
| return Ok(receipts); | ||||||||||||||||
| } | ||||||||||||||||
|
Comment on lines
335
to
337
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this check might also be wrong. Doesn't the genesis block also include its own transactions which might create receipts?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. i think genesis blocks don't have receipts
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This. We don't have a way to accept a genesis block with transactions: ethrex/crates/common/types/genesis.rs Lines 697 to 703 in 1bebff3
It'd be good to add a comment here. |
||||||||||||||||
| // TODO: Here we are calculating the base_fee_per_blob_gas with the current header. | ||||||||||||||||
| // Check if we should be passing the parent header instead | ||||||||||||||||
| let config = storage.get_chain_config(); | ||||||||||||||||
| let blob_base_fee = calculate_base_fee_per_blob_gas( | ||||||||||||||||
| header.excess_blob_gas.unwrap_or_default(), | ||||||||||||||||
|
|
||||||||||||||||
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.
For reference, the same code in geth is: https://github.com/ryanschneider/go-ethereum/blob/13bde9bb8572898abab200be7bd1616f5650257e/eth/gasprice/feehistory.go#L97-L103