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

fix(protocol): scale up basefee by GAS_TARGET * ADJUSTMENT_QUOTIENT #16549

Closed
wants to merge 4 commits into from

Conversation

dantaik
Copy link
Contributor

@dantaik dantaik commented Mar 28, 2024

Not a guru on math, this PR simply tris to follow OZ's suggestion to scale up the basefee by GAS_TARGET * ADJUSTMENT_QUOTIENT.

Based on the test result in test_eip1559_math, the basefee is scaled by 1200000000 times, since in our testnet, we see basefee is almost always 1wei (maybe even much smaller than 1wei), with 1200000000x scaled up, 1200000000wei is 1.2 gwei, seems to be a reasonable number.

@Brechtpd you may have the best knowledge to make the call.

@dantaik dantaik marked this pull request as ready for review March 28, 2024 09:39
/ LibFixedPointMath.SCALING_FACTOR,
_adjustmentFactor: adjustmentFactor
})
baseFee, 57_896_044_586_242_203_305_830_093_650_308_530_112_287_501_933_378_291_142_596
Copy link
Contributor Author

Choose a reason for hiding this comment

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

57_896_044_586_242_203_305_830_093_650_308_530_112_287_501_933_378_291_142_596 is 1200000000x of 48_246_703_821_869_050_543_408_253_349_256_099_602_613_005_189_120

@dantaik dantaik marked this pull request as draft March 28, 2024 09:45
Copy link

openzeppelin-code bot commented Mar 28, 2024

fix(protocol): scale up basefee by GAS_TARGET * ADJUSTMENT_QUOTIENT

Generated at commit: 4fdfe834df3695c9f8d8cb1718100fe9e3042ad3

🚨 Report Summary

Severity Level Results
Contracts Critical
High
Medium
Low
Note
Total
2
2
0
3
41
48
Dependencies Critical
High
Medium
Low
Note
Total
0
0
0
0
0
0

For more details view the full report in OpenZeppelin Code Inspector

@dantaik dantaik closed this Mar 28, 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.

1 participant