Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(tests, cli): Add subcommand to gear-replay-cli tool #3033

Merged
merged 7 commits into from
Aug 25, 2023

Conversation

ekovalev
Copy link
Member

@ekovalev ekovalev commented Aug 5, 2023

Existing CLI replays blocks that have already been finalized. However, if an extrinsic panicked at the time of block creation, it would have been dropped and not included in a block, thereby destroying the whole purpose of attempting to get some meaningful information about the root cause of the panic.

To circumvent that, a subcommand is being introduced that would mimic the steps of a block producer (not validator): initialize a block and apply extrinsic through calling the BlockBuilder_apply_extrinsic runtime api. Current implementation only supports the Gear::run() extrinsic, mainly because it is where the message queue is processed, but also because it doesn't have any arguments, therefore the known encoded version of it can be supplied to the runtime api call (without a need of creating an UncheckedExtrinsic by hand and then encoding it - that would require having the Runtime as an explicit dependency, which we want to avoid).

@ekovalev ekovalev added A0-pleasereview PR is ready to be reviewed by the team C1-feature Feature request D5-tooling Helper tools and utilities labels Aug 5, 2023
Copy link
Member

@ukint-vs ukint-vs left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great. Works as expected.

Copy link
Member

@breathx breathx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove cache step from win CI

utils/gear-replay-cli/src/lib.rs Outdated Show resolved Hide resolved
utils/gear-replay-cli/src/cmd/replay_block.rs Show resolved Hide resolved
@ekovalev ekovalev added A3-gotissues PR occurred to have issues after the review and removed A0-pleasereview PR is ready to be reviewed by the team labels Aug 8, 2023
@NikVolf NikVolf added A2-mergeoncegreen PR is ready to merge after CI passes and removed A3-gotissues PR occurred to have issues after the review labels Aug 24, 2023
@NikVolf
Copy link
Member

NikVolf commented Aug 24, 2023

@ekovalev rebase to master and rerun CI please

@ekovalev ekovalev merged commit 93f9eb1 into master Aug 25, 2023
8 checks passed
@ekovalev ekovalev deleted the ek-extend-gear-replay-cli branch August 25, 2023 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A2-mergeoncegreen PR is ready to merge after CI passes C1-feature Feature request D5-tooling Helper tools and utilities
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants