fix: separate Base Sepolia and OP Sepolia BASE_FEE_PARAMS#8789
Merged
mattsse merged 3 commits intoparadigmxyz:mainfrom Jun 12, 2024
Merged
fix: separate Base Sepolia and OP Sepolia BASE_FEE_PARAMS#8789mattsse merged 3 commits intoparadigmxyz:mainfrom
mattsse merged 3 commits intoparadigmxyz:mainfrom
Conversation
Rjected
approved these changes
Jun 12, 2024
Member
Rjected
left a comment
There was a problem hiding this comment.
this looks good, looks like it needs a cargo +nightly fmt
Comment on lines
+114
to
+141
| fn calculate_base_sepolia_base_fee_success() { | ||
| let base_fee = [ | ||
| 1000000000, 1000000000, 1000000000, 1072671875, 1059263476, 1049238967, 1049238967, 0, | ||
| 1, 2, | ||
| ]; | ||
| let gas_used = [ | ||
| 10000000, 10000000, 10000000, 9000000, 10001000, 0, 10000000, 10000000, 10000000, | ||
| 10000000, | ||
| ]; | ||
| let gas_limit = [ | ||
| 10000000, 12000000, 14000000, 10000000, 14000000, 2000000, 18000000, 18000000, | ||
| 18000000, 18000000, | ||
| ]; | ||
| let next_base_fee = [ | ||
| 1180000000, 1146666666, 1122857142, 1244299375, 1189416692, 1028254188, 1144836295, 1, | ||
| 2, 3, | ||
| ]; | ||
|
|
||
| for i in 0..base_fee.len() { | ||
| assert_eq!( | ||
| next_base_fee[i], | ||
| calc_next_block_base_fee( | ||
| gas_used[i] as u128, | ||
| gas_limit[i] as u128, | ||
| base_fee[i] as u128, | ||
| BASE_SEPOLIA_BASE_FEE_PARAMS, | ||
| ) as u64 | ||
| ); |
Member
There was a problem hiding this comment.
are these from an op-geth test? or just adjusted
Contributor
Author
There was a problem hiding this comment.
Just adjusted from before! This was a copy of the original calculate_optimism_sepolia_base_fee_success test above (since it already was setup for using an elasticity multiplier of 10)
And then I changed calculate_optimism_sepolia_base_fee_success to expect the correct values when using an elasticity multiplier of 6
mattsse
approved these changes
Jun 12, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Op-reth was not syncing for OP Sepolia and finally tracked down the issue to a bad setting when trying to calculate the next expected base fee. This PR is my attempt to fix it, but happy to implement another way!
From op-geth: