You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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.The text was updated successfully, but these errors were encountered: