Skip to content

Use "original" type for BlockWeights#1742

Merged
notlesh merged 1 commit intomasterfrom
notlesh-fix-try-runtime-2022-08-11
Aug 11, 2022
Merged

Use "original" type for BlockWeights#1742
notlesh merged 1 commit intomasterfrom
notlesh-fix-try-runtime-2022-08-11

Conversation

@notlesh
Copy link
Contributor

@notlesh notlesh commented Aug 11, 2022

What does it do?

Fixes try-runtime by ensuring that moonbase runtime declares the same type for BlockWeights as it did before #1576.

This is necessary because of how our impl_runtime_apis_plus_common macro uses the type:

            #[cfg(feature = "try-runtime")]
            impl frame_try_runtime::TryRuntime<Block> for Runtime {
                fn on_runtime_upgrade() -> (Weight, Weight) {
                    log::info!("try-runtime::on_runtime_upgrade()");
                    // NOTE: intentional expect: we don't want to propagate the error backwards,
                    // and want to have a backtrace here. If any of the pre/post migration checks
                    // fail, we shall stop right here and right now.
                    let weight = Executive::try_runtime_upgrade()
                        .expect("runtime upgrade logic *must* be infallible");
                    (weight, BlockWeights::get().max_block)
                }

                fn execute_block_no_check(block: Block) -> Weight {
                    Executive::execute_block_no_check(block)
                }
            }

@notlesh notlesh added B0-silent Changes should not be mentioned in any release notes D3-trivial PR contains trivial changes in a runtime directory that do not require an audit labels Aug 11, 2022
@notlesh notlesh requested a review from crystalin August 11, 2022 16:25
@notlesh notlesh added the A0-pleasereview Pull request needs code review. label Aug 11, 2022
@notlesh notlesh merged commit 74ee965 into master Aug 11, 2022
@notlesh notlesh deleted the notlesh-fix-try-runtime-2022-08-11 branch August 11, 2022 20:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A0-pleasereview Pull request needs code review. B0-silent Changes should not be mentioned in any release notes D3-trivial PR contains trivial changes in a runtime directory that do not require an audit

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants