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

state trie inner hashing runtime migration #9671

Closed
wants to merge 132 commits into from

Conversation

cheme
Copy link
Contributor

@cheme cheme commented Sep 1, 2021

This PR is a follow up of #9732 .
Only change to #9732 is the runtime migration module: cheme/substrate@state-update4-host2...cheme:state-update4-migrationruntime.
The module should be include to the runtime AFTER the chain did switch to hybrid state.
Then in each block a given portion of the state will be rewritten.
When processed, the module could be removed from the next runtime build.

Even if incomplete, I open this as draft, because there is a few points I am not sure how to achieve.
Mostly:

  • how to define a weight limit to a certain portion of the block size (or even better use remaining block size if running in on_finalize).
  • how to evaluate some weights (see comments in code).
  • if should run on finalize.

cc\ @thiolliere @shawntabrizi

@cheme
Copy link
Contributor Author

cheme commented Sep 21, 2021

Re-ping @shawntabrizi or @thiolliere or others about direction taken to evaluate weight in this PR (see TODOs in frame/state-migrate-0-to-1/src/lib.rs).

Also in https://github.com/cheme/substrate/blob/bf0aa3d60fef12e37b0f08aaf9e0d1e5563ccbf1/frame/state-migrate-0-to-1/src/lib.rs#L193 (branch where I try to evaluate number of blocks needed to migrate), I did some equivalent weight measurement to what should be configured in polkadot, but I am really not confident with the code I copied.

@cheme
Copy link
Contributor Author

cheme commented Oct 15, 2021

Starting with ea0d8f6 , the PR starts using inherents to calculate block number of items to process.
The content added from #9732 is now mainly in files:

  • frame/state-migrate-0-to-1/src/lib.rs
  • client/api/src/state_migration_inherents.rs
  • bin/node/runtime/src/lib.rs
  • bin/node/executor/tests/common.rs

@cheme
Copy link
Contributor Author

cheme commented Oct 15, 2021

cc\ @kianenigma , this is draft PR of migration :)

@gui1117
Copy link
Contributor

gui1117 commented Oct 15, 2021

this PR would be more readable if the diff was against #9732 I think

@kianenigma
Copy link
Contributor

might be replaced by #10073

@cheme
Copy link
Contributor Author

cheme commented Nov 5, 2021

Closing in favor of #10073

@cheme cheme closed this Nov 5, 2021
@kianenigma kianenigma mentioned this pull request Nov 18, 2021
4 tasks
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
A3-in_progress Pull request is in progress. No review needed at this stage.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants