Skip to content
Merged
Show file tree
Hide file tree
Changes from 19 commits
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
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ where
let block = Block::new(params.header.clone(), params.body.clone().unwrap_or_default());

runtime_api
.execute_block(parent_hash, block.clone())
.execute_block(parent_hash, block.clone().into())
.map_err(|e| Box::new(e) as Box<_>)?;

let storage_proof =
Expand Down
2 changes: 1 addition & 1 deletion cumulus/client/service/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -628,7 +628,7 @@ where
runtime_api.record_proof_with_recorder(storage_proof_recorder);

runtime_api
.execute_block(*block.header().parent_hash(), block)
.execute_block(*block.header().parent_hash(), block.into())
.map_err(Into::into)
}
}
8 changes: 4 additions & 4 deletions cumulus/pallets/aura-ext/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
use frame_support::traits::{ExecuteBlock, FindAuthor};
use sp_application_crypto::RuntimeAppPublic;
use sp_consensus_aura::{digests::CompatibleDigestItem, Slot};
use sp_runtime::traits::{Block as BlockT, Header as HeaderT};
use sp_runtime::traits::{Block as BlockT, Header as HeaderT, LazyBlock};

pub mod consensus_hook;
pub mod migration;
Expand Down Expand Up @@ -124,8 +124,8 @@ where
T: Config,
I: ExecuteBlock<Block>,
{
fn execute_block(block: Block) {
let (mut header, extrinsics) = block.deconstruct();
fn execute_block(mut block: Block::LazyBlock) {
let header = block.header_mut();
// We need to fetch the authorities before we execute the block, to get the authorities
// before any potential update.
let authorities = Authorities::<T>::get();
Expand Down Expand Up @@ -163,6 +163,6 @@ where
panic!("Invalid AuRa seal");
}

I::execute_block(Block::new(header, extrinsics));
I::execute_block(block);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ use sp_core::storage::{ChildInfo, StateVersion};
use sp_externalities::{set_and_run_with_externalities, Externalities};
use sp_io::{hashing::blake2_128, KillStorageResult};
use sp_runtime::traits::{
Block as BlockT, ExtrinsicCall, Hash as HashT, HashingFor, Header as HeaderT,
Block as BlockT, ExtrinsicCall, Hash as HashT, HashingFor, Header as HeaderT, LazyBlock,
};
use sp_state_machine::OverlayedChanges;
use sp_trie::{HashDBT, ProofSizeProvider, EMPTY_PREFIX};
Expand Down Expand Up @@ -124,11 +124,11 @@ where
.replace_implementation(host_storage_proof_size),
);

let block_data = codec::decode_from_bytes::<ParachainBlockData<B>>(block_data)
let block_data = codec::decode_from_bytes::<ParachainBlockData<B::LazyBlock>>(block_data)
.expect("Invalid parachain block data");

// Initialize hashmaps randomness.
sp_trie::add_extra_randomness(build_seed_from_head_data(
sp_trie::add_extra_randomness(build_seed_from_head_data::<B>(
&block_data,
relay_parent_storage_root,
));
Expand Down Expand Up @@ -363,7 +363,7 @@ fn validate_validation_data(
/// in the block data, to make sure the seed changes every block and that
/// the user cannot find about it ahead of time.
fn build_seed_from_head_data<B: BlockT>(
block_data: &ParachainBlockData<B>,
block_data: &ParachainBlockData<B::LazyBlock>,
relay_parent_storage_root: crate::relay_chain::Hash,
) -> [u8; 16] {
let mut bytes_to_hash = Vec::with_capacity(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ fn build_multiple_blocks_with_witness(
let proof_recorder = ProofRecorder::<Block>::with_ignored_nodes(ignored_nodes.clone());
api.record_proof_with_recorder(proof_recorder.clone());
api.register_extension(ProofSizeExt::new(proof_recorder));
api.execute_block(parent_hash, built_block.block.clone()).unwrap();
api.execute_block(parent_hash, built_block.block.clone().into()).unwrap();

let (header, extrinsics) = built_block.block.clone().deconstruct();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1372,7 +1372,7 @@ impl_runtime_apis! {
VERSION
}

fn execute_block(block: Block) {
fn execute_block(block: <Block as BlockT>::LazyBlock) {
Executive::execute_block(block)
}

Expand Down Expand Up @@ -1409,7 +1409,7 @@ impl_runtime_apis! {
}

fn check_inherents(
block: Block,
block: <Block as BlockT>::LazyBlock,
data: sp_inherents::InherentData,
) -> sp_inherents::CheckInherentsResult {
data.check_extrinsics(&block)
Expand Down Expand Up @@ -1623,7 +1623,7 @@ impl_runtime_apis! {
}

fn execute_block(
block: Block,
block: <Block as BlockT>::LazyBlock,
state_root_check: bool,
signature_check: bool,
select: frame_try_runtime::TryStateSelect,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1762,7 +1762,7 @@ pallet_revive::impl_runtime_apis_plus_revive_traits!(
VERSION
}

fn execute_block(block: Block) {
fn execute_block(block: <Block as BlockT>::LazyBlock) {
Executive::execute_block(block)
}

Expand Down Expand Up @@ -1799,7 +1799,7 @@ pallet_revive::impl_runtime_apis_plus_revive_traits!(
}

fn check_inherents(
block: Block,
block: <Block as BlockT>::LazyBlock,
data: sp_inherents::InherentData,
) -> sp_inherents::CheckInherentsResult {
data.check_extrinsics(&block)
Expand Down Expand Up @@ -2083,7 +2083,7 @@ pallet_revive::impl_runtime_apis_plus_revive_traits!(
}

fn execute_block(
block: Block,
block: <Block as BlockT>::LazyBlock,
state_root_check: bool,
signature_check: bool,
select: frame_try_runtime::TryStateSelect,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -745,7 +745,7 @@ impl_runtime_apis! {
VERSION
}

fn execute_block(block: Block) {
fn execute_block(block: <Block as BlockT>::LazyBlock) {
Executive::execute_block(block)
}

Expand Down Expand Up @@ -782,7 +782,7 @@ impl_runtime_apis! {
}

fn check_inherents(
block: Block,
block: <Block as BlockT>::LazyBlock,
data: sp_inherents::InherentData,
) -> sp_inherents::CheckInherentsResult {
data.check_extrinsics(&block)
Expand Down Expand Up @@ -1038,7 +1038,7 @@ impl_runtime_apis! {
}

fn execute_block(
block: Block,
block: <Block as BlockT>::LazyBlock,
state_root_check: bool,
signature_check: bool,
select: frame_try_runtime::TryStateSelect,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -696,7 +696,7 @@ impl_runtime_apis! {
VERSION
}

fn execute_block(block: Block) {
fn execute_block(block: <Block as BlockT>::LazyBlock) {
Executive::execute_block(block)
}

Expand Down Expand Up @@ -733,7 +733,7 @@ impl_runtime_apis! {
}

fn check_inherents(
block: Block,
block: <Block as BlockT>::LazyBlock,
data: sp_inherents::InherentData,
) -> sp_inherents::CheckInherentsResult {
data.check_extrinsics(&block)
Expand Down Expand Up @@ -981,7 +981,7 @@ impl_runtime_apis! {
}

fn execute_block(
block: Block,
block: <Block as BlockT>::LazyBlock,
state_root_check: bool,
signature_check: bool,
select: frame_try_runtime::TryStateSelect,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -884,7 +884,7 @@ impl_runtime_apis! {
VERSION
}

fn execute_block(block: Block) {
fn execute_block(block: <Block as BlockT>::LazyBlock) {
Executive::execute_block(block)
}

Expand Down Expand Up @@ -921,7 +921,7 @@ impl_runtime_apis! {
}

fn check_inherents(
block: Block,
block: <Block as BlockT>::LazyBlock,
data: sp_inherents::InherentData,
) -> sp_inherents::CheckInherentsResult {
data.check_extrinsics(&block)
Expand Down Expand Up @@ -1089,7 +1089,7 @@ impl_runtime_apis! {
}

fn execute_block(
block: Block,
block: <Block as BlockT>::LazyBlock,
state_root_check: bool,
signature_check: bool,
select: frame_try_runtime::TryStateSelect,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ impl_runtime_apis! {
VERSION
}

fn execute_block(block: Block) {
fn execute_block(block: <Block as BlockT>::LazyBlock) {
Executive::execute_block(block)
}

Expand Down Expand Up @@ -762,7 +762,7 @@ impl_runtime_apis! {
}

fn check_inherents(
block: Block,
block: <Block as BlockT>::LazyBlock,
data: sp_inherents::InherentData,
) -> sp_inherents::CheckInherentsResult {
data.check_extrinsics(&block)
Expand Down Expand Up @@ -912,7 +912,7 @@ impl_runtime_apis! {
}

fn execute_block(
block: Block,
block: <Block as BlockT>::LazyBlock,
state_root_check: bool,
signature_check: bool,
select: frame_try_runtime::TryStateSelect,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -725,7 +725,7 @@ impl_runtime_apis! {
VERSION
}

fn execute_block(block: Block) {
fn execute_block(block: <Block as BlockT>::LazyBlock) {
Executive::execute_block(block)
}

Expand Down Expand Up @@ -762,7 +762,7 @@ impl_runtime_apis! {
}

fn check_inherents(
block: Block,
block: <Block as BlockT>::LazyBlock,
data: sp_inherents::InherentData,
) -> sp_inherents::CheckInherentsResult {
data.check_extrinsics(&block)
Expand Down Expand Up @@ -936,7 +936,7 @@ impl_runtime_apis! {
}

fn execute_block(
block: Block,
block: <Block as BlockT>::LazyBlock,
state_root_check: bool,
signature_check: bool,
select: frame_try_runtime::TryStateSelect,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ impl_runtime_apis! {
VERSION
}

fn execute_block(block: Block) {
fn execute_block(block: <Block as BlockT>::LazyBlock) {
Executive::execute_block(block)
}

Expand Down Expand Up @@ -396,7 +396,7 @@ impl_runtime_apis! {
data.create_extrinsics()
}

fn check_inherents(block: Block, data: sp_inherents::InherentData) -> sp_inherents::CheckInherentsResult {
fn check_inherents(block: <Block as BlockT>::LazyBlock, data: sp_inherents::InherentData) -> sp_inherents::CheckInherentsResult {
data.check_extrinsics(&block)
}
}
Expand Down
6 changes: 3 additions & 3 deletions cumulus/parachains/runtimes/people/people-rococo/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,7 @@ impl_runtime_apis! {
VERSION
}

fn execute_block(block: Block) {
fn execute_block(block: <Block as BlockT>::LazyBlock) {
Executive::execute_block(block)
}

Expand Down Expand Up @@ -716,7 +716,7 @@ impl_runtime_apis! {
}

fn check_inherents(
block: Block,
block: <Block as BlockT>::LazyBlock,
data: sp_inherents::InherentData,
) -> sp_inherents::CheckInherentsResult {
data.check_extrinsics(&block)
Expand Down Expand Up @@ -860,7 +860,7 @@ impl_runtime_apis! {
}

fn execute_block(
block: Block,
block: <Block as BlockT>::LazyBlock,
state_root_check: bool,
signature_check: bool,
select: frame_try_runtime::TryStateSelect,
Expand Down
6 changes: 3 additions & 3 deletions cumulus/parachains/runtimes/people/people-westend/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -681,7 +681,7 @@ impl_runtime_apis! {
VERSION
}

fn execute_block(block: Block) {
fn execute_block(block: <Block as BlockT>::LazyBlock) {
Executive::execute_block(block)
}

Expand Down Expand Up @@ -718,7 +718,7 @@ impl_runtime_apis! {
}

fn check_inherents(
block: Block,
block: <Block as BlockT>::LazyBlock,
data: sp_inherents::InherentData,
) -> sp_inherents::CheckInherentsResult {
data.check_extrinsics(&block)
Expand Down Expand Up @@ -886,7 +886,7 @@ impl_runtime_apis! {
}

fn execute_block(
block: Block,
block: <Block as BlockT>::LazyBlock,
state_root_check: bool,
signature_check: bool,
select: frame_try_runtime::TryStateSelect,
Expand Down
6 changes: 3 additions & 3 deletions cumulus/parachains/runtimes/testing/penpal/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,7 @@ pallet_revive::impl_runtime_apis_plus_revive_traits!(
VERSION
}

fn execute_block(block: Block) {
fn execute_block(block: <Block as BlockT>::LazyBlock) {
Executive::execute_block(block)
}

Expand Down Expand Up @@ -970,7 +970,7 @@ pallet_revive::impl_runtime_apis_plus_revive_traits!(
}

fn check_inherents(
block: Block,
block: <Block as BlockT>::LazyBlock,
data: sp_inherents::InherentData,
) -> sp_inherents::CheckInherentsResult {
data.check_extrinsics(&block)
Expand Down Expand Up @@ -1138,7 +1138,7 @@ pallet_revive::impl_runtime_apis_plus_revive_traits!(
}

fn execute_block(
block: Block,
block: <Block as BlockT>::LazyBlock,
state_root_check: bool,
signature_check: bool,
select: frame_try_runtime::TryStateSelect,
Expand Down
Loading
Loading