Skip to content

feat: make base fee computation parameters configurable via chain spec#3992

Merged
mattsse merged 1 commit intoparadigmxyz:mainfrom
roberto-bayardo:main
Aug 7, 2023
Merged

feat: make base fee computation parameters configurable via chain spec#3992
mattsse merged 1 commit intoparadigmxyz:mainfrom
roberto-bayardo:main

Conversation

@roberto-bayardo
Copy link
Contributor

@roberto-bayardo roberto-bayardo commented Jul 30, 2023

Making these parameters configurable will, for example, allow chains to have a different gas target per block.

@roberto-bayardo roberto-bayardo marked this pull request as ready for review July 30, 2023 17:08
@rkrasiuk rkrasiuk added the A-op-reth Related to Optimism and op-reth label Jul 30, 2023
Copy link
Contributor

@rkrasiuk rkrasiuk left a 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

@rkrasiuk rkrasiuk added the C-enhancement New feature or request label Jul 30, 2023
@rkrasiuk
Copy link
Contributor

Context: ported from op-rs#32

@codecov
Copy link

codecov bot commented Jul 30, 2023

Codecov Report

Merging #3992 (6723a03) into main (e3457b8) will decrease coverage by 52.32%.
Report is 3 commits behind head on main.
The diff coverage is 19.04%.

❗ Current head 6723a03 differs from pull request most recent head 6365d49. Consider uploading reports for the commit 6365d49 to get more accurate results

Impacted file tree graph

Files Changed Coverage Δ
bin/reth/src/args/rpc_server_args.rs 0.00% <0.00%> (-53.99%) ⬇️
bin/reth/src/init.rs 0.00% <0.00%> (-97.21%) ⬇️
crates/consensus/auto-seal/src/lib.rs 0.00% <0.00%> (ø)
crates/consensus/auto-seal/src/task.rs 0.00% <0.00%> (ø)
crates/consensus/common/src/validation.rs 0.00% <0.00%> (-72.53%) ⬇️
crates/payload/builder/src/payload.rs 0.00% <0.00%> (ø)
crates/primitives/src/basefee.rs 0.00% <0.00%> (-97.83%) ⬇️
crates/primitives/src/constants/mod.rs 0.00% <ø> (-100.00%) ⬇️
crates/primitives/src/hardfork.rs 4.42% <0.00%> (-95.58%) ⬇️
crates/primitives/src/header.rs 36.27% <0.00%> (-59.29%) ⬇️
... and 12 more

... and 374 files with indirect coverage changes

Flag Coverage Δ
integration-tests 16.38% <19.04%> (-0.16%) ⬇️
unit-tests ?

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
reth binary 5.96% <0.00%> (-19.72%) ⬇️
blockchain tree 0.00% <ø> (-83.05%) ⬇️
pipeline 0.00% <ø> (-90.08%) ⬇️
storage (db) 18.22% <66.66%> (-56.20%) ⬇️
trie 0.00% <ø> (-94.71%) ⬇️
txpool 14.94% <0.00%> (-34.03%) ⬇️
networking 27.45% <ø> (-50.00%) ⬇️
rpc 23.77% <12.50%> (-33.69%) ⬇️
consensus 1.00% <0.00%> (-63.08%) ⬇️
revm 1.42% <ø> (-31.12%) ⬇️
payload builder 6.53% <0.00%> (-0.06%) ⬇️
primitives 22.62% <32.55%> (-65.40%) ⬇️

Copy link
Contributor

@rkrasiuk rkrasiuk left a 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

@rkrasiuk
Copy link
Contributor

rkrasiuk commented Jul 31, 2023

@roberto-bayardo sanity_check test which calls full_validation seems to be failing

@onbjerg onbjerg changed the title make the base fee computation parameters configurable via chain spec feat: make base fee computation parameters configurable via chain spec Jul 31, 2023
@onbjerg onbjerg added the M-changelog This change should be included in the changelog label Jul 31, 2023
@roberto-bayardo
Copy link
Contributor Author

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.

Copy link
Contributor

@rkrasiuk rkrasiuk left a 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

@roberto-bayardo roberto-bayardo requested a review from rkrasiuk July 31, 2023 23:42
Copy link
Collaborator

@mattsse mattsse left a 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

@merklefruit
Copy link
Contributor

Closes #3750

Copy link
Collaborator

@mattsse mattsse left a 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

Copy link
Collaborator

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

Suggested change
base_fee_params: &crate::BaseFeeParams,
base_fee_params: crate::BaseFeeParams,

Copy link
Contributor Author

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.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
#[derive(Serialize, Deserialize, Debug, Clone)]
#[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]

Copy link
Contributor Author

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

@roberto-bayardo roberto-bayardo requested a review from mattsse August 7, 2023 14:22
Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

lgtm

@mattsse mattsse added this pull request to the merge queue Aug 7, 2023
Merged via the queue into paradigmxyz:main with commit 9569deb Aug 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-op-reth Related to Optimism and op-reth C-enhancement New feature or request M-changelog This change should be included in the changelog

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants