Skip to content
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

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JulianVentura
Copy link
Contributor

Description

This PR fixes the implementation of the eth_feeHistory RPC endpoint, by adding some new validations and modifying how the projected values of base_fee_per_gas and base_fee_per_blob are obtained.

Note

There is a hive test related to this endpoint which is still not passing, due to the requirement of supporting the Prague update by the execution client. Anyways, the results obtained from this test were compared with Geth and there are the same.

@JulianVentura JulianVentura self-assigned this Jan 23, 2025
@JulianVentura JulianVentura requested a review from a team as a code owner January 23, 2025 19:23
Copy link

| File                                                                    | Lines | Diff |
+-------------------------------------------------------------------------+-------+------+
| /home/runner/work/ethrex/ethrex/crates/networking/rpc/eth/fee_market.rs | 198   | +20  |
+-------------------------------------------------------------------------+-------+------+

Total lines added: +20
Total lines removed: 0
Total lines changed: 20

Copy link
Collaborator

@mpaulucci mpaulucci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

(base_fee_per_gas[idx + 1], base_fee_per_blob_gas[idx + 1]) =
project_next_block_base_fee_values(&header);
}
if self.reward_percentiles.len() > 0 {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit.

Suggested change
if self.reward_percentiles.len() > 0 {
if !self.reward_percentiles.len().is_empty() {

"Expected param to be 0x prefixed".to_owned(),
))?;
let block_count: u64 =
parse_json_hex(&params[0]).map_err(|error| RpcErr::BadParams(error))?;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit.

Suggested change
parse_json_hex(&params[0]).map_err(|error| RpcErr::BadParams(error))?;
parse_json_hex(&params[0]).map_err(RpcErr::BadParams)?;

Copy link
Contributor

@ilitteri ilitteri left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The PR looks good, left a couple of nits. It'd be nice to add which tests that were not passing are doing it because of these changes.

@ilitteri ilitteri changed the title fix(l1): Modify the RPC eth_feeHistory controller implementation fix(l1): modify the RPC eth_feeHistory controller implementation Jan 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants