Update Substrate & Polkadot (#523)

This commit is contained in:
Bastian Köcher
2021-07-05 23:35:28 +02:00
committed by GitHub
parent ee835bebeb
commit a6bd34545e
11 changed files with 409 additions and 384 deletions
+14 -9
View File
@@ -25,7 +25,7 @@ use sp_consensus::BlockStatus;
use sp_core::traits::SpawnNamed;
use sp_runtime::{
generic::BlockId,
traits::{Block as BlockT, Header as HeaderT, Zero, HashFor},
traits::{Block as BlockT, HashFor, Header as HeaderT, Zero},
};
use cumulus_client_consensus_common::ParachainConsensus;
@@ -225,9 +225,10 @@ where
let (header, extrinsics) = candidate.block.deconstruct();
let compact_proof = match candidate.proof.into_compact_proof::<HashFor<Block>>(
last_head.state_root().clone(),
) {
let compact_proof = match candidate
.proof
.into_compact_proof::<HashFor<Block>>(last_head.state_root().clone())
{
Ok(proof) => proof,
Err(e) => {
tracing::error!(target: "cumulus-collator", "Failed to compact proof: {:?}", e);
@@ -235,7 +236,6 @@ where
}
};
// Create the parachain block data for the validators.
let b = ParachainBlockData::<Block>::new(header, extrinsics, compact_proof);
@@ -322,11 +322,14 @@ pub async fn start_collator<Block, RA, BS, Spawner>(
};
overseer_handler
.send_msg(CollationGenerationMessage::Initialize(config))
.send_msg(
CollationGenerationMessage::Initialize(config),
"StartCollator",
)
.await;
overseer_handler
.send_msg(CollatorProtocolMessage::CollateOn(para_id))
.send_msg(CollatorProtocolMessage::CollateOn(para_id), "StartCollator")
.await;
}
@@ -451,9 +454,11 @@ mod tests {
assert_eq!(1, *block.header().number());
// Ensure that we did not include `:code` in the proof.
let db = block.storage_proof()
let db = block
.storage_proof()
.to_storage_proof::<BlakeTwo256>(Some(header.state_root()))
.unwrap().0
.unwrap()
.0
.into_memory_db();
let backend =