-
Notifications
You must be signed in to change notification settings - Fork 1
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
Implement migration path for stakvaults #127
Comments
So yes, we can't have the It might not even be desired to have a possiblilty to approve in the future because that would essentially give the stakemanager ownership of vault funds, which is something we want to avoid. Verdict: Existing vaults on testnet, will have to unstake/leave and then create a new vault. Otherwise the migrateToVault function can be implemented like this. |
This commit introduces a function `migrateToVault(address)` that allows `StakeVault`s to migrate to other `StakeVault` instances. The idea is that, when an upgrade was done on the stake manager, it might introduces functions that can't be accessed through the stake vaults that are out there. Users will have to create new stake vault instances that provide the necessary functionality. `migrateToVault()` allows them to do so. Closes #127
This commit introduces a function `migrateToVault(address)` that allows `StakeVault`s to migrate to other `StakeVault` instances. The idea is that, when an upgrade was done on the stake manager, it might introduces functions that can't be accessed through the stake vaults that are out there. Users will have to create new stake vault instances that provide the necessary functionality. `migrateToVault()` allows them to do so. Closes #127
This commit introduces a function `migrateToVault(address)` that allows `StakeVault`s to migrate to other `StakeVault` instances. The idea is that, when an upgrade was done on the stake manager, it might introduces functions that can't be accessed through the stake vaults that are out there. Users will have to create new stake vault instances that provide the necessary functionality. `migrateToVault()` allows them to do so. Closes #127
This commit introduces a function `migrateToVault(address)` that allows `StakeVault`s to migrate to other `StakeVault` instances. The idea is that, when an upgrade was done on the stake manager, it might introduces functions that can't be accessed through the stake vaults that are out there. Users will have to create new stake vault instances that provide the necessary functionality. `migrateToVault()` allows them to do so. Closes #127
This commit introduces a function `migrateToVault(address)` that allows `StakeVault`s to migrate to other `StakeVault` instances. The idea is that, when an upgrade was done on the stake manager, it might introduces functions that can't be accessed through the stake vaults that are out there. Users will have to create new stake vault instances that provide the necessary functionality. `migrateToVault()` allows them to do so. Closes #127
When the stake manager is upgraded, there's a chance that new APIs are added to the stake managers interface.
Since the stake manager only allows for interaction with stake vaults, it's the stake vaults job to provide the necessary functions to interact with these new interface capabilities.
Currently
StakeVault
s are not upgradeable.It's also not really possible for us to make them upgradeable in the traditional sense because that would mean the protocol owner would ultimately control the funds of all users.
So for cases like described above (in fact, we now have such a case), we need to offer users a way to migrate their stake to a newer vault.
We need to take into account that users might have vaults that are locked, so it's important all state is transferred accordingly.
Here's how this could work:
RewardsStreamerMP
introduces a new function to claim "live" rewards, let's call itcompound()
The function requires
msg.sender
to be a registered vault and a trusted vault implementation.So this means, some
StakeVault
implementation codehash (**in reality, this is a proxy clone codehash, but since it has the implementation address baked into its source, it will inherently represent a stakevault) must have been whitelisted for this to work.StakeVault
looks like this:This stakevault implementation comes with the necessary function, but existing stake vaults don't have this.
So users have to take action.
At this point, they can either
leave()
the system (this is because the stake manager's implementation address has changed, so they are allowed to opt out), then create a new vault andstake()
again. However, this means, the system forces them to step out and back in again, because they can't use the new function otherwise.Instead, they will first create a new proxy clone off the new
StakeVault
and register it with the stake manager using theVaultFactory
. So they'll callVaultFactory.createVault()
.Now, with the new vault and hand, they can tell the system that they want to migrate their old vault to a new one. We could have a
migrateToVault()
function that looks something like this:StakeVault
that has to perform this transfer:Now, this has introduced a new issue:
The whole point of this issue here is that we need a way to move to stake vaults that provide the functions we need.
The current
StakeVault
s do not have thismigrateToVault
function.One way around this would be to allow the owner of a stakevault to perform the migration straight on the stake manager:
As I'm writing this, I realized that
StakeVault
now has to approve that stakemanager can move the funds on behalf of it..Approval is another function that is not exposed by the
StakeVault
as of now...The text was updated successfully, but these errors were encountered: