Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Merge branch 'main' into liam-better-runtime-check-customisability
  • Loading branch information
liamaharon committed Nov 17, 2023
commit 42025ee5f03dc8b9204bf994e17e6f03c4aeac31
14 changes: 13 additions & 1 deletion core/src/commands/offchain_worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use crate::{
build_executor,
commands::execute_block::next_hash_of,
full_extensions, parse, rpc_err_handler,
state::{LiveState, RuntimeChecks, State},
state::{LiveState, RuntimeChecks, SpecVersionCheck, State, TryRuntimeFeatureCheck},
state_machine_call, SharedParams, LOG_TARGET,
};

Expand Down Expand Up @@ -85,6 +85,18 @@ where
.state
.to_ext::<Block, HostFns>(&shared, &executor, None, runtime_checks)
.await?;
let block_ws_uri = command.header_ws_uri();
let rpc = ws_client(&block_ws_uri).await?;

// The block we want to *execute* at is the block passed by the user
let execute_at = live_state.at::<Block>()?;

let prev_block_live_state = live_state.to_prev_block_live_state::<Block>().await?;

// Get state for the prev block
let ext = State::Live(prev_block_live_state)
.to_ext::<Block, HostFns>(&shared, &executor, None, runtime_checks)
.await?;

let header = ChainApi::<(), Block::Hash, Block::Header, ()>::header(&rpc, execute_at)
.await
Expand Down
6 changes: 6 additions & 0 deletions core/src/commands/on_runtime_upgrade.rs
Original file line number Diff line number Diff line change
Expand Up @@ -58,13 +58,19 @@ pub struct Command {
pub checks: UpgradeCheckSelect,

/// Whether to disable weight warnings, useful if the runtime is for a relay chain.
///
/// This is used to adjust the behavior of weight measurement warnings.
#[clap(long, default_value = "false", default_missing_value = "true")]
pub no_weight_warnings: bool,

/// Whether to enforce the new runtime `spec_version` is greater or equal to the existing
/// `spec_version`.
#[clap(long, default_value = "true", default_missing_value = "true")]

pub check_spec_version: bool,
/// Whether to disable migration idempotency checks
#[clap(long, default_value = "false", default_missing_value = "true")]
pub no_idempotency_checks: bool,
}

// Runs the `on-runtime-upgrade` command.
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.