code-substitute: Switch from block_hash to block_number (#10600)

* code-substitute: Switch from `block_hash` to `block_number`

This will make it easier for light clients to work with the code-substitute.

For more information on this see: https://github.com/paritytech/substrate/issues/10589

Closes: https://github.com/paritytech/substrate/issues/10589

* FMT

* Update client/service/src/client/wasm_substitutes.rs

Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>

* Update client/service/src/builder.rs

Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>

Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
This commit is contained in:
Bastian Köcher
2022-01-09 20:48:24 +01:00
committed by GitHub
parent 03a7738ed8
commit 3093bed933
4 changed files with 20 additions and 50 deletions
@@ -176,10 +176,10 @@ struct ClientSpec<E> {
#[serde(skip_serializing)]
#[allow(unused)]
genesis: serde::de::IgnoredAny,
/// Mapping from `block_hash` to `wasm_code`.
/// Mapping from `block_number` to `wasm_code`.
///
/// The given `wasm_code` will be used to substitute the on-chain wasm code from the given
/// block hash onwards.
/// The given `wasm_code` will be used to substitute the on-chain wasm code starting with the
/// given block number until the `spec_version` on chain changes.
#[serde(default)]
code_substitutes: BTreeMap<String, Bytes>,
}