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

feat(protocol): Add a setter where all fee calc params can be set with one go #13816

Merged
merged 4 commits into from
May 25, 2023

Conversation

adaki2004
Copy link
Contributor

The idea behind this change is the following: We need to set all blockfee calculation related variables at one place because they are interconnected.
We thought the adjustment quotient can be a constant (or kind of a constant) which can be changed very infrequently with upgrades.
Well, yes it can but the problem is the following with the current devnet (described here, plotted down):

  1. Internal devnet started. The proofs coming obviously below the average so they are already tanked.
  2. When we want to set this adjustment quotient to a high value we face 2 issues:
    a. Fee is already low enough so it will not 'slow down' any curve if that curve is a flat line
    b. We cannot set this alone because it would affect the math - so we need to reset 'everything'

Here you could see the simulation of the above I did with this update. Fee tanked, but at some point we reset to the same baseFee but with a slower curve and it works. (see simulation test_scenario_where_blockfee_dumped_but_we_reset_parameters)
kép

We could have 2 workarounds:
a. Redeploy the whole devnet (unconvenient since we will loose data as well as third-party providers/provers)
b. Call setProofTimerParams() to a low value, which will drive up the fees to the desired level, then, call them again with the normal parameters and THEN upgrade the contract to have a different (slow) adjustment quotient.

None of these 2 are convenient so this is why we need this change, and put adjustment quotient into storage instead and have a setter.

dantaik
dantaik previously approved these changes May 25, 2023
davidtaikocha
davidtaikocha previously approved these changes May 25, 2023
@adaki2004 adaki2004 dismissed stale reviews from davidtaikocha and dantaik via 6fe1b05 May 25, 2023 10:01
@davidtaikocha davidtaikocha added this pull request to the merge queue May 25, 2023
Merged via the queue into main with commit a78a2f8 May 25, 2023
@davidtaikocha davidtaikocha deleted the add_setter_for_blockfee_calc_all_params branch May 25, 2023 12:24
@github-actions github-actions bot mentioned this pull request May 25, 2023
davidtaikocha added a commit that referenced this pull request May 25, 2023
davidtaikocha added a commit that referenced this pull request May 25, 2023
RogerLamTd pushed a commit that referenced this pull request May 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants