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

Fix RuntimeUpgradeTracker #1440

Closed
turuslan opened this issue Dec 5, 2022 · 0 comments
Closed

Fix RuntimeUpgradeTracker #1440

turuslan opened this issue Dec 5, 2022 · 0 comments
Assignees
Labels

Comments

@turuslan
Copy link
Contributor

turuslan commented Dec 5, 2022


Current RuntimeUpgradeTracker needs to know (all block headers to know) blocks where runtime upgrade happened.
This block is used as caching key for wasm code/module.
Sometimes we don't want/have all block headers (e.g. warp sync).

RuntimeUpgradeTracker can work without knowing all block headers.
Caching can be simplified:

  1. It can always retrieve correct runtime wasm code from block state.
  2. Block without runtime upgrade digest has same runtime wasm code as it's parent.

If we can't rely on RuntimeEnvironmentUpdated digest, then we need to store either code_hash: hash or runtime_upgraded: bool for each block that was either executed (and :code was set by wasm) or checked for upgrade with trie_diff(key=":code").
Finalized blocks can be compressed, by using range of numbers instead of block hash ([0, 1, ..., 100] => [0..100])

@turuslan turuslan self-assigned this Dec 5, 2022
@kamilsa kamilsa added this to KAGOME Dec 5, 2022
@kamilsa kamilsa moved this to Selected for development in KAGOME Dec 5, 2022
@kamilsa kamilsa added this to the Kusama treasury 1 milestone Dec 5, 2022
@kamilsa kamilsa added the Runtime label Dec 5, 2022
@turuslan turuslan changed the title Lazy RuntimeUpgradeTracker Fix RuntimeUpgradeTracker Dec 8, 2022
@kamilsa kamilsa closed this as completed Dec 15, 2022
Repository owner moved this from Selected for development to Done in KAGOME Dec 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants