-
Notifications
You must be signed in to change notification settings - Fork 2.6k
try-runtime-cli: Add execute-block subcommand #9077
Conversation
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.
Looks generally good, with some nits. Ping me again when CI is green?
|
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.
Listed a few minor potential improvements above, but they all can be considered optional; none of them are real blockers.
…ubstrate into zeke-try-runtime-exec-block
builder.inject_key_value(&[(code_key, code)]).build().await? | ||
} else { | ||
builder | ||
.inject_hashed_key(well_known_keys::CODE) |
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.
this is fine, but i don't 100% understand the case when you would not fetch state from the all the runtime modules?
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.
@kianenigma, perhaps obvious I also think its worth noting that this will have no affect on the builder if we are using State::Snap
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.
this is fine, but i don't 100% understand the case when you would not fetch state from the all the runtime modules?
For example of the offchain worker, you are only interested in executing the OCW of one pallet. Albeit, you must be sure that the OCW of all other pallets won't panic or sth if they don't have any data set in their pallet.
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.
@kianenigma but does execute block run the offchain worker? my point here is that i don't see why you would run execute_block without downloading the whole state because otherwise you get a storage root mismatch
however maybe some edgecase i don't know about
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.
@kianenigma your changes look good to me
Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com>
…tytech/substrate into zeke-try-runtime-exec-block
* add helper for block_at * remove redundant bound * doc for fn block_at
…tytech/substrate into zeke-try-runtime-exec-block
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.
LGMT
bot merge |
Trying merge. |
* Refactor remote_externalities::rpc_api * try-runtime-cli: Adde `execute-block` subcommand * Trivial * Address some comments * Use required_if & remove header-at usage * Improve doc * Update comment * small tweaks * add overwrite-code to shared params * Update utils/frame/try-runtime/cli/src/lib.rs Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com> * make url a shared param * add helper for block_at (#9153) * add helper for block_at * remove redundant bound * doc for fn block_at * Update error message Co-authored-by: kianenigma <kian@parity.io> Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com>
* Refactor remote_externalities::rpc_api * try-runtime-cli: Adde `execute-block` subcommand * Trivial * Address some comments * Use required_if & remove header-at usage * Improve doc * Update comment * small tweaks * add overwrite-code to shared params * Update utils/frame/try-runtime/cli/src/lib.rs Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com> * make url a shared param * add helper for block_at (#9153) * add helper for block_at * remove redundant bound * doc for fn block_at * Update error message Co-authored-by: kianenigma <kian@parity.io> Co-authored-by: Peter Goodspeed-Niklaus <coriolinus@users.noreply.github.com>
This PR adds the
execute-block
subcomand to thetry-runtime
command.execute-block
allows the user to specify a block to execute against the runtime state of its parent block.Update 1: this removes the
--header-at
option, and now conditionally has--block-at
as a shared option; thus--block-at
is no longer an options forlive
.Update 2:
--url
is now a shared param and is no longer used as arg to the state subcommand.NOTE: for anyone trying out this tool you may need to bump the
--max-rpc-payload
on the archive node used for live queries in order to load in some bigger storage items