-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Conversation
This introduces a new field `code_substitute` into the chain spec. This can be used to substitute the on-chain wasm starting from a given block until there is another wasm on chain (determined through the `spec_version`). This can be used to fix broken on chain wasm runtimes.
/// The given `wasm_code` will be used to substitute the on-chain wasm code from the given | ||
/// block hash onwards. | ||
#[serde(default)] | ||
code_substitutes: HashMap<String, Bytes>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In a future pr I would like to replace String
with something that directly checks that we got here some hex value.
would be better if this were a simple code_hash -> alt_code_blob mapping. block number is easy to get wrong. |
This is using block hashes? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes LGTM, but let's hold off on merging until we decide whether we use block hashes or code hash to do the replacement.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems fine, but due to use of block hash any repeat of the same consensus issue would require another override in the chain spec.
bot merge |
Trying merge. |
/// Map of WASM runtime substitute starting at the child of the given block until the runtime | ||
/// version doesn't match anymore. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'd be good to point out that the wasm_runtime_overrides
trumps the wasm_runtime_substitutes
?
This introduces a new field `code_substitute` into the chain spec. This can be used to substitute the on-chain wasm starting from a given block until there is another wasm on chain (determined through the `spec_version`). This can be used to fix broken on chain wasm runtimes.
This introduces a new field
code_substitute
into the chain spec. Thiscan be used to substitute the on-chain wasm starting from a given block
until there is another wasm on chain (determined through the
spec_version
). This can be used to fix broken on chain wasm runtimes.polkadot companion: paritytech/polkadot#3093