mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-04-27 22:07:58 +00:00
Add block number to activated leaves and associated fixes (#2718)
* add number to `ActivatedLeavesUpdate` * update subsystem util and overseer * use new ActivatedLeaf everywhere * sort view * sorted and limited view in network bridge * use live block hash only if it's newer * grumples
This commit is contained in:
committed by
GitHub
parent
a4ed8aaab2
commit
064df81ee4
@@ -23,7 +23,6 @@ use std::collections::{
|
||||
};
|
||||
use std::iter::IntoIterator;
|
||||
use std::pin::Pin;
|
||||
use std::sync::Arc;
|
||||
|
||||
use futures::{
|
||||
channel::mpsc,
|
||||
@@ -36,7 +35,7 @@ use sp_keystore::SyncCryptoStorePtr;
|
||||
use polkadot_node_subsystem_util::request_availability_cores_ctx;
|
||||
use polkadot_primitives::v1::{CandidateHash, CoreState, Hash, OccupiedCore};
|
||||
use polkadot_subsystem::{
|
||||
messages::AllMessages, ActiveLeavesUpdate, jaeger, SubsystemContext,
|
||||
messages::AllMessages, ActiveLeavesUpdate, SubsystemContext, ActivatedLeaf,
|
||||
};
|
||||
|
||||
use super::{error::recv_runtime, session_cache::SessionCache, LOG_TARGET, Metrics};
|
||||
@@ -121,12 +120,12 @@ impl Requester {
|
||||
async fn start_requesting_chunks<Context>(
|
||||
&mut self,
|
||||
ctx: &mut Context,
|
||||
new_heads: impl Iterator<Item = (Hash, Arc<jaeger::Span>)>,
|
||||
new_heads: impl Iterator<Item = ActivatedLeaf>,
|
||||
) -> super::Result<Option<NonFatalError>>
|
||||
where
|
||||
Context: SubsystemContext,
|
||||
{
|
||||
for (leaf, _) in new_heads {
|
||||
for ActivatedLeaf { hash: leaf, .. } in new_heads {
|
||||
let cores = match query_occupied_cores(ctx, leaf).await {
|
||||
Err(err) => return Ok(Some(err)),
|
||||
Ok(cores) => cores,
|
||||
|
||||
@@ -32,9 +32,11 @@ use sc_network as network;
|
||||
use sc_network::IfDisconnected;
|
||||
use sc_network::config as netconfig;
|
||||
|
||||
use polkadot_subsystem::{ActiveLeavesUpdate, FromOverseer, OverseerSignal, messages::{AllMessages,
|
||||
AvailabilityDistributionMessage, AvailabilityStoreMessage, NetworkBridgeMessage, RuntimeApiMessage,
|
||||
RuntimeApiRequest}
|
||||
use polkadot_subsystem::{ActiveLeavesUpdate, FromOverseer, OverseerSignal, ActivatedLeaf,
|
||||
messages::{
|
||||
AllMessages, AvailabilityDistributionMessage, AvailabilityStoreMessage, NetworkBridgeMessage,
|
||||
RuntimeApiMessage, RuntimeApiRequest,
|
||||
}
|
||||
};
|
||||
use polkadot_primitives::v1::{CandidateHash, CoreState, ErasureChunk, GroupIndex, Hash, Id
|
||||
as ParaId, ScheduledCore, SessionInfo, ValidatorId,
|
||||
@@ -169,7 +171,11 @@ impl TestState {
|
||||
self
|
||||
.relay_chain.iter().zip(advanced)
|
||||
.map(|(old, new)| ActiveLeavesUpdate {
|
||||
activated: smallvec![(new.clone(), Arc::new(jaeger::Span::Disabled))],
|
||||
activated: smallvec![ActivatedLeaf {
|
||||
hash: new.clone(),
|
||||
number: 1,
|
||||
span: Arc::new(jaeger::Span::Disabled),
|
||||
}],
|
||||
deactivated: smallvec![old.clone()],
|
||||
}).collect::<Vec<_>>()
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user