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

[Post HCU] Upgrade Migration contract on the service account and deploy AccountV2Migration #359

Open
janezpodhostnik opened this issue Feb 7, 2025 · 3 comments

Comments

@janezpodhostnik
Copy link
Collaborator

janezpodhostnik commented Feb 7, 2025

Context

A stub of the Migration contract should already exist on the service account because of #358. After the HCU the migration contract needs to be updated, but before it can be updated its dependency AccountV2Migration needs to be deployed to the service account.

After this we can enable on the fly migrations by setting the batch size on the AccountV2Migration contract (admin).

Transactions

Deploy AccountV2Migration

Upgrade Migration

(Optional) Set AccountV2Migration migration batch size

  • transaction:
import AccountV2Migration from 0xe467b9dd11fa00df

transaction(batchSize: UInt64, maxAddressIndex: UInt64) {
    prepare(signer: auth(Storage) &Account) {
        let admin = signer.storage
            .borrow<&AccountV2Migration.Admin>(
                from: AccountV2Migration.adminStoragePath
            )
            ?? panic("missing account V2 migration admin resource")
        admin.setBatchSize(batchSize)
        admin.setMaxAddressIndex(maxAddressIndex)
    }
}
  • authorizer: service account
  • arguments: batchSize and maxAddressIndex provided by @j1010001
@j1010001
Copy link
Member

Updated Tx for triggering the migration:

import AccountV2Migration from 0xe467b9dd11fa00df

transaction {
    prepare(signer: auth(Storage) &Account) {
        let admin = signer.storage
            .borrow<&AccountV2Migration.Admin>(
                from: AccountV2Migration.adminStoragePath
            )
            ?? panic("missing account V2 migration admin resource")
        admin.setBatchSize(BATCH_SIZE)
        admin.setMaxAddressIndex(ACCOUNT_ID)
    }
}

@j1010001
Copy link
Member

j1010001 commented Feb 14, 2025

I'll provide the parameters before we start of the HCU.
We will likely set the batch size twice - first time to 10, monitor the impact on the system transaction duration and then increase it to 100.

@janezpodhostnik
Copy link
Collaborator Author

updated the transaction @j1010001

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

2 participants