-
Notifications
You must be signed in to change notification settings - Fork 2.6k
code-substitute: Switch from block_hash
to block_number
#10600
Conversation
This is still not ideal, because if there's a code substitute at block 10, and a light client warp syncs to block 15, it will have to download the runtime at block 10, the runtime at block 15, compare them, and if they're equal then do the substitution. Basically the problem is that the client has no way to know whether the substitute is still relevant. |
We already had discussed this once :D You don't need to download the runtime at 10, because you should use the wasm binary provided in the chain spec. You could, as we are doing it, check the spec_version on startup and then you will just need to compare them against the spec_version of 15.
Same as above, you have the binary in the chain spec. You don't need to download it, because if you download it you will also not get the correct one. (You will get the one from on chain, while you want the one that is present in the chain spec) |
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
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.
Haven't review the code, but 👍
…aritytech/substrate into bkchr-code-substitute-use-block-number
bot merge |
Error: It's not possible to meet the minimal approval count of 1 in paritytech/polkadot#4667 |
…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>
…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>
This will make it easier for light clients to work with the code-substitute.
For more information on this see: #10589
Closes: #10589
polkadot companion: paritytech/polkadot#4667