This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Improve code-substitutes
for light clients
#10589
Labels
I7-refactor
Code needs refactoring.
Comments
bkchr
added a commit
that referenced
this issue
Jan 9, 2022
* 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: #10589 Closes: #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>
grishasobol
pushed a commit
to gear-tech/substrate
that referenced
this issue
Mar 28, 2022
…ch#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: paritytech#10589 Closes: paritytech#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>
ark0f
pushed a commit
to gear-tech/substrate
that referenced
this issue
Feb 27, 2023
…ch#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: paritytech#10589 Closes: paritytech#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>
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
code-substitutes
can be found in the chain spec. They are used to substitute the on chain wasm code with a different wasm blob. This is useful for when there was a bug in the on chain wasm file and it can not be fixed with an upgrade because the chain stopped or for other reasons. The format is the following in the chain spec:While this works for full nodes, as they know all block hashes, a light clients are "warping" to the tip of the chain. This means they will not see all blocks, because that isn't important for them. However, they may need to execute the substituted wasm at some point while warp-syncing. Currently that is not really possible, because they don't know the height of a block hash. So, the idea is to replace the
block_hash
with ablock_number
. It is not really that important that we use a block hash there, the block number will bring the same result and it will be much easier for light clients.The text was updated successfully, but these errors were encountered: