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

Contracts migration logic #803

Merged
merged 15 commits into from
Dec 14, 2022
Merged

Contracts migration logic #803

merged 15 commits into from
Dec 14, 2022

Conversation

Dinonard
Copy link
Member

@Dinonard Dinonard commented Dec 12, 2022

Pull Request Summary

Context

pallet-contracts v9 storage migration can blow up in PoV size and this happened with Shibuya.
This PR provides an approach to migrate the storage in multiple steps.

  • I wanted to avoid forking the pallet-contracts and doing the modification directly in there
  • Most of the types needed from pallet-contracts are only available to pallet-contracts crate so they had to be redefined here

NOTE
It seems that PoV size is overestimated in the code (double the size we got with Shibuya upgrade).
As long as it's not underestimated it should be fine.

INFO main try-runtime::cli: TryRuntime_on_runtime_upgrade executed without errors. Consumed weight = (79450000000 ps, 47731515 byte), total weight = (500000000000 ps, 5242880 byte) (15.89 %, 910.41 %).

Check list

  • implement solution & test it
  • update Shiden too
  • updated spec version
  • updated semver

@Dinonard Dinonard requested review from PierreOssun and removed request for PierreOssun December 12, 2022 11:11
@Dinonard Dinonard marked this pull request as draft December 12, 2022 16:17
@Dinonard
Copy link
Member Author

Functionally correct but doesn't account for PoV issue.
paritytech/substrate#12908

If attempting to reproduce locally, please keep in mind that there's a bug in pallet-contracts related to try-runtime.
The fix: paritytech/substrate#12905

@Dinonard Dinonard requested review from 0x7CFE and akru December 13, 2022 16:14
@Dinonard Dinonard force-pushed the fix/pallet-contracts-migration branch from 5a89aad to bf1fe3d Compare December 13, 2022 16:19
@Dinonard Dinonard marked this pull request as ready for review December 14, 2022 09:49
Copy link
Contributor

@0x7CFE 0x7CFE left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Dinonard Dinonard merged commit 1ff5366 into master Dec 14, 2022
@Dinonard Dinonard deleted the fix/pallet-contracts-migration branch December 14, 2022 11:11
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

Successfully merging this pull request may close these issues.

2 participants