mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-07-24 18:15:48 +00:00
Update Substrate (#623)
* Update to latest Substrate master (#615) * Update to latest Substrate master * Remove unneeded patch + warning * Update `Cargo.lock` * Fix tests * Update again * Bump Substrate (#616) * Update lock * Fix * Few fixes * Bump to latest Substrate * Fixes * fix pre-tx-pool compilation * more compilation fixes * Updates for the injection period - Liberal slash-refunding - Instant unbonding * *: Enable refactored authority discovery (#624) * *: Enable authority discovery module * *: List authority discovery id after parachain validator id Make sure existing key types don't change their order by appending the authority discovery id instead of injecting it between im online id and parachain validator id. * *: Gate authority discovery module behind feature flag * cli/src/lib.rs: Fix warnings * cli/src/lib.rs: Shorten line length * Bump Substrate * Bump Substrate * Line widths * Line widths again * Revert bump.
This commit is contained in:
@@ -50,7 +50,7 @@
|
||||
//! will be noted as non-beneficial to Substrate's peer-set management utility.
|
||||
|
||||
use sr_primitives::{generic::BlockId, traits::ProvideRuntimeApi};
|
||||
use substrate_client::error::Error as ClientError;
|
||||
use sp_blockchain::Error as ClientError;
|
||||
use substrate_network::{config::Roles, PeerId};
|
||||
use substrate_network::consensus_gossip::{
|
||||
self as network_gossip, ValidationResult as GossipValidationResult,
|
||||
@@ -792,9 +792,10 @@ mod tests {
|
||||
|
||||
{
|
||||
let mut message_allowed = validator.message_allowed();
|
||||
assert!(message_allowed(&peer_a, MessageIntent::Broadcast { previous_attempts: 0 }, &topic_a, &encoded));
|
||||
assert!(!message_allowed(&peer_a, MessageIntent::Broadcast { previous_attempts: 0 }, &topic_b, &encoded));
|
||||
assert!(!message_allowed(&peer_a, MessageIntent::Broadcast { previous_attempts: 0 }, &topic_c, &encoded));
|
||||
let intent = MessageIntent::Broadcast;
|
||||
assert!(message_allowed(&peer_a, intent, &topic_a, &encoded));
|
||||
assert!(!message_allowed(&peer_a, intent, &topic_b, &encoded));
|
||||
assert!(!message_allowed(&peer_a, intent, &topic_c, &encoded));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -900,7 +901,7 @@ mod tests {
|
||||
|
||||
{
|
||||
let mut message_allowed = validator.message_allowed();
|
||||
assert!(!message_allowed(&peer_a, MessageIntent::Broadcast { previous_attempts: 0 }, &topic_a, &encoded[..]));
|
||||
assert!(!message_allowed(&peer_a, MessageIntent::Broadcast, &topic_a, &encoded[..]));
|
||||
}
|
||||
|
||||
validator
|
||||
@@ -913,7 +914,7 @@ mod tests {
|
||||
.note_aware_under_leaf(&hash_a, c_hash);
|
||||
{
|
||||
let mut message_allowed = validator.message_allowed();
|
||||
assert!(message_allowed(&peer_a, MessageIntent::Broadcast { previous_attempts: 0 }, &topic_a, &encoded[..]));
|
||||
assert!(message_allowed(&peer_a, MessageIntent::Broadcast, &topic_a, &encoded[..]));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1006,8 +1007,9 @@ mod tests {
|
||||
}).encode();
|
||||
|
||||
let mut allowed = validator.inner.message_allowed();
|
||||
assert!(allowed(&peer_a, MessageIntent::Broadcast { previous_attempts: 0 }, &root_a_topic, &message[..]));
|
||||
assert!(!allowed(&peer_b, MessageIntent::Broadcast { previous_attempts: 0 }, &root_a_topic, &message[..]));
|
||||
let intent = MessageIntent::Broadcast;
|
||||
assert!(allowed(&peer_a, intent, &root_a_topic, &message[..]));
|
||||
assert!(!allowed(&peer_b, intent, &root_a_topic, &message[..]));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1077,8 +1079,9 @@ mod tests {
|
||||
}).encode();
|
||||
|
||||
let mut allowed = validator.inner.message_allowed();
|
||||
assert!(!allowed(&peer_a, MessageIntent::Broadcast { previous_attempts: 0 }, &root_a_topic, &message[..]));
|
||||
assert!(!allowed(&peer_b, MessageIntent::Broadcast { previous_attempts: 0 }, &root_a_topic, &message[..]));
|
||||
let intent = MessageIntent::Broadcast;
|
||||
assert!(!allowed(&peer_a, intent, &root_a_topic, &message[..]));
|
||||
assert!(!allowed(&peer_b, intent, &root_a_topic, &message[..]));
|
||||
}
|
||||
|
||||
// peer A gets updated to the chain head. now we'll attempt to broadcast
|
||||
@@ -1115,8 +1118,9 @@ mod tests {
|
||||
}).encode();
|
||||
|
||||
let mut allowed = validator.inner.message_allowed();
|
||||
assert!(allowed(&peer_a, MessageIntent::Broadcast { previous_attempts: 0 }, &root_a_topic, &message[..]));
|
||||
assert!(!allowed(&peer_b, MessageIntent::Broadcast { previous_attempts: 0 }, &root_a_topic, &message[..]));
|
||||
let intent = MessageIntent::Broadcast;
|
||||
assert!(allowed(&peer_a, intent, &root_a_topic, &message[..]));
|
||||
assert!(!allowed(&peer_b, intent, &root_a_topic, &message[..]));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@
|
||||
use sr_primitives::traits::{BlakeTwo256, Hash as HashT};
|
||||
use polkadot_primitives::Hash;
|
||||
use std::collections::{HashMap, HashSet};
|
||||
use substrate_client::error::Error as ClientError;
|
||||
use sp_blockchain::Error as ClientError;
|
||||
use super::{MAX_CHAIN_HEADS, GossipValidationResult, LeavesVec, ChainContext};
|
||||
|
||||
/// Construct a topic for a message queue root deterministically.
|
||||
|
||||
@@ -126,7 +126,7 @@ impl<P, E: Clone, N: NetworkService, T: Clone> Clone for Router<P, E, N, T> {
|
||||
}
|
||||
|
||||
impl<P: ProvideRuntimeApi + Send + Sync + 'static, E, N, T> Router<P, E, N, T> where
|
||||
P::Api: ParachainHost<Block, Error = substrate_client::error::Error>,
|
||||
P::Api: ParachainHost<Block, Error = sp_blockchain::Error>,
|
||||
N: NetworkService,
|
||||
T: Clone + Executor + Send + 'static,
|
||||
E: Future<Item=(),Error=()> + Clone + Send + 'static,
|
||||
|
||||
@@ -89,7 +89,7 @@ impl crate::gossip::ChainContext for TestChainContext {
|
||||
}
|
||||
|
||||
fn leaf_unrouted_roots(&self, leaf: &Hash, with_queue_root: &mut dyn FnMut(&Hash))
|
||||
-> Result<(), substrate_client::error::Error>
|
||||
-> Result<(), sp_blockchain::Error>
|
||||
{
|
||||
for root in self.ingress_roots.get(leaf).into_iter().flat_map(|roots| roots) {
|
||||
with_queue_root(root)
|
||||
|
||||
@@ -33,7 +33,7 @@ use polkadot_primitives::parachain::{
|
||||
FeeSchedule, HeadData, Retriable, CollatorId
|
||||
};
|
||||
use parking_lot::Mutex;
|
||||
use substrate_client::error::Result as ClientResult;
|
||||
use sp_blockchain::Result as ClientResult;
|
||||
use sr_api::{Core, RuntimeVersion, StorageProof, ApiExt};
|
||||
use sr_primitives::traits::{ApiRef, ProvideRuntimeApi};
|
||||
|
||||
@@ -231,7 +231,7 @@ impl Core<Block> for RuntimeApi {
|
||||
}
|
||||
|
||||
impl ApiExt<Block> for RuntimeApi {
|
||||
type Error = substrate_client::error::Error;
|
||||
type Error = sp_blockchain::Error;
|
||||
|
||||
fn map_api_result<F: FnOnce(&Self) -> Result<R, E>, R, E>(
|
||||
&self,
|
||||
|
||||
@@ -205,7 +205,7 @@ impl<P, E, N, T> ValidationNetwork<P, E, N, T> where N: NetworkService {
|
||||
/// A long-lived network which can create parachain statement routing processes on demand.
|
||||
impl<P, E, N, T> ParachainNetwork for ValidationNetwork<P, E, N, T> where
|
||||
P: ProvideRuntimeApi + Send + Sync + 'static,
|
||||
P::Api: ParachainHost<Block, Error = substrate_client::error::Error>,
|
||||
P::Api: ParachainHost<Block, Error = sp_blockchain::Error>,
|
||||
E: Clone + Future<Item=(),Error=()> + Send + Sync + 'static,
|
||||
N: NetworkService,
|
||||
T: Clone + Executor + Send + Sync + 'static,
|
||||
|
||||
Reference in New Issue
Block a user