Skip to content

r-13.0-rc3

@Marcin-Radecki Marcin-Radecki tagged this 20 Feb 11:28
# Description

`polkadot-1.2.0` has a pallet contracts storage version 15, whereas the
current Testnet has 12. There are 3 migrations to be done:
* `v13` - due to change
https://github.com/paritytech/substrate/pull/14079 storage map
`ContractInfoOf` receives a new field called `delegate_dependencies`.
This is a map that stores all contract account that calls this account
via low-level function `delegate_call` (e.g. used by contract upgrade
scenario). What `v13` migration does is just adds empty
`delegate_dependencies` field to each `ContractInfoOf` element (31 175
on AlephZero Testnet).
* `v14` - due to change
https://github.com/paritytech/substrate/pull/14020 pallet contract start
to use Holds API over deprecated Reserve API. In practice, it changes
nothing, other than that for each account that is the owner of the
uploaded code, there will be `Balances.Holds` set for all such accounts
- holds as total still use reserved funds from `System.Accounts`. `v14`
migration iterates over all members of `CodeInfoOf` map. (6 502 on
AlephZero Testnet).
* `v15` - due to change
https://github.com/paritytech/substrate/pull/14589 that essentially
reverts logic https://github.com/paritytech/substrate/pull/13369 and v10
pallet contract migration, that added `deposit_account` field to
`ContractInfoOf`. The reason it was needed in the first place was the
change introduced in Substrate 0.9.42 version that required ED to be
present on free funds. `v15` migration iterates over all elements of
ContractInfoOf map and:
  * decrease consumer counter for a deposit account, 
* transfers all balance of the deposit account to the contract account,
  * hold that balance on the contract account,
  * reap deposit account.

# Testing

This change needs to be tested on feature net to measure impact on a
chain (prediction is that those will be significant migrations, at least
that heavy as in 12 release). To address that, we limited multi block
migration weight to 1/4 of max block weight,
Assets 2
Loading