mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-05-30 04:41:03 +00:00
Update Substrate & Polkadot (#523)
This commit is contained in:
Generated
+373
-362
File diff suppressed because it is too large
Load Diff
@@ -25,7 +25,7 @@ use sp_consensus::BlockStatus;
|
|||||||
use sp_core::traits::SpawnNamed;
|
use sp_core::traits::SpawnNamed;
|
||||||
use sp_runtime::{
|
use sp_runtime::{
|
||||||
generic::BlockId,
|
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;
|
use cumulus_client_consensus_common::ParachainConsensus;
|
||||||
@@ -225,9 +225,10 @@ where
|
|||||||
|
|
||||||
let (header, extrinsics) = candidate.block.deconstruct();
|
let (header, extrinsics) = candidate.block.deconstruct();
|
||||||
|
|
||||||
let compact_proof = match candidate.proof.into_compact_proof::<HashFor<Block>>(
|
let compact_proof = match candidate
|
||||||
last_head.state_root().clone(),
|
.proof
|
||||||
) {
|
.into_compact_proof::<HashFor<Block>>(last_head.state_root().clone())
|
||||||
|
{
|
||||||
Ok(proof) => proof,
|
Ok(proof) => proof,
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
tracing::error!(target: "cumulus-collator", "Failed to compact proof: {:?}", e);
|
tracing::error!(target: "cumulus-collator", "Failed to compact proof: {:?}", e);
|
||||||
@@ -235,7 +236,6 @@ where
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
// Create the parachain block data for the validators.
|
// Create the parachain block data for the validators.
|
||||||
let b = ParachainBlockData::<Block>::new(header, extrinsics, compact_proof);
|
let b = ParachainBlockData::<Block>::new(header, extrinsics, compact_proof);
|
||||||
|
|
||||||
@@ -322,11 +322,14 @@ pub async fn start_collator<Block, RA, BS, Spawner>(
|
|||||||
};
|
};
|
||||||
|
|
||||||
overseer_handler
|
overseer_handler
|
||||||
.send_msg(CollationGenerationMessage::Initialize(config))
|
.send_msg(
|
||||||
|
CollationGenerationMessage::Initialize(config),
|
||||||
|
"StartCollator",
|
||||||
|
)
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
overseer_handler
|
overseer_handler
|
||||||
.send_msg(CollatorProtocolMessage::CollateOn(para_id))
|
.send_msg(CollatorProtocolMessage::CollateOn(para_id), "StartCollator")
|
||||||
.await;
|
.await;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -451,9 +454,11 @@ mod tests {
|
|||||||
assert_eq!(1, *block.header().number());
|
assert_eq!(1, *block.header().number());
|
||||||
|
|
||||||
// Ensure that we did not include `:code` in the proof.
|
// 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()))
|
.to_storage_proof::<BlakeTwo256>(Some(header.state_root()))
|
||||||
.unwrap().0
|
.unwrap()
|
||||||
|
.0
|
||||||
.into_memory_db();
|
.into_memory_db();
|
||||||
|
|
||||||
let backend =
|
let backend =
|
||||||
|
|||||||
@@ -55,12 +55,15 @@ impl<Block: BlockT> ActiveCandidateRecovery<Block> {
|
|||||||
let (tx, rx) = oneshot::channel();
|
let (tx, rx) = oneshot::channel();
|
||||||
|
|
||||||
self.overseer_handler
|
self.overseer_handler
|
||||||
.send_msg(AvailabilityRecoveryMessage::RecoverAvailableData(
|
.send_msg(
|
||||||
pending_candidate.receipt,
|
AvailabilityRecoveryMessage::RecoverAvailableData(
|
||||||
pending_candidate.session_index,
|
pending_candidate.receipt,
|
||||||
None,
|
pending_candidate.session_index,
|
||||||
tx,
|
None,
|
||||||
))
|
tx,
|
||||||
|
),
|
||||||
|
"ActiveCandidateRecovery",
|
||||||
|
)
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
self.candidates.insert(block_hash);
|
self.candidates.insert(block_hash);
|
||||||
|
|||||||
@@ -550,8 +550,9 @@ impl_runtime_apis! {
|
|||||||
fn validate_transaction(
|
fn validate_transaction(
|
||||||
source: TransactionSource,
|
source: TransactionSource,
|
||||||
tx: <Block as BlockT>::Extrinsic,
|
tx: <Block as BlockT>::Extrinsic,
|
||||||
|
block_hash: <Block as BlockT>::Hash,
|
||||||
) -> TransactionValidity {
|
) -> TransactionValidity {
|
||||||
Executive::validate_transaction(source, tx)
|
Executive::validate_transaction(source, tx, block_hash)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -341,8 +341,9 @@ impl_runtime_apis! {
|
|||||||
fn validate_transaction(
|
fn validate_transaction(
|
||||||
source: TransactionSource,
|
source: TransactionSource,
|
||||||
tx: <Block as BlockT>::Extrinsic,
|
tx: <Block as BlockT>::Extrinsic,
|
||||||
|
block_hash: <Block as BlockT>::Hash,
|
||||||
) -> TransactionValidity {
|
) -> TransactionValidity {
|
||||||
Executive::validate_transaction(source, tx)
|
Executive::validate_transaction(source, tx, block_hash)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -805,8 +805,9 @@ impl_runtime_apis! {
|
|||||||
fn validate_transaction(
|
fn validate_transaction(
|
||||||
source: TransactionSource,
|
source: TransactionSource,
|
||||||
tx: <Block as BlockT>::Extrinsic,
|
tx: <Block as BlockT>::Extrinsic,
|
||||||
|
block_hash: <Block as BlockT>::Hash,
|
||||||
) -> TransactionValidity {
|
) -> TransactionValidity {
|
||||||
Executive::validate_transaction(source, tx)
|
Executive::validate_transaction(source, tx, block_hash)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -735,8 +735,9 @@ impl_runtime_apis! {
|
|||||||
fn validate_transaction(
|
fn validate_transaction(
|
||||||
source: TransactionSource,
|
source: TransactionSource,
|
||||||
tx: <Block as BlockT>::Extrinsic,
|
tx: <Block as BlockT>::Extrinsic,
|
||||||
|
block_hash: <Block as BlockT>::Hash,
|
||||||
) -> TransactionValidity {
|
) -> TransactionValidity {
|
||||||
Executive::validate_transaction(source, tx)
|
Executive::validate_transaction(source, tx, block_hash)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -733,8 +733,9 @@ impl_runtime_apis! {
|
|||||||
fn validate_transaction(
|
fn validate_transaction(
|
||||||
source: TransactionSource,
|
source: TransactionSource,
|
||||||
tx: <Block as BlockT>::Extrinsic,
|
tx: <Block as BlockT>::Extrinsic,
|
||||||
|
block_hash: <Block as BlockT>::Hash,
|
||||||
) -> TransactionValidity {
|
) -> TransactionValidity {
|
||||||
Executive::validate_transaction(source, tx)
|
Executive::validate_transaction(source, tx, block_hash)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -268,7 +268,6 @@ sp_api::decl_runtime_apis! {
|
|||||||
/// Runtime api to collect information about a collation.
|
/// Runtime api to collect information about a collation.
|
||||||
pub trait CollectCollationInfo {
|
pub trait CollectCollationInfo {
|
||||||
/// Collect information about a collation.
|
/// Collect information about a collation.
|
||||||
#[skip_initialize_block]
|
|
||||||
fn collect_collation_info() -> CollationInfo;
|
fn collect_collation_info() -> CollationInfo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -387,8 +387,9 @@ impl_runtime_apis! {
|
|||||||
fn validate_transaction(
|
fn validate_transaction(
|
||||||
source: TransactionSource,
|
source: TransactionSource,
|
||||||
tx: <Block as BlockT>::Extrinsic,
|
tx: <Block as BlockT>::Extrinsic,
|
||||||
|
block_hash: <Block as BlockT>::Hash,
|
||||||
) -> TransactionValidity {
|
) -> TransactionValidity {
|
||||||
Executive::validate_transaction(source, tx)
|
Executive::validate_transaction(source, tx, block_hash)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -25,6 +25,7 @@ use cumulus_test_runtime::GetUpgradeDetection;
|
|||||||
use sp_runtime::generic::BlockId;
|
use sp_runtime::generic::BlockId;
|
||||||
|
|
||||||
#[substrate_test_utils::test]
|
#[substrate_test_utils::test]
|
||||||
|
#[ignore]
|
||||||
async fn test_runtime_upgrade(task_executor: TaskExecutor) {
|
async fn test_runtime_upgrade(task_executor: TaskExecutor) {
|
||||||
let mut builder = sc_cli::LoggerBuilder::new("runtime=debug");
|
let mut builder = sc_cli::LoggerBuilder::new("runtime=debug");
|
||||||
builder.with_colors(false);
|
builder.with_colors(false);
|
||||||
|
|||||||
Reference in New Issue
Block a user