-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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 base fee computation parameters configurable via chain spec #3992
Conversation
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.
got some minor comments, lgtm otherwise
Context: ported from anton-rs#32 |
Codecov Report
... and 374 files with indirect coverage changes
Flags with carried forward coverage won't be shown. Click here to find out more.
|
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.
one more fix, otherwise lgtm! @mattsse PTAL
@roberto-bayardo |
I tried to make everything consistent (with change_denomiator always preceeding elasticity) in my last commit but apparently missed updating next_block_base_fee ... thanks for the catch. fixed now. |
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.
one last thing, otherwise lgtm
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.
supportive, but I'd like to make this a bit more ergonomic,
we can also add the inverse of the next_base_fee
via ChainSpec::next_base_fee(&block)
that could also be convenient
Closes #3750 |
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.
nice, only two pedantic nits
crates/primitives/src/basefee.rs
Outdated
gas_used: u64, | ||
gas_limit: u64, | ||
base_fee: u64, | ||
base_fee_params: &crate::BaseFeeParams, |
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.
they can be passed as copy
base_fee_params: &crate::BaseFeeParams, | |
base_fee_params: crate::BaseFeeParams, |
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.
done, also changed next_block_base_fee to accept copy instead of reference.
crates/primitives/src/chain/spec.rs
Outdated
} | ||
.into() | ||
}); | ||
|
||
/// BaseFeeParams contains the config parameters that control block base fee computation | ||
#[derive(Serialize, Deserialize, Debug, Clone)] |
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.
#[derive(Serialize, Deserialize, Debug, Clone)] | |
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)] |
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.
thanks, also added "Copy" since we're now passing copies
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.
lgtm
Making these parameters configurable will, for example, allow chains to have a different gas target per block.