Skip to content

fix(l1): modify the RPC eth_feeHistory controller implementation #1797

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

Merged
merged 6 commits into from
Feb 24, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/ci_l1.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ jobs:
include:
- name: "Rpc Compat tests"
simulation: ethereum/rpc-compat
test_pattern: /debug_getRawBlock|debug_getRawHeader|debug_getRawReceipts|debug_getRawTransaction|eth_blobBaseFee|eth_blockNumber|eth_call|eth_chainId|eth_createAccessList|eth_estimateGas|eth_getBalance|eth_getBlockByHash|eth_getBlockByNumber|eth_getBlockReceipts|eth_getBlockTransactionCountByHash|eth_getBlockTransactionCountByNumber|eth_getCode|eth_getLogs|eth_getProof|eth_getStorageAt|eth_getTransactionByBlockHashAndIndex|eth_getTransactionByBlockNumberAndIndex|eth_getTransactionByHash|eth_getTransactionCount|eth_getTransactionReceipt|eth_sendRawTransaction|eth_syncing
test_pattern: ""
- name: "Devp2p discv4 tests"
simulation: devp2p
test_pattern: discv4
Expand Down
12 changes: 6 additions & 6 deletions crates/blockchain/payload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,11 @@ impl BuildPayloadArgs {
/// Creates a new payload based on the payload arguments
// Basic payload block building, can and should be improved
pub fn create_payload(args: &BuildPayloadArgs, storage: &Store) -> Result<Block, ChainError> {
// TODO: check where we should get builder values from
const DEFAULT_BUILDER_GAS_CEIL: u64 = 30_000_000;
let parent_block = storage
.get_block_header_by_hash(args.parent)?
.ok_or_else(|| ChainError::ParentNotFound)?;
let chain_config = storage.get_chain_config()?;
let gas_limit = calc_gas_limit(parent_block.gas_limit, DEFAULT_BUILDER_GAS_CEIL);
let gas_limit = calc_gas_limit(parent_block.gas_limit);
let excess_blob_gas = chain_config
.get_fork_blob_schedule(args.timestamp)
.map(|schedule| {
Expand Down Expand Up @@ -138,10 +136,12 @@ pub fn create_payload(args: &BuildPayloadArgs, storage: &Store) -> Result<Block,
Ok(Block::new(header, body))
}

fn calc_gas_limit(parent_gas_limit: u64, desired_limit: u64) -> u64 {
pub fn calc_gas_limit(parent_gas_limit: u64) -> u64 {
// TODO: check where we should get builder values from
const DEFAULT_BUILDER_GAS_CEIL: u64 = 30_000_000;
let delta = parent_gas_limit / GAS_LIMIT_BOUND_DIVISOR - 1;
let mut limit = parent_gas_limit;
let desired_limit = max(desired_limit, MIN_GAS_LIMIT);
let desired_limit = max(DEFAULT_BUILDER_GAS_CEIL, MIN_GAS_LIMIT);
if limit < desired_limit {
limit = parent_gas_limit + delta;
if limit > desired_limit {
Expand All @@ -158,7 +158,7 @@ fn calc_gas_limit(parent_gas_limit: u64, desired_limit: u64) -> u64 {
limit
}

fn calc_excess_blob_gas(
pub fn calc_excess_blob_gas(
parent_excess_blob_gas: u64,
parent_blob_gas_used: u64,
target: u64,
Expand Down
Loading
Loading