Skip to content
This repository was archived by the owner on Nov 15, 2023. It is now read-only.
This repository was archived by the owner on Nov 15, 2023. It is now read-only.

contracts: Multi block migrations #13638

@athei

Description

@athei

pallet-contracts is notorious for requiring storage migrations when upgrading to a new version. Those migrations are also tend be quite heavy. Both in ref_time and proof_size. In general, migrations need to happen in a single block. Builders already ran into the problem that our migrations are too big for that. Hence they needed to write their own ad hoc multi block migrations.

We want to solve this problem by providing all migrations delivered with pallet-contracts to be multi block. To that end we will create a framework that allows our migrations to be written in a in a multi block fashion without too much boilerplate. Access to pallet-contracts will be blocked while the migration is in progress. This approach can probably be generalized to the rest of FRAME in the future. The whole runtime will be rejecting transactions while upgrading in that case, though. This might be okay if we also buffer/delay XCM messages while we are upgrading.

Migration for storage version 9 will be available retroactively as a multi block migration. Older versions are dropped as there is no chain in production using them anymore. Porting them all over would be an unreasonable amount of work. All future migrations will be multi block.

Metadata

Metadata

Labels

J0-enhancementAn additional feature request.Z4-involvedCan be fixed by an expert coder with good knowledge of the codebase.

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions