Conversation
|
0f7069b to
7f73802
Compare
|
This PR changes implementation code, but doesn't include a changeset. Did you forget to add one? |
|
Hey @tynes! This PR has merge conflicts. Please fix them before continuing review. |
0ad43c4 to
5ca8db2
Compare
5ca8db2 to
51aa096
Compare
|
Leaving comment to update gas usage of the L1 Info Deposit (see #2582). The other option (annoying) is to not meter the L1 Info transaction's gas usage at all (but that does have some nice benefits). |
|
Hey @tynes! This PR has merge conflicts. Please fix them before continuing review. |
|
@K-Ho - Any progress on the numbers that we can use for this? We could do something that is "good enough" for devnet/testnet and tweak later on if necessary |
Currently working out the best formula to use w Michael. For now let’s just leave the averaging as a TODO and just use the vanilla basefee |
ab04bae to
bad2edc
Compare
I'm gonna write the formula as a library and test directly |
That's one good solution. The reason that this wasn't caught in the tests is that you compared the formula to itself rather than hardcoded values which would have made it obvious that the formula was not producing numbers we expect. |
|
Hey @tynes! This PR has merge conflicts. Please fix them before continuing review. |
58b9751 to
78bbe86
Compare
I've turned the logic into a library but its not yet properly tested. I think that I am using too many decimals (1e18), the basefee could technically grow large enough to lose precision. Maybe we should use less decimals (1e3) ? |
78bbe86 to
c4e5777
Compare
| } | ||
|
|
||
| function test_averageBasefee() external { | ||
| uint256 expect = Lib_FeeSmoothing.rollingAverage(0, 3); |
There was a problem hiding this comment.
This is not sufficient as a test, we need unit tests that are realistic
| function test_l1BaseFee() external { | ||
| uint256 l1BaseFee = gasOracle.l1BaseFee(); | ||
| assertEq(l1BaseFee, 100); | ||
| uint256 expect = Lib_FeeSmoothing.rollingAverage(0, 100); |
There was a problem hiding this comment.
The value here is 30 which I believe is realistic if 70% weighted towards prev value and 30% weighted towards next value. We need unit tests for the rollingAverage function, not 100% sure of the best way to go about it
Adds simple L1 fee smoothing to improve the UX so that the L1 fee spikes do not impact end users as much.
c4e5777 to
7182950
Compare
|
Hey @tynes! This PR has merge conflicts. Please fix them before continuing review. |
I don't actually care that much about precision errors, just that the output is close enough. In terms of decimals, during. the Yuga labs spike, the L1 base fee got up to 8 terra-wei (8e12). A uint256 can hold up to 1e77. So using 18 decimals is totally fine & won't overflow (it makes the effective max base fee 1e59 which is stupidly large). |
|
This PR is stale because it has been open 14 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
Description
This PR adds L1 basefee smoothing. The final numbers are pending but I think its ok to merge this for now and then tweak the numbers later pending internal devnet simulations