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

[Lease][Migrate] move the storage of the current version, the old one, to the leaser #428

Open
gmanev7 opened this issue Sep 25, 2024 · 0 comments

Comments

@gmanev7
Copy link
Member

gmanev7 commented Sep 25, 2024

So far, each lease has been maintaining the version in its storage.
The Leaser controls the lease's lifecycle tightly. Migration to a new code is performed over all leases so keeping the version in each Lease is an unnecessary duplication that costs extra gas.

We still want to protect the leases from a wrong code migration, though. The validation cannot be done outside the Lease::migrate function because the new code has not been accessible by that moment. The solution is to send the old version with the migration message, check it against the code version, and return the latter for keeping it in the storage. A cheaper alternative to the last step is to query the last lease for its version.

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

No branches or pull requests

1 participant