Skip to content

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

Closed
DoTheBestToGetTheBest wants to merge 3 commits intoalloy-rs:mainfrom
DoTheBestToGetTheBest:DoTheBestToGetTheBest-patch-7
Closed

feat: Make next_block_blob_fee functions accept an update fraction parameter #1769
DoTheBestToGetTheBest wants to merge 3 commits intoalloy-rs:mainfrom
DoTheBestToGetTheBest:DoTheBestToGetTheBest-patch-7

Conversation

@DoTheBestToGetTheBest
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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
Copy Markdown
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!

///
/// See also [Self::next_block_excess_blob_gas]
#[deprecated(
since = "0.8.1",
Copy link
Copy Markdown
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
Copy Markdown
Contributor Author

ping @klkvr

@mattsse
Copy link
Copy Markdown
Member

mattsse commented Dec 24, 2024

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

@klkvr
Copy link
Copy Markdown
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