paritytech / substrate

Substrate: The platform for blockchain innovators
Apache License 2.0
8.39k stars 2.65k forks source link

try-runtime-cli: `execute-block` & `create-snapshot` tests #14343

Closed Szegoo closed 1 year ago

Szegoo commented 1 year ago

This PR adds tests for the following try-runtime commands:

Part of: #13796

Kusama address: DfqY6XQUSETTszBQ1juocTcG9iiDoXhvq1CoVadBSUqTGJS

Szegoo commented 1 year ago

@liamaharon Could you review this?

kianenigma commented 1 year ago

Can you add your address for tip cc @juangirini?

juangirini commented 1 year ago

bot fmt

command-bot[bot] commented 1 year ago

@juangirini https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/3007981 was started for your command "$PIPELINE_SCRIPTS_DIR/commands/fmt/fmt.sh". Check out https://gitlab.parity.io/parity/mirrors/substrate/-/pipelines?page=1&scope=all&username=group_605_bot to know what else is being executed currently.

Comment bot cancel 3-74db7a7e-7bf8-44c2-bfaf-70e8229bb829 to cancel this command or bot cancel to cancel all commands in this pull request.

command-bot[bot] commented 1 year ago

@juangirini Command "$PIPELINE_SCRIPTS_DIR/commands/fmt/fmt.sh" has finished. Result: https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/3007981 has finished. If any artifacts were generated, you can download them from https://gitlab.parity.io/parity/mirrors/substrate/-/jobs/3007981/artifacts/download.

juangirini commented 1 year ago

/tip small

substrate-tip-bot[bot] commented 1 year ago

@juangirini A small (2 KSM) tip was successfully submitted for @Szegoo (DfqY6XQUSETTszBQ1juocTcG9iiDoXhvq1CoVadBSUqTGJS on kusama).

https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fkusama-rpc.polkadot.io#/referenda tip

liamaharon commented 1 year ago

bot rebase

paritytech-processbot[bot] commented 1 year ago

Rebased

Szegoo commented 1 year ago

@liamaharon Don't merge this yet :P I am working on incorporating --at into the tests.

kianenigma commented 1 year ago

@liamaharon Don't merge this yet :P I am working on incorporating --at into the tests.

Please let us know once ready for final review.

Szegoo commented 1 year ago

@liamaharon I realised that the problem I encountered was not in the block_hash function. It seems like there isn't an issue, but I am a bit confused.

In the execute_block function why don't we execute the block we specified with the --at option? The code will do execute_block for the next block.

https://github.com/paritytech/substrate/blob/6e0059a416a5768e58765a49b33c21920c0b0eb9/utils/frame/try-runtime/cli/src/commands/execute_block.rs#L99-L107

liamaharon commented 1 year ago

Hmm.. Intuitively I would also expect execute_block to re-execute the block at rather than at + 1. @kianenigma do you remember if this behavior is intentional?

ggwpez commented 1 year ago

Needs to merge master to make the CI happy.

ggwpez commented 1 year ago

Going to merge this. We can investigate afterwards if this --at needs a fix. This way we already have some tests.

ggwpez commented 1 year ago

bot merge

paritytech-processbot[bot] commented 1 year ago

Waiting for commit status.

kianenigma commented 1 year ago

/tip small

substrate-tip-bot[bot] commented 1 year ago

@kianenigma A small (2 KSM) tip was successfully submitted for @Szegoo (DfqY6XQUSETTszBQ1juocTcG9iiDoXhvq1CoVadBSUqTGJS on kusama).

https://polkadot.js.org/apps/?rpc=wss%3A%2F%2Fkusama-rpc.polkadot.io#/referenda tip