-
Notifications
You must be signed in to change notification settings - Fork 45
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
Add inflation bounds to inflation adjustment algorithm #644
Draft
stronk-dev
wants to merge
1
commit into
livepeer:delta
Choose a base branch
from
stronk-dev:feature/InflationBounds
base: delta
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I know this is just a draft PR, and will ultimately need thorough review and tests, but just commenting for reference on one issue...
In the past I know it was true that when introducing new storage variables, they actually HAD to be included AFTER existing storage variables in the contract code. Because when the contract was upgraded, the storage layout onchain stayed the same and would load the existing values into the right variables. I do not know if the latest compilers have been updated to solve for this or not. But probably best to include the new variables after all other storage variables have been declared.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Note that the Minter is not an upgradeable proxy like the other contracts so in order to make this change onchain would have to deploy a completely new Minter and register it to replace the current one. (Which means the storage layout stuff wouldn't apply since its a fresh contract)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Took a quick look at this, and while this is not intended to be a complete spec, I see the following complexity in this...
The Minter state would need to be duplicated to the new Minter via either the constructor, or by calling the appropriate setters. So either the deployment would need to be tightly coordinated such that the state values are set to the old Minter's state values exactly, or would need to be scripted to read the old values and feed them as inputs to the constructor. (Requires more testing of the deployment script.)
The function that transfers to a new minter is pretty high stakes. It transfers all ETH and LPT deposited within the protocol from the old Minter to the new Minter. And of course the ownership of these contracts are verified such that it can't accidentally pass the value to an unowned contract. While all testable and scriptable, I'd say the bar is higher for the community gaining confidence in this potential upgrade, than it would be to simply upgrade a target contract in the proxy mechanism.
Commenting to memorialize the potential complexity of this upgrade path versus other options. But LMK if you think I'm misunderstanding anything here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In practice, all of these steps after deploying the new Minter would be batched into a single atomic tx via the Governor - the JSON below roughly captures the steps in the tx (this was for a Minter related upgrade in the past):