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

feat: Make next_block_blob_fee functions accept an update fraction parameter #1769

Conversation

DoTheBestToGetTheBest
Copy link
Contributor

closes #1766

/// # Panics
///
/// - Panics if `update_fraction` is provided and not within the range [0.0, 1.0].
pub fn next_block_blob_fee_with_fraction(&self, update_fraction: Option<f64>) -> Option<u128> {
Copy link
Member

Choose a reason for hiding this comment

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

I'd prefer this to not be optional

Copy link
Member

Choose a reason for hiding this comment

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

and we also need this on BlochHeader trait

Copy link
Contributor Author

Choose a reason for hiding this comment

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

and we also need this on BlochHeader trait

thanks, everything done!

let excess_blob_gas = self.next_block_excess_blob_gas()?;
let adjusted_blob_gas = (excess_blob_gas as f64 * fraction) as u64;

Some(eip4844::calc_blob_gasprice(adjusted_blob_gas))
Copy link
Member

Choose a reason for hiding this comment

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

we should introduce an additional helper like calc_blob_gasprice_with_update_fraction and use it here

Copy link
Contributor Author

Choose a reason for hiding this comment

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

we should introduce an additional helper like calc_blob_gasprice_with_update_fraction and use it here

thanks for your review!

@@ -214,10 +214,39 @@ impl Header {
/// Returns `None` if `excess_blob_gas` is None.
///
/// See also [Self::next_block_excess_blob_gas]
#[deprecated(
since = "0.8.1",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

not sure if you are okay with this version the current one is 0.8.0 so for the next one is 0.8.1;

lmk if you want me to change or remove this

@DoTheBestToGetTheBest
Copy link
Contributor Author

ping @klkvr

@mattsse
Copy link
Member

mattsse commented Dec 24, 2024

@klkvr with recent 77840 changes #1828 this is no longer required?

@klkvr
Copy link
Member

klkvr commented Dec 24, 2024

yeah sorry @DoTheBestToGetTheBest, this is superseded by #1828

@klkvr klkvr closed this Dec 24, 2024
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.

[Feature] Make next_block_blob_fee functions accept an update fraction parameter
3 participants