mirror of
https://github.com/pezkuwichain/pezkuwi-subxt.git
synced 2026-06-13 18:41:05 +00:00
overseer becomes orchestra (#5542)
* rename overseer-gen to orchestra Also drop `gum` and use `tracing`. * make orchestra compile as standalone * introduce Spawner trait to split from sp_core Finalizes the independence of orchestra from polkadot-overseer * slip of the pen * other fixins * remove unused import * Update node/overseer/orchestra/proc-macro/src/impl_builder.rs Co-authored-by: Vsevolod Stakhov <vsevolod.stakhov@parity.io> * Update node/overseer/orchestra/proc-macro/src/impl_builder.rs Co-authored-by: Vsevolod Stakhov <vsevolod.stakhov@parity.io> * orchestra everywhere * leaky data * Bump scale-info from 2.1.1 to 2.1.2 (#5552) Bumps [scale-info](https://github.com/paritytech/scale-info) from 2.1.1 to 2.1.2. - [Release notes](https://github.com/paritytech/scale-info/releases) - [Changelog](https://github.com/paritytech/scale-info/blob/master/CHANGELOG.md) - [Commits](https://github.com/paritytech/scale-info/compare/v2.1.1...v2.1.2) --- updated-dependencies: - dependency-name: scale-info dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Add missing markdown code block delimiter (#5555) * bitfield-signing: remove util::jobs usage (#5523) * Switch to pooling copy-on-write instantiation strategy for WASM (companion for Substrate#11232) (#5337) * Switch to pooling copy-on-write instantiation strategy for WASM * Fix compilation of `polkadot-test-service` * Update comments * Move `max_memory_size` to `Semantics` * Rename `WasmInstantiationStrategy` to `WasmtimeInstantiationStrategy` * Update a safety comment * update lockfile for {"substrate"} Co-authored-by: parity-processbot <> * Fix build Co-authored-by: Vsevolod Stakhov <vsevolod.stakhov@parity.io> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Malte Kliemann <mail@maltekliemann.com> Co-authored-by: Chris Sosnin <48099298+slumber@users.noreply.github.com> Co-authored-by: Koute <koute@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
d9eff4ecd4
commit
450ca2baca
@@ -37,7 +37,7 @@ use polkadot_node_subsystem::{
|
||||
ChainSelectionMessage, DisputeCoordinatorMessage, HighestApprovedAncestorBlock,
|
||||
RuntimeApiMessage, RuntimeApiRequest,
|
||||
},
|
||||
overseer, FromOverseer, OverseerSignal, SpawnedSubsystem, SubsystemError, SubsystemResult,
|
||||
overseer, FromOrchestra, OverseerSignal, SpawnedSubsystem, SubsystemError, SubsystemResult,
|
||||
SubsystemSender,
|
||||
};
|
||||
use polkadot_node_subsystem_util::{
|
||||
@@ -1093,12 +1093,12 @@ async fn handle_from_overseer<Context>(
|
||||
state: &mut State,
|
||||
db: &mut OverlayedBackend<'_, impl Backend>,
|
||||
metrics: &Metrics,
|
||||
x: FromOverseer<ApprovalVotingMessage>,
|
||||
x: FromOrchestra<ApprovalVotingMessage>,
|
||||
last_finalized_height: &mut Option<BlockNumber>,
|
||||
wakeups: &mut Wakeups,
|
||||
) -> SubsystemResult<Vec<Action>> {
|
||||
let actions = match x {
|
||||
FromOverseer::Signal(OverseerSignal::ActiveLeaves(update)) => {
|
||||
FromOrchestra::Signal(OverseerSignal::ActiveLeaves(update)) => {
|
||||
let mut actions = Vec::new();
|
||||
|
||||
for activated in update.activated {
|
||||
@@ -1152,7 +1152,7 @@ async fn handle_from_overseer<Context>(
|
||||
|
||||
actions
|
||||
},
|
||||
FromOverseer::Signal(OverseerSignal::BlockFinalized(block_hash, block_number)) => {
|
||||
FromOrchestra::Signal(OverseerSignal::BlockFinalized(block_hash, block_number)) => {
|
||||
gum::debug!(target: LOG_TARGET, ?block_hash, ?block_number, "Block finalized");
|
||||
*last_finalized_height = Some(block_number);
|
||||
|
||||
@@ -1163,10 +1163,10 @@ async fn handle_from_overseer<Context>(
|
||||
|
||||
Vec::new()
|
||||
},
|
||||
FromOverseer::Signal(OverseerSignal::Conclude) => {
|
||||
FromOrchestra::Signal(OverseerSignal::Conclude) => {
|
||||
vec![Action::Conclude]
|
||||
},
|
||||
FromOverseer::Communication { msg } => match msg {
|
||||
FromOrchestra::Communication { msg } => match msg {
|
||||
ApprovalVotingMessage::CheckAndImportAssignment(a, claimed_core, res) => {
|
||||
let (check_outcome, actions) =
|
||||
check_and_import_assignment(state, db, a, claimed_core)?;
|
||||
|
||||
@@ -514,7 +514,7 @@ fn test_harness<T: Future<Output = VirtualOverseer>>(
|
||||
.unwrap();
|
||||
}
|
||||
|
||||
async fn overseer_send(overseer: &mut VirtualOverseer, msg: FromOverseer<ApprovalVotingMessage>) {
|
||||
async fn overseer_send(overseer: &mut VirtualOverseer, msg: FromOrchestra<ApprovalVotingMessage>) {
|
||||
gum::trace!("Sending message:\n{:?}", &msg);
|
||||
overseer
|
||||
.send(msg)
|
||||
@@ -544,7 +544,7 @@ async fn overseer_recv_with_timeout(
|
||||
const TIMEOUT: Duration = Duration::from_millis(2000);
|
||||
async fn overseer_signal(overseer: &mut VirtualOverseer, signal: OverseerSignal) {
|
||||
overseer
|
||||
.send(FromOverseer::Signal(signal))
|
||||
.send(FromOrchestra::Signal(signal))
|
||||
.timeout(TIMEOUT)
|
||||
.await
|
||||
.expect(&format!("{:?} is more than enough for sending signals.", TIMEOUT));
|
||||
@@ -586,7 +586,7 @@ async fn check_and_import_approval(
|
||||
let (tx, rx) = oneshot::channel();
|
||||
overseer_send(
|
||||
overseer,
|
||||
FromOverseer::Communication {
|
||||
FromOrchestra::Communication {
|
||||
msg: ApprovalVotingMessage::CheckAndImportApproval(
|
||||
IndirectSignedApprovalVote { block_hash, candidate_index, validator, signature },
|
||||
tx,
|
||||
@@ -626,7 +626,7 @@ async fn check_and_import_assignment(
|
||||
let (tx, rx) = oneshot::channel();
|
||||
overseer_send(
|
||||
overseer,
|
||||
FromOverseer::Communication {
|
||||
FromOrchestra::Communication {
|
||||
msg: ApprovalVotingMessage::CheckAndImportAssignment(
|
||||
IndirectAssignmentCert {
|
||||
block_hash,
|
||||
@@ -785,7 +785,7 @@ async fn import_block(
|
||||
|
||||
overseer_send(
|
||||
overseer,
|
||||
FromOverseer::Signal(OverseerSignal::ActiveLeaves(ActiveLeavesUpdate::start_work(
|
||||
FromOrchestra::Signal(OverseerSignal::ActiveLeaves(ActiveLeavesUpdate::start_work(
|
||||
ActivatedLeaf {
|
||||
hash: *new_head,
|
||||
number,
|
||||
@@ -1078,7 +1078,7 @@ fn blank_subsystem_act_on_bad_block() {
|
||||
|
||||
overseer_send(
|
||||
&mut virtual_overseer,
|
||||
FromOverseer::Communication {
|
||||
FromOrchestra::Communication {
|
||||
msg: ApprovalVotingMessage::CheckAndImportAssignment(
|
||||
IndirectAssignmentCert {
|
||||
block_hash: bad_block_hash.clone(),
|
||||
@@ -1752,7 +1752,7 @@ fn linear_import_act_on_leaf() {
|
||||
|
||||
overseer_send(
|
||||
&mut virtual_overseer,
|
||||
FromOverseer::Communication {
|
||||
FromOrchestra::Communication {
|
||||
msg: ApprovalVotingMessage::CheckAndImportAssignment(
|
||||
IndirectAssignmentCert {
|
||||
block_hash: head,
|
||||
@@ -1822,7 +1822,7 @@ fn forkful_import_at_same_height_act_on_leaf() {
|
||||
|
||||
overseer_send(
|
||||
&mut virtual_overseer,
|
||||
FromOverseer::Communication {
|
||||
FromOrchestra::Communication {
|
||||
msg: ApprovalVotingMessage::CheckAndImportAssignment(
|
||||
IndirectAssignmentCert {
|
||||
block_hash: head,
|
||||
@@ -2219,7 +2219,7 @@ fn approved_ancestor_test(
|
||||
let (tx, rx) = oneshot::channel();
|
||||
overseer_send(
|
||||
&mut virtual_overseer,
|
||||
FromOverseer::Communication {
|
||||
FromOrchestra::Communication {
|
||||
msg: ApprovalVotingMessage::ApprovedAncestor(target, 0, tx),
|
||||
},
|
||||
)
|
||||
|
||||
@@ -36,7 +36,7 @@ use polkadot_node_primitives::{AvailableData, ErasureChunk};
|
||||
use polkadot_node_subsystem::{
|
||||
errors::{ChainApiError, RuntimeApiError},
|
||||
messages::{AvailabilityStoreMessage, ChainApiMessage},
|
||||
overseer, ActiveLeavesUpdate, FromOverseer, OverseerSignal, SpawnedSubsystem, SubsystemError,
|
||||
overseer, ActiveLeavesUpdate, FromOrchestra, OverseerSignal, SpawnedSubsystem, SubsystemError,
|
||||
};
|
||||
use polkadot_node_subsystem_util as util;
|
||||
use polkadot_primitives::v2::{
|
||||
@@ -558,8 +558,8 @@ async fn run_iteration<Context>(
|
||||
select! {
|
||||
incoming = ctx.recv().fuse() => {
|
||||
match incoming.map_err(|_| Error::ContextChannelClosed)? {
|
||||
FromOverseer::Signal(OverseerSignal::Conclude) => return Ok(true),
|
||||
FromOverseer::Signal(OverseerSignal::ActiveLeaves(
|
||||
FromOrchestra::Signal(OverseerSignal::Conclude) => return Ok(true),
|
||||
FromOrchestra::Signal(OverseerSignal::ActiveLeaves(
|
||||
ActiveLeavesUpdate { activated, .. })
|
||||
) => {
|
||||
for activated in activated.into_iter() {
|
||||
@@ -567,7 +567,7 @@ async fn run_iteration<Context>(
|
||||
process_block_activated(ctx, subsystem, activated.hash).await?;
|
||||
}
|
||||
}
|
||||
FromOverseer::Signal(OverseerSignal::BlockFinalized(hash, number)) => {
|
||||
FromOrchestra::Signal(OverseerSignal::BlockFinalized(hash, number)) => {
|
||||
let _timer = subsystem.metrics.time_process_block_finalized();
|
||||
|
||||
subsystem.finalized_number = Some(number);
|
||||
@@ -579,7 +579,7 @@ async fn run_iteration<Context>(
|
||||
number,
|
||||
).await?;
|
||||
}
|
||||
FromOverseer::Communication { msg } => {
|
||||
FromOrchestra::Communication { msg } => {
|
||||
let _timer = subsystem.metrics.time_process_message();
|
||||
process_message(subsystem, msg)?;
|
||||
}
|
||||
|
||||
@@ -146,7 +146,7 @@ const TIMEOUT: Duration = Duration::from_millis(100);
|
||||
async fn overseer_send(overseer: &mut VirtualOverseer, msg: AvailabilityStoreMessage) {
|
||||
gum::trace!(meg = ?msg, "sending message");
|
||||
overseer
|
||||
.send(FromOverseer::Communication { msg })
|
||||
.send(FromOrchestra::Communication { msg })
|
||||
.timeout(TIMEOUT)
|
||||
.await
|
||||
.expect(&format!("{:?} is more than enough for sending messages.", TIMEOUT));
|
||||
@@ -172,7 +172,7 @@ async fn overseer_recv_with_timeout(
|
||||
|
||||
async fn overseer_signal(overseer: &mut VirtualOverseer, signal: OverseerSignal) {
|
||||
overseer
|
||||
.send(FromOverseer::Signal(signal))
|
||||
.send(FromOrchestra::Signal(signal))
|
||||
.timeout(TIMEOUT)
|
||||
.await
|
||||
.expect(&format!("{:?} is more than enough for sending signals.", TIMEOUT));
|
||||
@@ -426,7 +426,7 @@ fn store_block_works() {
|
||||
tx,
|
||||
};
|
||||
|
||||
virtual_overseer.send(FromOverseer::Communication { msg: block_msg }).await;
|
||||
virtual_overseer.send(FromOrchestra::Communication { msg: block_msg }).await;
|
||||
assert_eq!(rx.await.unwrap(), Ok(()));
|
||||
|
||||
let pov = query_available_data(&mut virtual_overseer, candidate_hash).await.unwrap();
|
||||
@@ -479,7 +479,7 @@ fn store_pov_and_query_chunk_works() {
|
||||
tx,
|
||||
};
|
||||
|
||||
virtual_overseer.send(FromOverseer::Communication { msg: block_msg }).await;
|
||||
virtual_overseer.send(FromOrchestra::Communication { msg: block_msg }).await;
|
||||
|
||||
assert_eq!(rx.await.unwrap(), Ok(()));
|
||||
|
||||
@@ -525,7 +525,7 @@ fn query_all_chunks_works() {
|
||||
tx,
|
||||
};
|
||||
|
||||
virtual_overseer.send(FromOverseer::Communication { msg: block_msg }).await;
|
||||
virtual_overseer.send(FromOrchestra::Communication { msg: block_msg }).await;
|
||||
assert_eq!(rx.await.unwrap(), Ok(()));
|
||||
}
|
||||
|
||||
@@ -557,7 +557,7 @@ fn query_all_chunks_works() {
|
||||
};
|
||||
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication { msg: store_chunk_msg })
|
||||
.send(FromOrchestra::Communication { msg: store_chunk_msg })
|
||||
.await;
|
||||
assert_eq!(rx.await.unwrap(), Ok(()));
|
||||
}
|
||||
@@ -566,7 +566,7 @@ fn query_all_chunks_works() {
|
||||
let (tx, rx) = oneshot::channel();
|
||||
|
||||
let msg = AvailabilityStoreMessage::QueryAllChunks(candidate_hash_1, tx);
|
||||
virtual_overseer.send(FromOverseer::Communication { msg }).await;
|
||||
virtual_overseer.send(FromOrchestra::Communication { msg }).await;
|
||||
assert_eq!(rx.await.unwrap().len(), n_validators as usize);
|
||||
}
|
||||
|
||||
@@ -574,7 +574,7 @@ fn query_all_chunks_works() {
|
||||
let (tx, rx) = oneshot::channel();
|
||||
|
||||
let msg = AvailabilityStoreMessage::QueryAllChunks(candidate_hash_2, tx);
|
||||
virtual_overseer.send(FromOverseer::Communication { msg }).await;
|
||||
virtual_overseer.send(FromOrchestra::Communication { msg }).await;
|
||||
assert_eq!(rx.await.unwrap().len(), 1);
|
||||
}
|
||||
|
||||
@@ -582,7 +582,7 @@ fn query_all_chunks_works() {
|
||||
let (tx, rx) = oneshot::channel();
|
||||
|
||||
let msg = AvailabilityStoreMessage::QueryAllChunks(candidate_hash_3, tx);
|
||||
virtual_overseer.send(FromOverseer::Communication { msg }).await;
|
||||
virtual_overseer.send(FromOrchestra::Communication { msg }).await;
|
||||
assert_eq!(rx.await.unwrap().len(), 0);
|
||||
}
|
||||
virtual_overseer
|
||||
@@ -613,7 +613,7 @@ fn stored_but_not_included_data_is_pruned() {
|
||||
tx,
|
||||
};
|
||||
|
||||
virtual_overseer.send(FromOverseer::Communication { msg: block_msg }).await;
|
||||
virtual_overseer.send(FromOrchestra::Communication { msg: block_msg }).await;
|
||||
|
||||
rx.await.unwrap().unwrap();
|
||||
|
||||
@@ -665,7 +665,7 @@ fn stored_data_kept_until_finalized() {
|
||||
tx,
|
||||
};
|
||||
|
||||
virtual_overseer.send(FromOverseer::Communication { msg: block_msg }).await;
|
||||
virtual_overseer.send(FromOrchestra::Communication { msg: block_msg }).await;
|
||||
|
||||
rx.await.unwrap().unwrap();
|
||||
|
||||
@@ -900,7 +900,7 @@ fn forkfullness_works() {
|
||||
tx,
|
||||
};
|
||||
|
||||
virtual_overseer.send(FromOverseer::Communication { msg }).await;
|
||||
virtual_overseer.send(FromOrchestra::Communication { msg }).await;
|
||||
|
||||
rx.await.unwrap().unwrap();
|
||||
|
||||
@@ -912,7 +912,7 @@ fn forkfullness_works() {
|
||||
tx,
|
||||
};
|
||||
|
||||
virtual_overseer.send(FromOverseer::Communication { msg }).await;
|
||||
virtual_overseer.send(FromOrchestra::Communication { msg }).await;
|
||||
|
||||
rx.await.unwrap().unwrap();
|
||||
|
||||
@@ -1003,7 +1003,7 @@ async fn query_available_data(
|
||||
let (tx, rx) = oneshot::channel();
|
||||
|
||||
let query = AvailabilityStoreMessage::QueryAvailableData(candidate_hash, tx);
|
||||
virtual_overseer.send(FromOverseer::Communication { msg: query }).await;
|
||||
virtual_overseer.send(FromOrchestra::Communication { msg: query }).await;
|
||||
|
||||
rx.await.unwrap()
|
||||
}
|
||||
@@ -1016,7 +1016,7 @@ async fn query_chunk(
|
||||
let (tx, rx) = oneshot::channel();
|
||||
|
||||
let query = AvailabilityStoreMessage::QueryChunk(candidate_hash, index, tx);
|
||||
virtual_overseer.send(FromOverseer::Communication { msg: query }).await;
|
||||
virtual_overseer.send(FromOrchestra::Communication { msg: query }).await;
|
||||
|
||||
rx.await.unwrap()
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ use polkadot_node_subsystem::{
|
||||
CandidateValidationMessage, CollatorProtocolMessage, DisputeCoordinatorMessage,
|
||||
ProvisionableData, ProvisionerMessage, RuntimeApiRequest, StatementDistributionMessage,
|
||||
},
|
||||
overseer, ActiveLeavesUpdate, FromOverseer, OverseerSignal, PerLeafSpan, SpawnedSubsystem,
|
||||
overseer, ActiveLeavesUpdate, FromOrchestra, OverseerSignal, PerLeafSpan, SpawnedSubsystem,
|
||||
Stage, SubsystemError,
|
||||
};
|
||||
use polkadot_node_subsystem_util::{
|
||||
@@ -201,7 +201,7 @@ async fn run_iteration<Context>(
|
||||
}
|
||||
from_overseer = ctx.recv().fuse() => {
|
||||
match from_overseer? {
|
||||
FromOverseer::Signal(OverseerSignal::ActiveLeaves(update)) => handle_active_leaves_update(
|
||||
FromOrchestra::Signal(OverseerSignal::ActiveLeaves(update)) => handle_active_leaves_update(
|
||||
&mut *ctx,
|
||||
update,
|
||||
jobs,
|
||||
@@ -209,9 +209,9 @@ async fn run_iteration<Context>(
|
||||
&background_validation_tx,
|
||||
&metrics,
|
||||
).await?,
|
||||
FromOverseer::Signal(OverseerSignal::BlockFinalized(..)) => {}
|
||||
FromOverseer::Signal(OverseerSignal::Conclude) => return Ok(()),
|
||||
FromOverseer::Communication { msg } => handle_communication(&mut *ctx, jobs, msg).await?,
|
||||
FromOrchestra::Signal(OverseerSignal::BlockFinalized(..)) => {}
|
||||
FromOrchestra::Signal(OverseerSignal::Conclude) => return Ok(()),
|
||||
FromOrchestra::Communication { msg } => handle_communication(&mut *ctx, jobs, msg).await?,
|
||||
}
|
||||
}
|
||||
)
|
||||
|
||||
@@ -27,7 +27,7 @@ use polkadot_node_subsystem::{
|
||||
AllMessages, CollatorProtocolMessage, RuntimeApiMessage, RuntimeApiRequest,
|
||||
ValidationFailed,
|
||||
},
|
||||
ActivatedLeaf, ActiveLeavesUpdate, FromOverseer, LeafStatus, OverseerSignal,
|
||||
ActivatedLeaf, ActiveLeavesUpdate, FromOrchestra, LeafStatus, OverseerSignal,
|
||||
};
|
||||
use polkadot_node_subsystem_test_helpers as test_helpers;
|
||||
use polkadot_primitives::v2::{
|
||||
@@ -169,7 +169,7 @@ fn test_harness<T: Future<Output = VirtualOverseer>>(
|
||||
futures::executor::block_on(future::join(
|
||||
async move {
|
||||
let mut virtual_overseer = test_fut.await;
|
||||
virtual_overseer.send(FromOverseer::Signal(OverseerSignal::Conclude)).await;
|
||||
virtual_overseer.send(FromOrchestra::Signal(OverseerSignal::Conclude)).await;
|
||||
},
|
||||
subsystem,
|
||||
));
|
||||
@@ -222,7 +222,7 @@ impl TestCandidateBuilder {
|
||||
async fn test_startup(virtual_overseer: &mut VirtualOverseer, test_state: &TestState) {
|
||||
// Start work on some new parent.
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Signal(OverseerSignal::ActiveLeaves(ActiveLeavesUpdate::start_work(
|
||||
.send(FromOrchestra::Signal(OverseerSignal::ActiveLeaves(ActiveLeavesUpdate::start_work(
|
||||
ActivatedLeaf {
|
||||
hash: test_state.relay_parent,
|
||||
number: 1,
|
||||
@@ -330,7 +330,7 @@ fn backing_second_works() {
|
||||
pov.clone(),
|
||||
);
|
||||
|
||||
virtual_overseer.send(FromOverseer::Communication { msg: second }).await;
|
||||
virtual_overseer.send(FromOrchestra::Communication { msg: second }).await;
|
||||
|
||||
assert_matches!(
|
||||
virtual_overseer.recv().await,
|
||||
@@ -391,7 +391,7 @@ fn backing_second_works() {
|
||||
);
|
||||
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Signal(OverseerSignal::ActiveLeaves(
|
||||
.send(FromOrchestra::Signal(OverseerSignal::ActiveLeaves(
|
||||
ActiveLeavesUpdate::stop_work(test_state.relay_parent),
|
||||
)))
|
||||
.await;
|
||||
@@ -467,7 +467,7 @@ fn backing_works() {
|
||||
let statement =
|
||||
CandidateBackingMessage::Statement(test_state.relay_parent, signed_a.clone());
|
||||
|
||||
virtual_overseer.send(FromOverseer::Communication { msg: statement }).await;
|
||||
virtual_overseer.send(FromOrchestra::Communication { msg: statement }).await;
|
||||
|
||||
test_dispute_coordinator_notifications(
|
||||
&mut virtual_overseer,
|
||||
@@ -558,7 +558,7 @@ fn backing_works() {
|
||||
let statement =
|
||||
CandidateBackingMessage::Statement(test_state.relay_parent, signed_b.clone());
|
||||
|
||||
virtual_overseer.send(FromOverseer::Communication { msg: statement }).await;
|
||||
virtual_overseer.send(FromOrchestra::Communication { msg: statement }).await;
|
||||
|
||||
test_dispute_coordinator_notifications(
|
||||
&mut virtual_overseer,
|
||||
@@ -569,7 +569,7 @@ fn backing_works() {
|
||||
.await;
|
||||
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Signal(OverseerSignal::ActiveLeaves(
|
||||
.send(FromOrchestra::Signal(OverseerSignal::ActiveLeaves(
|
||||
ActiveLeavesUpdate::stop_work(test_state.relay_parent),
|
||||
)))
|
||||
.await;
|
||||
@@ -662,7 +662,7 @@ fn backing_works_while_validation_ongoing() {
|
||||
|
||||
let statement =
|
||||
CandidateBackingMessage::Statement(test_state.relay_parent, signed_a.clone());
|
||||
virtual_overseer.send(FromOverseer::Communication { msg: statement }).await;
|
||||
virtual_overseer.send(FromOrchestra::Communication { msg: statement }).await;
|
||||
|
||||
test_dispute_coordinator_notifications(
|
||||
&mut virtual_overseer,
|
||||
@@ -709,7 +709,7 @@ fn backing_works_while_validation_ongoing() {
|
||||
let statement =
|
||||
CandidateBackingMessage::Statement(test_state.relay_parent, signed_b.clone());
|
||||
|
||||
virtual_overseer.send(FromOverseer::Communication { msg: statement }).await;
|
||||
virtual_overseer.send(FromOrchestra::Communication { msg: statement }).await;
|
||||
|
||||
test_dispute_coordinator_notifications(
|
||||
&mut virtual_overseer,
|
||||
@@ -736,7 +736,7 @@ fn backing_works_while_validation_ongoing() {
|
||||
let statement =
|
||||
CandidateBackingMessage::Statement(test_state.relay_parent, signed_c.clone());
|
||||
|
||||
virtual_overseer.send(FromOverseer::Communication { msg: statement }).await;
|
||||
virtual_overseer.send(FromOrchestra::Communication { msg: statement }).await;
|
||||
|
||||
test_dispute_coordinator_notifications(
|
||||
&mut virtual_overseer,
|
||||
@@ -753,7 +753,7 @@ fn backing_works_while_validation_ongoing() {
|
||||
tx,
|
||||
);
|
||||
|
||||
virtual_overseer.send(FromOverseer::Communication { msg }).await;
|
||||
virtual_overseer.send(FromOrchestra::Communication { msg }).await;
|
||||
|
||||
let candidates = rx.await.unwrap();
|
||||
assert_eq!(1, candidates.len());
|
||||
@@ -774,7 +774,7 @@ fn backing_works_while_validation_ongoing() {
|
||||
);
|
||||
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Signal(OverseerSignal::ActiveLeaves(
|
||||
.send(FromOrchestra::Signal(OverseerSignal::ActiveLeaves(
|
||||
ActiveLeavesUpdate::stop_work(test_state.relay_parent),
|
||||
)))
|
||||
.await;
|
||||
@@ -843,7 +843,7 @@ fn backing_misbehavior_works() {
|
||||
let statement =
|
||||
CandidateBackingMessage::Statement(test_state.relay_parent, seconded_2.clone());
|
||||
|
||||
virtual_overseer.send(FromOverseer::Communication { msg: statement }).await;
|
||||
virtual_overseer.send(FromOrchestra::Communication { msg: statement }).await;
|
||||
|
||||
test_dispute_coordinator_notifications(
|
||||
&mut virtual_overseer,
|
||||
@@ -935,7 +935,7 @@ fn backing_misbehavior_works() {
|
||||
let statement =
|
||||
CandidateBackingMessage::Statement(test_state.relay_parent, valid_2.clone());
|
||||
|
||||
virtual_overseer.send(FromOverseer::Communication { msg: statement }).await;
|
||||
virtual_overseer.send(FromOrchestra::Communication { msg: statement }).await;
|
||||
|
||||
test_dispute_coordinator_notifications(
|
||||
&mut virtual_overseer,
|
||||
@@ -1024,7 +1024,7 @@ fn backing_dont_second_invalid() {
|
||||
pov_block_a.clone(),
|
||||
);
|
||||
|
||||
virtual_overseer.send(FromOverseer::Communication { msg: second }).await;
|
||||
virtual_overseer.send(FromOrchestra::Communication { msg: second }).await;
|
||||
|
||||
assert_matches!(
|
||||
virtual_overseer.recv().await,
|
||||
@@ -1053,7 +1053,7 @@ fn backing_dont_second_invalid() {
|
||||
pov_block_b.clone(),
|
||||
);
|
||||
|
||||
virtual_overseer.send(FromOverseer::Communication { msg: second }).await;
|
||||
virtual_overseer.send(FromOrchestra::Communication { msg: second }).await;
|
||||
|
||||
assert_matches!(
|
||||
virtual_overseer.recv().await,
|
||||
@@ -1108,7 +1108,7 @@ fn backing_dont_second_invalid() {
|
||||
);
|
||||
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Signal(OverseerSignal::ActiveLeaves(
|
||||
.send(FromOrchestra::Signal(OverseerSignal::ActiveLeaves(
|
||||
ActiveLeavesUpdate::stop_work(test_state.relay_parent),
|
||||
)))
|
||||
.await;
|
||||
@@ -1161,7 +1161,7 @@ fn backing_second_after_first_fails_works() {
|
||||
let statement =
|
||||
CandidateBackingMessage::Statement(test_state.relay_parent, signed_a.clone());
|
||||
|
||||
virtual_overseer.send(FromOverseer::Communication { msg: statement }).await;
|
||||
virtual_overseer.send(FromOrchestra::Communication { msg: statement }).await;
|
||||
|
||||
test_dispute_coordinator_notifications(
|
||||
&mut virtual_overseer,
|
||||
@@ -1208,7 +1208,7 @@ fn backing_second_after_first_fails_works() {
|
||||
pov.clone(),
|
||||
);
|
||||
|
||||
virtual_overseer.send(FromOverseer::Communication { msg: second }).await;
|
||||
virtual_overseer.send(FromOrchestra::Communication { msg: second }).await;
|
||||
|
||||
let pov_to_second = PoV { block_data: BlockData(vec![3, 2, 1]) };
|
||||
|
||||
@@ -1232,7 +1232,7 @@ fn backing_second_after_first_fails_works() {
|
||||
// In order to trigger _some_ actions from subsystem ask it to second another
|
||||
// candidate. The only reason to do so is to make sure that no actions were
|
||||
// triggered on the prev step.
|
||||
virtual_overseer.send(FromOverseer::Communication { msg: second }).await;
|
||||
virtual_overseer.send(FromOrchestra::Communication { msg: second }).await;
|
||||
|
||||
assert_matches!(
|
||||
virtual_overseer.recv().await,
|
||||
@@ -1295,7 +1295,7 @@ fn backing_works_after_failed_validation() {
|
||||
let statement =
|
||||
CandidateBackingMessage::Statement(test_state.relay_parent, signed_a.clone());
|
||||
|
||||
virtual_overseer.send(FromOverseer::Communication { msg: statement }).await;
|
||||
virtual_overseer.send(FromOrchestra::Communication { msg: statement }).await;
|
||||
|
||||
test_dispute_coordinator_notifications(
|
||||
&mut virtual_overseer,
|
||||
@@ -1343,7 +1343,7 @@ fn backing_works_after_failed_validation() {
|
||||
tx,
|
||||
);
|
||||
|
||||
virtual_overseer.send(FromOverseer::Communication { msg }).await;
|
||||
virtual_overseer.send(FromOrchestra::Communication { msg }).await;
|
||||
assert_eq!(rx.await.unwrap().len(), 0);
|
||||
virtual_overseer
|
||||
});
|
||||
@@ -1383,7 +1383,7 @@ fn backing_doesnt_second_wrong_collator() {
|
||||
pov.clone(),
|
||||
);
|
||||
|
||||
virtual_overseer.send(FromOverseer::Communication { msg: second }).await;
|
||||
virtual_overseer.send(FromOrchestra::Communication { msg: second }).await;
|
||||
|
||||
assert_matches!(
|
||||
virtual_overseer.recv().await,
|
||||
@@ -1394,7 +1394,7 @@ fn backing_doesnt_second_wrong_collator() {
|
||||
);
|
||||
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Signal(OverseerSignal::ActiveLeaves(
|
||||
.send(FromOrchestra::Signal(OverseerSignal::ActiveLeaves(
|
||||
ActiveLeavesUpdate::stop_work(test_state.relay_parent),
|
||||
)))
|
||||
.await;
|
||||
@@ -1451,11 +1451,11 @@ fn validation_work_ignores_wrong_collator() {
|
||||
let statement =
|
||||
CandidateBackingMessage::Statement(test_state.relay_parent, seconding.clone());
|
||||
|
||||
virtual_overseer.send(FromOverseer::Communication { msg: statement }).await;
|
||||
virtual_overseer.send(FromOrchestra::Communication { msg: statement }).await;
|
||||
|
||||
// The statement will be ignored because it has the wrong collator.
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Signal(OverseerSignal::ActiveLeaves(
|
||||
.send(FromOrchestra::Signal(OverseerSignal::ActiveLeaves(
|
||||
ActiveLeavesUpdate::stop_work(test_state.relay_parent),
|
||||
)))
|
||||
.await;
|
||||
@@ -1613,7 +1613,7 @@ fn retry_works() {
|
||||
// Send in a `Statement` with a candidate.
|
||||
let statement =
|
||||
CandidateBackingMessage::Statement(test_state.relay_parent, signed_a.clone());
|
||||
virtual_overseer.send(FromOverseer::Communication { msg: statement }).await;
|
||||
virtual_overseer.send(FromOrchestra::Communication { msg: statement }).await;
|
||||
|
||||
test_dispute_coordinator_notifications(
|
||||
&mut virtual_overseer,
|
||||
@@ -1640,7 +1640,7 @@ fn retry_works() {
|
||||
|
||||
let statement =
|
||||
CandidateBackingMessage::Statement(test_state.relay_parent, signed_b.clone());
|
||||
virtual_overseer.send(FromOverseer::Communication { msg: statement }).await;
|
||||
virtual_overseer.send(FromOrchestra::Communication { msg: statement }).await;
|
||||
|
||||
test_dispute_coordinator_notifications(
|
||||
&mut virtual_overseer,
|
||||
@@ -1672,7 +1672,7 @@ fn retry_works() {
|
||||
|
||||
let statement =
|
||||
CandidateBackingMessage::Statement(test_state.relay_parent, signed_c.clone());
|
||||
virtual_overseer.send(FromOverseer::Communication { msg: statement }).await;
|
||||
virtual_overseer.send(FromOrchestra::Communication { msg: statement }).await;
|
||||
|
||||
test_dispute_coordinator_notifications(
|
||||
&mut virtual_overseer,
|
||||
@@ -1799,12 +1799,12 @@ fn observes_backing_even_if_not_validator() {
|
||||
let statement =
|
||||
CandidateBackingMessage::Statement(test_state.relay_parent, signed_a.clone());
|
||||
|
||||
virtual_overseer.send(FromOverseer::Communication { msg: statement }).await;
|
||||
virtual_overseer.send(FromOrchestra::Communication { msg: statement }).await;
|
||||
|
||||
let statement =
|
||||
CandidateBackingMessage::Statement(test_state.relay_parent, signed_b.clone());
|
||||
|
||||
virtual_overseer.send(FromOverseer::Communication { msg: statement }).await;
|
||||
virtual_overseer.send(FromOrchestra::Communication { msg: statement }).await;
|
||||
|
||||
test_dispute_coordinator_notifications(
|
||||
&mut virtual_overseer,
|
||||
@@ -1829,7 +1829,7 @@ fn observes_backing_even_if_not_validator() {
|
||||
let statement =
|
||||
CandidateBackingMessage::Statement(test_state.relay_parent, signed_c.clone());
|
||||
|
||||
virtual_overseer.send(FromOverseer::Communication { msg: statement }).await;
|
||||
virtual_overseer.send(FromOrchestra::Communication { msg: statement }).await;
|
||||
|
||||
test_dispute_coordinator_notifications(
|
||||
&mut virtual_overseer,
|
||||
@@ -1840,7 +1840,7 @@ fn observes_backing_even_if_not_validator() {
|
||||
.await;
|
||||
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Signal(OverseerSignal::ActiveLeaves(
|
||||
.send(FromOrchestra::Signal(OverseerSignal::ActiveLeaves(
|
||||
ActiveLeavesUpdate::stop_work(test_state.relay_parent),
|
||||
)))
|
||||
.await;
|
||||
|
||||
@@ -32,7 +32,7 @@ use polkadot_node_subsystem::{
|
||||
messages::{
|
||||
AvailabilityStoreMessage, BitfieldDistributionMessage, RuntimeApiMessage, RuntimeApiRequest,
|
||||
},
|
||||
overseer, ActivatedLeaf, FromOverseer, LeafStatus, OverseerSignal, PerLeafSpan,
|
||||
overseer, ActivatedLeaf, FromOrchestra, LeafStatus, OverseerSignal, PerLeafSpan,
|
||||
SpawnedSubsystem, SubsystemError, SubsystemResult, SubsystemSender,
|
||||
};
|
||||
use polkadot_node_subsystem_util::{self as util, Validator};
|
||||
@@ -217,7 +217,7 @@ async fn run<Context>(
|
||||
|
||||
loop {
|
||||
match ctx.recv().await? {
|
||||
FromOverseer::Signal(OverseerSignal::ActiveLeaves(update)) => {
|
||||
FromOrchestra::Signal(OverseerSignal::ActiveLeaves(update)) => {
|
||||
// Abort jobs for deactivated leaves.
|
||||
for leaf in &update.deactivated {
|
||||
if let Some(handle) = running.remove(leaf) {
|
||||
@@ -241,9 +241,9 @@ async fn run<Context>(
|
||||
ctx.spawn("bitfield-signing-job", fut.map(drop).boxed())?;
|
||||
}
|
||||
},
|
||||
FromOverseer::Signal(OverseerSignal::BlockFinalized(..)) => {},
|
||||
FromOverseer::Signal(OverseerSignal::Conclude) => return Ok(()),
|
||||
FromOverseer::Communication { .. } => {},
|
||||
FromOrchestra::Signal(OverseerSignal::BlockFinalized(..)) => {},
|
||||
FromOrchestra::Signal(OverseerSignal::Conclude) => return Ok(()),
|
||||
FromOrchestra::Communication { .. } => {},
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ use polkadot_node_subsystem::{
|
||||
CandidateValidationMessage, PreCheckOutcome, RuntimeApiMessage, RuntimeApiRequest,
|
||||
ValidationFailed,
|
||||
},
|
||||
overseer, FromOverseer, OverseerSignal, SpawnedSubsystem, SubsystemError, SubsystemResult,
|
||||
overseer, FromOrchestra, OverseerSignal, SpawnedSubsystem, SubsystemError, SubsystemResult,
|
||||
SubsystemSender,
|
||||
};
|
||||
use polkadot_parachain::primitives::{ValidationParams, ValidationResult as WasmValidationResult};
|
||||
@@ -125,10 +125,10 @@ async fn run<Context>(
|
||||
|
||||
loop {
|
||||
match ctx.recv().await? {
|
||||
FromOverseer::Signal(OverseerSignal::ActiveLeaves(_)) => {},
|
||||
FromOverseer::Signal(OverseerSignal::BlockFinalized(..)) => {},
|
||||
FromOverseer::Signal(OverseerSignal::Conclude) => return Ok(()),
|
||||
FromOverseer::Communication { msg } => match msg {
|
||||
FromOrchestra::Signal(OverseerSignal::ActiveLeaves(_)) => {},
|
||||
FromOrchestra::Signal(OverseerSignal::BlockFinalized(..)) => {},
|
||||
FromOrchestra::Signal(OverseerSignal::Conclude) => return Ok(()),
|
||||
FromOrchestra::Communication { msg } => match msg {
|
||||
CandidateValidationMessage::ValidateFromChainState(
|
||||
candidate_receipt,
|
||||
pov,
|
||||
|
||||
@@ -38,7 +38,7 @@ use sc_client_api::AuxStore;
|
||||
use sp_blockchain::HeaderBackend;
|
||||
|
||||
use polkadot_node_subsystem::{
|
||||
messages::ChainApiMessage, overseer, FromOverseer, OverseerSignal, SpawnedSubsystem,
|
||||
messages::ChainApiMessage, overseer, FromOrchestra, OverseerSignal, SpawnedSubsystem,
|
||||
SubsystemError, SubsystemResult,
|
||||
};
|
||||
use polkadot_primitives::v2::{Block, BlockId};
|
||||
@@ -87,10 +87,10 @@ where
|
||||
{
|
||||
loop {
|
||||
match ctx.recv().await? {
|
||||
FromOverseer::Signal(OverseerSignal::Conclude) => return Ok(()),
|
||||
FromOverseer::Signal(OverseerSignal::ActiveLeaves(_)) => {},
|
||||
FromOverseer::Signal(OverseerSignal::BlockFinalized(..)) => {},
|
||||
FromOverseer::Communication { msg } => match msg {
|
||||
FromOrchestra::Signal(OverseerSignal::Conclude) => return Ok(()),
|
||||
FromOrchestra::Signal(OverseerSignal::ActiveLeaves(_)) => {},
|
||||
FromOrchestra::Signal(OverseerSignal::BlockFinalized(..)) => {},
|
||||
FromOrchestra::Communication { msg } => match msg {
|
||||
ChainApiMessage::BlockNumber(hash, response_channel) => {
|
||||
let _timer = subsystem.metrics.time_block_number();
|
||||
let result = subsystem.client.number(hash).map_err(|e| e.to_string().into());
|
||||
|
||||
@@ -184,7 +184,7 @@ fn request_block_number() {
|
||||
let (tx, rx) = oneshot::channel();
|
||||
|
||||
sender
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: ChainApiMessage::BlockNumber(*hash, tx),
|
||||
})
|
||||
.await;
|
||||
@@ -192,7 +192,7 @@ fn request_block_number() {
|
||||
assert_eq!(rx.await.unwrap().unwrap(), *expected);
|
||||
}
|
||||
|
||||
sender.send(FromOverseer::Signal(OverseerSignal::Conclude)).await;
|
||||
sender.send(FromOrchestra::Signal(OverseerSignal::Conclude)).await;
|
||||
}
|
||||
.boxed()
|
||||
})
|
||||
@@ -211,7 +211,7 @@ fn request_block_header() {
|
||||
let (tx, rx) = oneshot::channel();
|
||||
|
||||
sender
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: ChainApiMessage::BlockHeader(*hash, tx),
|
||||
})
|
||||
.await;
|
||||
@@ -219,7 +219,7 @@ fn request_block_header() {
|
||||
assert_eq!(rx.await.unwrap().unwrap(), *expected);
|
||||
}
|
||||
|
||||
sender.send(FromOverseer::Signal(OverseerSignal::Conclude)).await;
|
||||
sender.send(FromOrchestra::Signal(OverseerSignal::Conclude)).await;
|
||||
}
|
||||
.boxed()
|
||||
})
|
||||
@@ -239,7 +239,7 @@ fn request_block_weight() {
|
||||
let (tx, rx) = oneshot::channel();
|
||||
|
||||
sender
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: ChainApiMessage::BlockWeight(*hash, tx),
|
||||
})
|
||||
.await;
|
||||
@@ -247,7 +247,7 @@ fn request_block_weight() {
|
||||
assert_eq!(rx.await.unwrap().unwrap(), *expected);
|
||||
}
|
||||
|
||||
sender.send(FromOverseer::Signal(OverseerSignal::Conclude)).await;
|
||||
sender.send(FromOrchestra::Signal(OverseerSignal::Conclude)).await;
|
||||
}
|
||||
.boxed()
|
||||
})
|
||||
@@ -265,7 +265,7 @@ fn request_finalized_hash() {
|
||||
let (tx, rx) = oneshot::channel();
|
||||
|
||||
sender
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: ChainApiMessage::FinalizedBlockHash(*number, tx),
|
||||
})
|
||||
.await;
|
||||
@@ -273,7 +273,7 @@ fn request_finalized_hash() {
|
||||
assert_eq!(rx.await.unwrap().unwrap(), *expected);
|
||||
}
|
||||
|
||||
sender.send(FromOverseer::Signal(OverseerSignal::Conclude)).await;
|
||||
sender.send(FromOrchestra::Signal(OverseerSignal::Conclude)).await;
|
||||
}
|
||||
.boxed()
|
||||
})
|
||||
@@ -287,14 +287,14 @@ fn request_last_finalized_number() {
|
||||
|
||||
let expected = client.info().finalized_number;
|
||||
sender
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: ChainApiMessage::FinalizedBlockNumber(tx),
|
||||
})
|
||||
.await;
|
||||
|
||||
assert_eq!(rx.await.unwrap().unwrap(), expected);
|
||||
|
||||
sender.send(FromOverseer::Signal(OverseerSignal::Conclude)).await;
|
||||
sender.send(FromOrchestra::Signal(OverseerSignal::Conclude)).await;
|
||||
}
|
||||
.boxed()
|
||||
})
|
||||
@@ -306,7 +306,7 @@ fn request_ancestors() {
|
||||
async move {
|
||||
let (tx, rx) = oneshot::channel();
|
||||
sender
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: ChainApiMessage::Ancestors { hash: THREE, k: 4, response_channel: tx },
|
||||
})
|
||||
.await;
|
||||
@@ -315,7 +315,7 @@ fn request_ancestors() {
|
||||
// Limit the number of ancestors.
|
||||
let (tx, rx) = oneshot::channel();
|
||||
sender
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: ChainApiMessage::Ancestors { hash: TWO, k: 1, response_channel: tx },
|
||||
})
|
||||
.await;
|
||||
@@ -324,7 +324,7 @@ fn request_ancestors() {
|
||||
// Ancestor of block #1 is returned.
|
||||
let (tx, rx) = oneshot::channel();
|
||||
sender
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: ChainApiMessage::Ancestors { hash: ONE, k: 10, response_channel: tx },
|
||||
})
|
||||
.await;
|
||||
@@ -333,7 +333,7 @@ fn request_ancestors() {
|
||||
// No ancestors of genesis block.
|
||||
let (tx, rx) = oneshot::channel();
|
||||
sender
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: ChainApiMessage::Ancestors { hash: GENESIS, k: 10, response_channel: tx },
|
||||
})
|
||||
.await;
|
||||
@@ -341,7 +341,7 @@ fn request_ancestors() {
|
||||
|
||||
let (tx, rx) = oneshot::channel();
|
||||
sender
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: ChainApiMessage::Ancestors {
|
||||
hash: ERROR_PATH,
|
||||
k: 2,
|
||||
@@ -351,7 +351,7 @@ fn request_ancestors() {
|
||||
.await;
|
||||
assert!(rx.await.unwrap().is_err());
|
||||
|
||||
sender.send(FromOverseer::Signal(OverseerSignal::Conclude)).await;
|
||||
sender.send(FromOrchestra::Signal(OverseerSignal::Conclude)).await;
|
||||
}
|
||||
.boxed()
|
||||
})
|
||||
|
||||
@@ -21,7 +21,7 @@ use polkadot_node_subsystem::{
|
||||
errors::ChainApiError,
|
||||
messages::{ChainApiMessage, ChainSelectionMessage},
|
||||
overseer::{self, SubsystemSender},
|
||||
FromOverseer, OverseerSignal, SpawnedSubsystem, SubsystemError,
|
||||
FromOrchestra, OverseerSignal, SpawnedSubsystem, SubsystemError,
|
||||
};
|
||||
use polkadot_node_subsystem_util::database::Database;
|
||||
use polkadot_primitives::v2::{BlockNumber, ConsensusLog, Hash, Header};
|
||||
@@ -392,10 +392,10 @@ where
|
||||
msg = ctx.recv().fuse() => {
|
||||
let msg = msg?;
|
||||
match msg {
|
||||
FromOverseer::Signal(OverseerSignal::Conclude) => {
|
||||
FromOrchestra::Signal(OverseerSignal::Conclude) => {
|
||||
return Ok(())
|
||||
}
|
||||
FromOverseer::Signal(OverseerSignal::ActiveLeaves(update)) => {
|
||||
FromOrchestra::Signal(OverseerSignal::ActiveLeaves(update)) => {
|
||||
for leaf in update.activated {
|
||||
let write_ops = handle_active_leaf(
|
||||
ctx.sender(),
|
||||
@@ -407,10 +407,10 @@ where
|
||||
backend.write(write_ops)?;
|
||||
}
|
||||
}
|
||||
FromOverseer::Signal(OverseerSignal::BlockFinalized(h, n)) => {
|
||||
FromOrchestra::Signal(OverseerSignal::BlockFinalized(h, n)) => {
|
||||
handle_finalized_block(backend, h, n)?
|
||||
}
|
||||
FromOverseer::Communication { msg } => match msg {
|
||||
FromOrchestra::Communication { msg } => match msg {
|
||||
ChainSelectionMessage::Approved(hash) => {
|
||||
handle_approved_block(backend, hash)?
|
||||
}
|
||||
|
||||
@@ -585,7 +585,7 @@ async fn assert_leaves_query(virtual_overseer: &mut VirtualOverseer, leaves: Vec
|
||||
|
||||
let (tx, rx) = oneshot::channel();
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication { msg: ChainSelectionMessage::Leaves(tx) })
|
||||
.send(FromOrchestra::Communication { msg: ChainSelectionMessage::Leaves(tx) })
|
||||
.await;
|
||||
|
||||
assert_eq!(rx.await.unwrap(), leaves);
|
||||
@@ -598,7 +598,7 @@ async fn assert_finalized_leaves_query(
|
||||
) {
|
||||
let (tx, rx) = oneshot::channel();
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication { msg: ChainSelectionMessage::Leaves(tx) })
|
||||
.send(FromOrchestra::Communication { msg: ChainSelectionMessage::Leaves(tx) })
|
||||
.await;
|
||||
|
||||
answer_finalized_block_info(virtual_overseer, finalized_number, finalized_hash).await;
|
||||
@@ -612,7 +612,7 @@ async fn best_leaf_containing(
|
||||
) -> Option<Hash> {
|
||||
let (tx, rx) = oneshot::channel();
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: ChainSelectionMessage::BestLeafContaining(required, tx),
|
||||
})
|
||||
.await;
|
||||
@@ -627,7 +627,7 @@ async fn approve_block(
|
||||
) {
|
||||
let (_, write_rx) = backend.await_next_write();
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication { msg: ChainSelectionMessage::Approved(approved) })
|
||||
.send(FromOrchestra::Communication { msg: ChainSelectionMessage::Approved(approved) })
|
||||
.await;
|
||||
|
||||
write_rx.await.unwrap()
|
||||
@@ -1709,7 +1709,9 @@ fn approve_nonexistent_has_no_effect() {
|
||||
|
||||
let nonexistent = Hash::repeat_byte(1);
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication { msg: ChainSelectionMessage::Approved(nonexistent) })
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: ChainSelectionMessage::Approved(nonexistent),
|
||||
})
|
||||
.await;
|
||||
|
||||
// None are approved.
|
||||
|
||||
@@ -34,7 +34,7 @@ use polkadot_node_subsystem::{
|
||||
BlockDescription, DisputeCoordinatorMessage, DisputeDistributionMessage,
|
||||
ImportStatementsResult,
|
||||
},
|
||||
overseer, ActivatedLeaf, ActiveLeavesUpdate, FromOverseer, OverseerSignal,
|
||||
overseer, ActivatedLeaf, ActiveLeavesUpdate, FromOrchestra, OverseerSignal,
|
||||
};
|
||||
use polkadot_node_subsystem_util::rolling_session_window::{
|
||||
RollingSessionWindow, SessionWindowUpdate, SessionsUnavailable,
|
||||
@@ -220,8 +220,8 @@ impl Initialized {
|
||||
default_confirm
|
||||
},
|
||||
MuxedMessage::Subsystem(msg) => match msg {
|
||||
FromOverseer::Signal(OverseerSignal::Conclude) => return Ok(()),
|
||||
FromOverseer::Signal(OverseerSignal::ActiveLeaves(update)) => {
|
||||
FromOrchestra::Signal(OverseerSignal::Conclude) => return Ok(()),
|
||||
FromOrchestra::Signal(OverseerSignal::ActiveLeaves(update)) => {
|
||||
self.process_active_leaves_update(
|
||||
ctx,
|
||||
&mut overlay_db,
|
||||
@@ -231,11 +231,11 @@ impl Initialized {
|
||||
.await?;
|
||||
default_confirm
|
||||
},
|
||||
FromOverseer::Signal(OverseerSignal::BlockFinalized(_, n)) => {
|
||||
FromOrchestra::Signal(OverseerSignal::BlockFinalized(_, n)) => {
|
||||
self.scraper.process_finalized_block(&n);
|
||||
default_confirm
|
||||
},
|
||||
FromOverseer::Communication { msg } =>
|
||||
FromOrchestra::Communication { msg } =>
|
||||
self.handle_incoming(ctx, &mut overlay_db, msg, clock.now()).await?,
|
||||
},
|
||||
};
|
||||
@@ -1044,7 +1044,7 @@ impl Initialized {
|
||||
/// Messages to be handled in this subsystem.
|
||||
enum MuxedMessage {
|
||||
/// Messages from other subsystems.
|
||||
Subsystem(FromOverseer<DisputeCoordinatorMessage>),
|
||||
Subsystem(FromOrchestra<DisputeCoordinatorMessage>),
|
||||
/// Messages from participation workers.
|
||||
Participation(participation::WorkerMessage),
|
||||
}
|
||||
|
||||
@@ -32,7 +32,7 @@ use sc_keystore::LocalKeystore;
|
||||
|
||||
use polkadot_node_primitives::{CandidateVotes, DISPUTE_WINDOW};
|
||||
use polkadot_node_subsystem::{
|
||||
overseer, ActivatedLeaf, FromOverseer, OverseerSignal, SpawnedSubsystem, SubsystemError,
|
||||
overseer, ActivatedLeaf, FromOrchestra, OverseerSignal, SpawnedSubsystem, SubsystemError,
|
||||
};
|
||||
use polkadot_node_subsystem_util::{
|
||||
database::Database, rolling_session_window::RollingSessionWindow,
|
||||
@@ -369,14 +369,14 @@ async fn get_rolling_session_window<Context>(
|
||||
async fn wait_for_first_leaf<Context>(ctx: &mut Context) -> Result<Option<ActivatedLeaf>> {
|
||||
loop {
|
||||
match ctx.recv().await? {
|
||||
FromOverseer::Signal(OverseerSignal::Conclude) => return Ok(None),
|
||||
FromOverseer::Signal(OverseerSignal::ActiveLeaves(update)) => {
|
||||
FromOrchestra::Signal(OverseerSignal::Conclude) => return Ok(None),
|
||||
FromOrchestra::Signal(OverseerSignal::ActiveLeaves(update)) => {
|
||||
if let Some(activated) = update.activated {
|
||||
return Ok(Some(activated))
|
||||
}
|
||||
},
|
||||
FromOverseer::Signal(OverseerSignal::BlockFinalized(_, _)) => {},
|
||||
FromOverseer::Communication { msg } =>
|
||||
FromOrchestra::Signal(OverseerSignal::BlockFinalized(_, _)) => {},
|
||||
FromOrchestra::Communication { msg } =>
|
||||
// NOTE: We could technically actually handle a couple of message types, even if
|
||||
// not initialized (e.g. all requests that only query the database). The problem
|
||||
// is, we would deliver potentially outdated information, especially in the event
|
||||
|
||||
@@ -33,7 +33,7 @@ use polkadot_node_subsystem::{
|
||||
AllMessages, DisputeCoordinatorMessage, RuntimeApiMessage, RuntimeApiRequest,
|
||||
ValidationFailed,
|
||||
},
|
||||
ActivatedLeaf, ActiveLeavesUpdate, LeafStatus,
|
||||
ActivatedLeaf, ActiveLeavesUpdate, LeafStatus, SpawnGlue,
|
||||
};
|
||||
use polkadot_node_subsystem_test_helpers::{
|
||||
make_subsystem_context, TestSubsystemContext, TestSubsystemContextHandle,
|
||||
@@ -45,12 +45,12 @@ use polkadot_primitives::v2::{
|
||||
type VirtualOverseer = TestSubsystemContextHandle<DisputeCoordinatorMessage>;
|
||||
|
||||
pub fn make_our_subsystem_context<S>(
|
||||
spawn: S,
|
||||
spawner: S,
|
||||
) -> (
|
||||
TestSubsystemContext<DisputeCoordinatorMessage, S>,
|
||||
TestSubsystemContext<DisputeCoordinatorMessage, SpawnGlue<S>>,
|
||||
TestSubsystemContextHandle<DisputeCoordinatorMessage>,
|
||||
) {
|
||||
make_subsystem_context(spawn)
|
||||
make_subsystem_context(spawner)
|
||||
}
|
||||
|
||||
#[overseer::contextbounds(DisputeCoordinator, prefix = self::overseer)]
|
||||
|
||||
@@ -29,7 +29,7 @@ use polkadot_node_subsystem::{
|
||||
AllMessages, ChainApiMessage, DisputeCoordinatorMessage, RuntimeApiMessage,
|
||||
RuntimeApiRequest,
|
||||
},
|
||||
ActivatedLeaf, ActiveLeavesUpdate, LeafStatus,
|
||||
ActivatedLeaf, ActiveLeavesUpdate, LeafStatus, SpawnGlue,
|
||||
};
|
||||
use polkadot_node_subsystem_test_helpers::{
|
||||
make_subsystem_context, TestSubsystemContext, TestSubsystemContextHandle, TestSubsystemSender,
|
||||
@@ -59,7 +59,7 @@ async fn overseer_recv(virtual_overseer: &mut VirtualOverseer) -> AllMessages {
|
||||
struct TestState {
|
||||
chain: Vec<Hash>,
|
||||
scraper: ChainScraper,
|
||||
ctx: TestSubsystemContext<DisputeCoordinatorMessage, TaskExecutor>,
|
||||
ctx: TestSubsystemContext<DisputeCoordinatorMessage, SpawnGlue<TaskExecutor>>,
|
||||
}
|
||||
|
||||
impl TestState {
|
||||
|
||||
@@ -37,7 +37,7 @@ use polkadot_node_subsystem::{
|
||||
ChainApiMessage, DisputeCoordinatorMessage, DisputeDistributionMessage,
|
||||
ImportStatementsResult,
|
||||
},
|
||||
overseer::FromOverseer,
|
||||
overseer::FromOrchestra,
|
||||
OverseerSignal,
|
||||
};
|
||||
use polkadot_node_subsystem_util::TimeoutExt;
|
||||
@@ -225,7 +225,7 @@ impl TestState {
|
||||
|
||||
gum::debug!(?block_number, "Activating block in activate_leaf_at_session.");
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Signal(OverseerSignal::ActiveLeaves(
|
||||
.send(FromOrchestra::Signal(OverseerSignal::ActiveLeaves(
|
||||
ActiveLeavesUpdate::start_work(ActivatedLeaf {
|
||||
hash: block_hash,
|
||||
span: Arc::new(jaeger::Span::Disabled),
|
||||
@@ -347,7 +347,7 @@ impl TestState {
|
||||
"Activating block in handle resume sync."
|
||||
);
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Signal(OverseerSignal::ActiveLeaves(
|
||||
.send(FromOrchestra::Signal(OverseerSignal::ActiveLeaves(
|
||||
ActiveLeavesUpdate::start_work(ActivatedLeaf {
|
||||
hash: *leaf,
|
||||
number: n as u32,
|
||||
@@ -511,7 +511,7 @@ fn too_many_unconfirmed_statements_are_considered_spam() {
|
||||
.await;
|
||||
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::ImportStatements {
|
||||
candidate_hash: candidate_hash1,
|
||||
candidate_receipt: candidate_receipt1.clone(),
|
||||
@@ -531,7 +531,7 @@ fn too_many_unconfirmed_statements_are_considered_spam() {
|
||||
{
|
||||
let (tx, rx) = oneshot::channel();
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::ActiveDisputes(tx),
|
||||
})
|
||||
.await;
|
||||
@@ -540,7 +540,7 @@ fn too_many_unconfirmed_statements_are_considered_spam() {
|
||||
|
||||
let (tx, rx) = oneshot::channel();
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::QueryCandidateVotes(
|
||||
vec![(session, candidate_hash1)],
|
||||
tx,
|
||||
@@ -555,7 +555,7 @@ fn too_many_unconfirmed_statements_are_considered_spam() {
|
||||
|
||||
let (pending_confirmation, confirmation_rx) = oneshot::channel();
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::ImportStatements {
|
||||
candidate_hash: candidate_hash2,
|
||||
candidate_receipt: candidate_receipt2.clone(),
|
||||
@@ -572,7 +572,7 @@ fn too_many_unconfirmed_statements_are_considered_spam() {
|
||||
{
|
||||
let (tx, rx) = oneshot::channel();
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::QueryCandidateVotes(
|
||||
vec![(session, candidate_hash2)],
|
||||
tx,
|
||||
@@ -586,7 +586,7 @@ fn too_many_unconfirmed_statements_are_considered_spam() {
|
||||
// Result should be invalid, because it should be considered spam.
|
||||
assert_matches!(confirmation_rx.await, Ok(ImportStatementsResult::InvalidImport));
|
||||
|
||||
virtual_overseer.send(FromOverseer::Signal(OverseerSignal::Conclude)).await;
|
||||
virtual_overseer.send(FromOrchestra::Signal(OverseerSignal::Conclude)).await;
|
||||
|
||||
// No more messages expected:
|
||||
assert!(virtual_overseer.try_recv().await.is_none());
|
||||
@@ -628,7 +628,7 @@ fn dispute_gets_confirmed_via_participation() {
|
||||
.await;
|
||||
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::ImportStatements {
|
||||
candidate_hash: candidate_hash1,
|
||||
candidate_receipt: candidate_receipt1.clone(),
|
||||
@@ -652,7 +652,7 @@ fn dispute_gets_confirmed_via_participation() {
|
||||
{
|
||||
let (tx, rx) = oneshot::channel();
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::ActiveDisputes(tx),
|
||||
})
|
||||
.await;
|
||||
@@ -661,7 +661,7 @@ fn dispute_gets_confirmed_via_participation() {
|
||||
|
||||
let (tx, rx) = oneshot::channel();
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::QueryCandidateVotes(
|
||||
vec![(session, candidate_hash1)],
|
||||
tx,
|
||||
@@ -676,7 +676,7 @@ fn dispute_gets_confirmed_via_participation() {
|
||||
|
||||
let (pending_confirmation, confirmation_rx) = oneshot::channel();
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::ImportStatements {
|
||||
candidate_hash: candidate_hash2,
|
||||
candidate_receipt: candidate_receipt2.clone(),
|
||||
@@ -695,7 +695,7 @@ fn dispute_gets_confirmed_via_participation() {
|
||||
{
|
||||
let (tx, rx) = oneshot::channel();
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::QueryCandidateVotes(
|
||||
vec![(session, candidate_hash2)],
|
||||
tx,
|
||||
@@ -711,7 +711,7 @@ fn dispute_gets_confirmed_via_participation() {
|
||||
// Result should be valid, because our node participated, so spam slots are cleared:
|
||||
assert_matches!(confirmation_rx.await, Ok(ImportStatementsResult::ValidImport));
|
||||
|
||||
virtual_overseer.send(FromOverseer::Signal(OverseerSignal::Conclude)).await;
|
||||
virtual_overseer.send(FromOrchestra::Signal(OverseerSignal::Conclude)).await;
|
||||
|
||||
// No more messages expected:
|
||||
assert!(virtual_overseer.try_recv().await.is_none());
|
||||
@@ -761,7 +761,7 @@ fn dispute_gets_confirmed_at_byzantine_threshold() {
|
||||
.await;
|
||||
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::ImportStatements {
|
||||
candidate_hash: candidate_hash1,
|
||||
candidate_receipt: candidate_receipt1.clone(),
|
||||
@@ -782,7 +782,7 @@ fn dispute_gets_confirmed_at_byzantine_threshold() {
|
||||
{
|
||||
let (tx, rx) = oneshot::channel();
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::ActiveDisputes(tx),
|
||||
})
|
||||
.await;
|
||||
@@ -791,7 +791,7 @@ fn dispute_gets_confirmed_at_byzantine_threshold() {
|
||||
|
||||
let (tx, rx) = oneshot::channel();
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::QueryCandidateVotes(
|
||||
vec![(session, candidate_hash1)],
|
||||
tx,
|
||||
@@ -806,7 +806,7 @@ fn dispute_gets_confirmed_at_byzantine_threshold() {
|
||||
|
||||
let (pending_confirmation, confirmation_rx) = oneshot::channel();
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::ImportStatements {
|
||||
candidate_hash: candidate_hash2,
|
||||
candidate_receipt: candidate_receipt2.clone(),
|
||||
@@ -825,7 +825,7 @@ fn dispute_gets_confirmed_at_byzantine_threshold() {
|
||||
{
|
||||
let (tx, rx) = oneshot::channel();
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::QueryCandidateVotes(
|
||||
vec![(session, candidate_hash2)],
|
||||
tx,
|
||||
@@ -842,7 +842,7 @@ fn dispute_gets_confirmed_at_byzantine_threshold() {
|
||||
// import, so spam slots are cleared:
|
||||
assert_matches!(confirmation_rx.await, Ok(ImportStatementsResult::ValidImport));
|
||||
|
||||
virtual_overseer.send(FromOverseer::Signal(OverseerSignal::Conclude)).await;
|
||||
virtual_overseer.send(FromOrchestra::Signal(OverseerSignal::Conclude)).await;
|
||||
|
||||
// No more messages expected:
|
||||
assert!(virtual_overseer.try_recv().await.is_none());
|
||||
@@ -873,7 +873,7 @@ fn backing_statements_import_works_and_no_spam() {
|
||||
|
||||
let (pending_confirmation, confirmation_rx) = oneshot::channel();
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::ImportStatements {
|
||||
candidate_hash,
|
||||
candidate_receipt: candidate_receipt.clone(),
|
||||
@@ -892,7 +892,7 @@ fn backing_statements_import_works_and_no_spam() {
|
||||
// Just backing votes - we should not have any active disputes now.
|
||||
let (tx, rx) = oneshot::channel();
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::ActiveDisputes(tx),
|
||||
})
|
||||
.await;
|
||||
@@ -901,7 +901,7 @@ fn backing_statements_import_works_and_no_spam() {
|
||||
|
||||
let (tx, rx) = oneshot::channel();
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::QueryCandidateVotes(
|
||||
vec![(session, candidate_hash)],
|
||||
tx,
|
||||
@@ -927,7 +927,7 @@ fn backing_statements_import_works_and_no_spam() {
|
||||
// Backing vote import should not have accounted to spam slots, so this should succeed
|
||||
// as well:
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::ImportStatements {
|
||||
candidate_hash,
|
||||
candidate_receipt: candidate_receipt.clone(),
|
||||
@@ -944,7 +944,7 @@ fn backing_statements_import_works_and_no_spam() {
|
||||
// Result should be valid, because our node participated, so spam slots are cleared:
|
||||
assert_matches!(confirmation_rx.await, Ok(ImportStatementsResult::ValidImport));
|
||||
|
||||
virtual_overseer.send(FromOverseer::Signal(OverseerSignal::Conclude)).await;
|
||||
virtual_overseer.send(FromOrchestra::Signal(OverseerSignal::Conclude)).await;
|
||||
|
||||
// No more messages expected:
|
||||
assert!(virtual_overseer.try_recv().await.is_none());
|
||||
@@ -980,7 +980,7 @@ fn conflicting_votes_lead_to_dispute_participation() {
|
||||
.await;
|
||||
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::ImportStatements {
|
||||
candidate_hash,
|
||||
candidate_receipt: candidate_receipt.clone(),
|
||||
@@ -1004,7 +1004,7 @@ fn conflicting_votes_lead_to_dispute_participation() {
|
||||
{
|
||||
let (tx, rx) = oneshot::channel();
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::ActiveDisputes(tx),
|
||||
})
|
||||
.await;
|
||||
@@ -1013,7 +1013,7 @@ fn conflicting_votes_lead_to_dispute_participation() {
|
||||
|
||||
let (tx, rx) = oneshot::channel();
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::QueryCandidateVotes(
|
||||
vec![(session, candidate_hash)],
|
||||
tx,
|
||||
@@ -1027,7 +1027,7 @@ fn conflicting_votes_lead_to_dispute_participation() {
|
||||
}
|
||||
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::ImportStatements {
|
||||
candidate_hash,
|
||||
candidate_receipt: candidate_receipt.clone(),
|
||||
@@ -1041,7 +1041,7 @@ fn conflicting_votes_lead_to_dispute_participation() {
|
||||
{
|
||||
let (tx, rx) = oneshot::channel();
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::QueryCandidateVotes(
|
||||
vec![(session, candidate_hash)],
|
||||
tx,
|
||||
@@ -1054,7 +1054,7 @@ fn conflicting_votes_lead_to_dispute_participation() {
|
||||
assert_eq!(votes.invalid.len(), 2);
|
||||
}
|
||||
|
||||
virtual_overseer.send(FromOverseer::Signal(OverseerSignal::Conclude)).await;
|
||||
virtual_overseer.send(FromOrchestra::Signal(OverseerSignal::Conclude)).await;
|
||||
|
||||
// This confirms that the second vote doesn't lead to participation again.
|
||||
assert!(virtual_overseer.try_recv().await.is_none());
|
||||
@@ -1086,7 +1086,7 @@ fn positive_votes_dont_trigger_participation() {
|
||||
.await;
|
||||
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::ImportStatements {
|
||||
candidate_hash,
|
||||
candidate_receipt: candidate_receipt.clone(),
|
||||
@@ -1100,7 +1100,7 @@ fn positive_votes_dont_trigger_participation() {
|
||||
{
|
||||
let (tx, rx) = oneshot::channel();
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::ActiveDisputes(tx),
|
||||
})
|
||||
.await;
|
||||
@@ -1109,7 +1109,7 @@ fn positive_votes_dont_trigger_participation() {
|
||||
|
||||
let (tx, rx) = oneshot::channel();
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::QueryCandidateVotes(
|
||||
vec![(session, candidate_hash)],
|
||||
tx,
|
||||
@@ -1123,7 +1123,7 @@ fn positive_votes_dont_trigger_participation() {
|
||||
}
|
||||
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::ImportStatements {
|
||||
candidate_hash,
|
||||
candidate_receipt: candidate_receipt.clone(),
|
||||
@@ -1137,7 +1137,7 @@ fn positive_votes_dont_trigger_participation() {
|
||||
{
|
||||
let (tx, rx) = oneshot::channel();
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::ActiveDisputes(tx),
|
||||
})
|
||||
.await;
|
||||
@@ -1146,7 +1146,7 @@ fn positive_votes_dont_trigger_participation() {
|
||||
|
||||
let (tx, rx) = oneshot::channel();
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::QueryCandidateVotes(
|
||||
vec![(session, candidate_hash)],
|
||||
tx,
|
||||
@@ -1159,7 +1159,7 @@ fn positive_votes_dont_trigger_participation() {
|
||||
assert!(votes.invalid.is_empty());
|
||||
}
|
||||
|
||||
virtual_overseer.send(FromOverseer::Signal(OverseerSignal::Conclude)).await;
|
||||
virtual_overseer.send(FromOrchestra::Signal(OverseerSignal::Conclude)).await;
|
||||
|
||||
// This confirms that no participation request is made.
|
||||
assert!(virtual_overseer.try_recv().await.is_none());
|
||||
@@ -1191,7 +1191,7 @@ fn wrong_validator_index_is_ignored() {
|
||||
.await;
|
||||
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::ImportStatements {
|
||||
candidate_hash,
|
||||
candidate_receipt: candidate_receipt.clone(),
|
||||
@@ -1208,7 +1208,7 @@ fn wrong_validator_index_is_ignored() {
|
||||
{
|
||||
let (tx, rx) = oneshot::channel();
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::ActiveDisputes(tx),
|
||||
})
|
||||
.await;
|
||||
@@ -1217,7 +1217,7 @@ fn wrong_validator_index_is_ignored() {
|
||||
|
||||
let (tx, rx) = oneshot::channel();
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::QueryCandidateVotes(
|
||||
vec![(session, candidate_hash)],
|
||||
tx,
|
||||
@@ -1230,7 +1230,7 @@ fn wrong_validator_index_is_ignored() {
|
||||
assert!(votes.invalid.is_empty());
|
||||
}
|
||||
|
||||
virtual_overseer.send(FromOverseer::Signal(OverseerSignal::Conclude)).await;
|
||||
virtual_overseer.send(FromOrchestra::Signal(OverseerSignal::Conclude)).await;
|
||||
|
||||
// This confirms that no participation request is made.
|
||||
assert!(virtual_overseer.try_recv().await.is_none());
|
||||
@@ -1262,7 +1262,7 @@ fn finality_votes_ignore_disputed_candidates() {
|
||||
.await;
|
||||
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::ImportStatements {
|
||||
candidate_hash,
|
||||
candidate_receipt: candidate_receipt.clone(),
|
||||
@@ -1291,7 +1291,7 @@ fn finality_votes_ignore_disputed_candidates() {
|
||||
let block_hash_b = Hash::repeat_byte(0x0b);
|
||||
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::DetermineUndisputedChain {
|
||||
base: (10, base_block),
|
||||
block_descriptions: vec![BlockDescription {
|
||||
@@ -1308,7 +1308,7 @@ fn finality_votes_ignore_disputed_candidates() {
|
||||
|
||||
let (tx, rx) = oneshot::channel();
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::DetermineUndisputedChain {
|
||||
base: (10, base_block),
|
||||
block_descriptions: vec![
|
||||
@@ -1331,7 +1331,7 @@ fn finality_votes_ignore_disputed_candidates() {
|
||||
assert_eq!(rx.await.unwrap(), (11, block_hash_a));
|
||||
}
|
||||
|
||||
virtual_overseer.send(FromOverseer::Signal(OverseerSignal::Conclude)).await;
|
||||
virtual_overseer.send(FromOrchestra::Signal(OverseerSignal::Conclude)).await;
|
||||
assert!(virtual_overseer.try_recv().await.is_none());
|
||||
|
||||
test_state
|
||||
@@ -1364,7 +1364,7 @@ fn supermajority_valid_dispute_may_be_finalized() {
|
||||
.await;
|
||||
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::ImportStatements {
|
||||
candidate_hash,
|
||||
candidate_receipt: candidate_receipt.clone(),
|
||||
@@ -1395,7 +1395,7 @@ fn supermajority_valid_dispute_may_be_finalized() {
|
||||
}
|
||||
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::ImportStatements {
|
||||
candidate_hash,
|
||||
candidate_receipt: candidate_receipt.clone(),
|
||||
@@ -1414,7 +1414,7 @@ fn supermajority_valid_dispute_may_be_finalized() {
|
||||
let block_hash_b = Hash::repeat_byte(0x0b);
|
||||
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::DetermineUndisputedChain {
|
||||
base: (10, base_hash),
|
||||
block_descriptions: vec![BlockDescription {
|
||||
@@ -1431,7 +1431,7 @@ fn supermajority_valid_dispute_may_be_finalized() {
|
||||
|
||||
let (tx, rx) = oneshot::channel();
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::DetermineUndisputedChain {
|
||||
base: (10, base_hash),
|
||||
block_descriptions: vec![
|
||||
@@ -1454,7 +1454,7 @@ fn supermajority_valid_dispute_may_be_finalized() {
|
||||
assert_eq!(rx.await.unwrap(), (12, block_hash_b));
|
||||
}
|
||||
|
||||
virtual_overseer.send(FromOverseer::Signal(OverseerSignal::Conclude)).await;
|
||||
virtual_overseer.send(FromOrchestra::Signal(OverseerSignal::Conclude)).await;
|
||||
assert!(virtual_overseer.try_recv().await.is_none());
|
||||
|
||||
test_state
|
||||
@@ -1487,7 +1487,7 @@ fn concluded_supermajority_for_non_active_after_time() {
|
||||
.await;
|
||||
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::ImportStatements {
|
||||
candidate_hash,
|
||||
candidate_receipt: candidate_receipt.clone(),
|
||||
@@ -1519,7 +1519,7 @@ fn concluded_supermajority_for_non_active_after_time() {
|
||||
}
|
||||
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::ImportStatements {
|
||||
candidate_hash,
|
||||
candidate_receipt: candidate_receipt.clone(),
|
||||
@@ -1536,7 +1536,7 @@ fn concluded_supermajority_for_non_active_after_time() {
|
||||
let (tx, rx) = oneshot::channel();
|
||||
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::ActiveDisputes(tx),
|
||||
})
|
||||
.await;
|
||||
@@ -1546,7 +1546,7 @@ fn concluded_supermajority_for_non_active_after_time() {
|
||||
let (tx, rx) = oneshot::channel();
|
||||
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::RecentDisputes(tx),
|
||||
})
|
||||
.await;
|
||||
@@ -1554,7 +1554,7 @@ fn concluded_supermajority_for_non_active_after_time() {
|
||||
assert_eq!(rx.await.unwrap().len(), 1);
|
||||
}
|
||||
|
||||
virtual_overseer.send(FromOverseer::Signal(OverseerSignal::Conclude)).await;
|
||||
virtual_overseer.send(FromOrchestra::Signal(OverseerSignal::Conclude)).await;
|
||||
assert!(virtual_overseer.try_recv().await.is_none());
|
||||
|
||||
test_state
|
||||
@@ -1589,7 +1589,7 @@ fn concluded_supermajority_against_non_active_after_time() {
|
||||
|
||||
let (pending_confirmation, confirmation_rx) = oneshot::channel();
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::ImportStatements {
|
||||
candidate_hash,
|
||||
candidate_receipt: candidate_receipt.clone(),
|
||||
@@ -1625,7 +1625,7 @@ fn concluded_supermajority_against_non_active_after_time() {
|
||||
}
|
||||
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::ImportStatements {
|
||||
candidate_hash,
|
||||
candidate_receipt: candidate_receipt.clone(),
|
||||
@@ -1642,7 +1642,7 @@ fn concluded_supermajority_against_non_active_after_time() {
|
||||
let (tx, rx) = oneshot::channel();
|
||||
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::ActiveDisputes(tx),
|
||||
})
|
||||
.await;
|
||||
@@ -1651,7 +1651,7 @@ fn concluded_supermajority_against_non_active_after_time() {
|
||||
let (tx, rx) = oneshot::channel();
|
||||
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::RecentDisputes(tx),
|
||||
})
|
||||
.await;
|
||||
@@ -1659,7 +1659,7 @@ fn concluded_supermajority_against_non_active_after_time() {
|
||||
assert_eq!(rx.await.unwrap().len(), 1);
|
||||
}
|
||||
|
||||
virtual_overseer.send(FromOverseer::Signal(OverseerSignal::Conclude)).await;
|
||||
virtual_overseer.send(FromOrchestra::Signal(OverseerSignal::Conclude)).await;
|
||||
assert_matches!(
|
||||
virtual_overseer.try_recv().await,
|
||||
None => {}
|
||||
@@ -1693,7 +1693,7 @@ fn resume_dispute_without_local_statement() {
|
||||
|
||||
let (pending_confirmation, confirmation_rx) = oneshot::channel();
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::ImportStatements {
|
||||
candidate_hash,
|
||||
candidate_receipt: candidate_receipt.clone(),
|
||||
@@ -1716,7 +1716,7 @@ fn resume_dispute_without_local_statement() {
|
||||
let (tx, rx) = oneshot::channel();
|
||||
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::ActiveDisputes(tx),
|
||||
})
|
||||
.await;
|
||||
@@ -1724,7 +1724,7 @@ fn resume_dispute_without_local_statement() {
|
||||
assert_eq!(rx.await.unwrap().len(), 1);
|
||||
}
|
||||
|
||||
virtual_overseer.send(FromOverseer::Signal(OverseerSignal::Conclude)).await;
|
||||
virtual_overseer.send(FromOrchestra::Signal(OverseerSignal::Conclude)).await;
|
||||
assert!(virtual_overseer.try_recv().await.is_none());
|
||||
|
||||
test_state
|
||||
@@ -1766,7 +1766,7 @@ fn resume_dispute_without_local_statement() {
|
||||
.await;
|
||||
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::ImportStatements {
|
||||
candidate_hash,
|
||||
candidate_receipt: candidate_receipt.clone(),
|
||||
@@ -1792,7 +1792,7 @@ fn resume_dispute_without_local_statement() {
|
||||
let (tx, rx) = oneshot::channel();
|
||||
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::ActiveDisputes(tx),
|
||||
})
|
||||
.await;
|
||||
@@ -1800,7 +1800,7 @@ fn resume_dispute_without_local_statement() {
|
||||
assert!(rx.await.unwrap().is_empty());
|
||||
}
|
||||
|
||||
virtual_overseer.send(FromOverseer::Signal(OverseerSignal::Conclude)).await;
|
||||
virtual_overseer.send(FromOrchestra::Signal(OverseerSignal::Conclude)).await;
|
||||
assert!(virtual_overseer.try_recv().await.is_none());
|
||||
|
||||
test_state
|
||||
@@ -1835,7 +1835,7 @@ fn resume_dispute_with_local_statement() {
|
||||
|
||||
let (pending_confirmation, confirmation_rx) = oneshot::channel();
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::ImportStatements {
|
||||
candidate_hash,
|
||||
candidate_receipt: candidate_receipt.clone(),
|
||||
@@ -1856,7 +1856,7 @@ fn resume_dispute_with_local_statement() {
|
||||
let (tx, rx) = oneshot::channel();
|
||||
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::ActiveDisputes(tx),
|
||||
})
|
||||
.await;
|
||||
@@ -1864,7 +1864,7 @@ fn resume_dispute_with_local_statement() {
|
||||
assert_eq!(rx.await.unwrap().len(), 1);
|
||||
}
|
||||
|
||||
virtual_overseer.send(FromOverseer::Signal(OverseerSignal::Conclude)).await;
|
||||
virtual_overseer.send(FromOrchestra::Signal(OverseerSignal::Conclude)).await;
|
||||
assert!(virtual_overseer.try_recv().await.is_none());
|
||||
|
||||
test_state
|
||||
@@ -1879,7 +1879,7 @@ fn resume_dispute_with_local_statement() {
|
||||
// Assert that subsystem is not sending Participation messages because we issued a local statement
|
||||
assert!(virtual_overseer.recv().timeout(TEST_TIMEOUT).await.is_none());
|
||||
|
||||
virtual_overseer.send(FromOverseer::Signal(OverseerSignal::Conclude)).await;
|
||||
virtual_overseer.send(FromOrchestra::Signal(OverseerSignal::Conclude)).await;
|
||||
assert!(virtual_overseer.try_recv().await.is_none());
|
||||
|
||||
test_state
|
||||
@@ -1913,7 +1913,7 @@ fn resume_dispute_without_local_statement_or_local_key() {
|
||||
|
||||
let (pending_confirmation, confirmation_rx) = oneshot::channel();
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::ImportStatements {
|
||||
candidate_hash,
|
||||
candidate_receipt: candidate_receipt.clone(),
|
||||
@@ -1933,7 +1933,7 @@ fn resume_dispute_without_local_statement_or_local_key() {
|
||||
let (tx, rx) = oneshot::channel();
|
||||
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::ActiveDisputes(tx),
|
||||
})
|
||||
.await;
|
||||
@@ -1941,7 +1941,7 @@ fn resume_dispute_without_local_statement_or_local_key() {
|
||||
assert_eq!(rx.await.unwrap().len(), 1);
|
||||
}
|
||||
|
||||
virtual_overseer.send(FromOverseer::Signal(OverseerSignal::Conclude)).await;
|
||||
virtual_overseer.send(FromOrchestra::Signal(OverseerSignal::Conclude)).await;
|
||||
assert_matches!(
|
||||
virtual_overseer.try_recv().await,
|
||||
None => {}
|
||||
@@ -1959,7 +1959,7 @@ fn resume_dispute_without_local_statement_or_local_key() {
|
||||
// Assert that subsystem is not sending Participation messages because we issued a local statement
|
||||
assert!(virtual_overseer.recv().timeout(TEST_TIMEOUT).await.is_none());
|
||||
|
||||
virtual_overseer.send(FromOverseer::Signal(OverseerSignal::Conclude)).await;
|
||||
virtual_overseer.send(FromOrchestra::Signal(OverseerSignal::Conclude)).await;
|
||||
assert!(virtual_overseer.try_recv().await.is_none());
|
||||
|
||||
test_state
|
||||
@@ -1995,7 +1995,7 @@ fn resume_dispute_with_local_statement_without_local_key() {
|
||||
|
||||
let (pending_confirmation, confirmation_rx) = oneshot::channel();
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::ImportStatements {
|
||||
candidate_hash,
|
||||
candidate_receipt: candidate_receipt.clone(),
|
||||
@@ -2016,7 +2016,7 @@ fn resume_dispute_with_local_statement_without_local_key() {
|
||||
let (tx, rx) = oneshot::channel();
|
||||
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::ActiveDisputes(tx),
|
||||
})
|
||||
.await;
|
||||
@@ -2024,7 +2024,7 @@ fn resume_dispute_with_local_statement_without_local_key() {
|
||||
assert_eq!(rx.await.unwrap().len(), 1);
|
||||
}
|
||||
|
||||
virtual_overseer.send(FromOverseer::Signal(OverseerSignal::Conclude)).await;
|
||||
virtual_overseer.send(FromOrchestra::Signal(OverseerSignal::Conclude)).await;
|
||||
assert!(virtual_overseer.try_recv().await.is_none());
|
||||
|
||||
test_state
|
||||
@@ -2043,7 +2043,7 @@ fn resume_dispute_with_local_statement_without_local_key() {
|
||||
// have a key.
|
||||
assert!(virtual_overseer.recv().timeout(TEST_TIMEOUT).await.is_none());
|
||||
|
||||
virtual_overseer.send(FromOverseer::Signal(OverseerSignal::Conclude)).await;
|
||||
virtual_overseer.send(FromOrchestra::Signal(OverseerSignal::Conclude)).await;
|
||||
assert!(virtual_overseer.try_recv().await.is_none());
|
||||
|
||||
test_state
|
||||
@@ -2079,7 +2079,7 @@ fn issue_local_statement_does_cause_distribution_but_not_duplicate_participation
|
||||
|
||||
let (pending_confirmation, confirmation_rx) = oneshot::channel();
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::ImportStatements {
|
||||
candidate_hash,
|
||||
candidate_receipt: candidate_receipt.clone(),
|
||||
@@ -2094,7 +2094,7 @@ fn issue_local_statement_does_cause_distribution_but_not_duplicate_participation
|
||||
|
||||
// Initiate dispute locally:
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::IssueLocalStatement(
|
||||
session,
|
||||
candidate_hash,
|
||||
@@ -2118,7 +2118,7 @@ fn issue_local_statement_does_cause_distribution_but_not_duplicate_participation
|
||||
// Make sure we won't participate:
|
||||
assert!(virtual_overseer.recv().timeout(TEST_TIMEOUT).await.is_none());
|
||||
|
||||
virtual_overseer.send(FromOverseer::Signal(OverseerSignal::Conclude)).await;
|
||||
virtual_overseer.send(FromOrchestra::Signal(OverseerSignal::Conclude)).await;
|
||||
assert!(virtual_overseer.try_recv().await.is_none());
|
||||
|
||||
test_state
|
||||
@@ -2140,7 +2140,7 @@ fn negative_issue_local_statement_only_triggers_import() {
|
||||
test_state.activate_leaf_at_session(&mut virtual_overseer, session, 1).await;
|
||||
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::IssueLocalStatement(
|
||||
session,
|
||||
candidate_hash,
|
||||
@@ -2162,7 +2162,7 @@ fn negative_issue_local_statement_only_triggers_import() {
|
||||
// Assert that subsystem is not participating.
|
||||
assert!(virtual_overseer.recv().timeout(TEST_TIMEOUT).await.is_none());
|
||||
|
||||
virtual_overseer.send(FromOverseer::Signal(OverseerSignal::Conclude)).await;
|
||||
virtual_overseer.send(FromOrchestra::Signal(OverseerSignal::Conclude)).await;
|
||||
assert!(virtual_overseer.try_recv().await.is_none());
|
||||
|
||||
test_state
|
||||
@@ -2185,7 +2185,7 @@ fn empty_import_still_writes_candidate_receipt() {
|
||||
|
||||
let (tx, rx) = oneshot::channel();
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::ImportStatements {
|
||||
candidate_hash,
|
||||
candidate_receipt: candidate_receipt.clone(),
|
||||
@@ -2205,7 +2205,7 @@ fn empty_import_still_writes_candidate_receipt() {
|
||||
assert_eq!(votes.valid.len(), 0);
|
||||
assert_eq!(votes.candidate_receipt, candidate_receipt);
|
||||
|
||||
virtual_overseer.send(FromOverseer::Signal(OverseerSignal::Conclude)).await;
|
||||
virtual_overseer.send(FromOrchestra::Signal(OverseerSignal::Conclude)).await;
|
||||
assert!(virtual_overseer.try_recv().await.is_none());
|
||||
|
||||
test_state
|
||||
@@ -2236,7 +2236,7 @@ fn redundant_votes_ignored() {
|
||||
|
||||
let (tx, rx) = oneshot::channel();
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::ImportStatements {
|
||||
candidate_hash,
|
||||
candidate_receipt: candidate_receipt.clone(),
|
||||
@@ -2251,7 +2251,7 @@ fn redundant_votes_ignored() {
|
||||
|
||||
let (tx, rx) = oneshot::channel();
|
||||
virtual_overseer
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: DisputeCoordinatorMessage::ImportStatements {
|
||||
candidate_hash,
|
||||
candidate_receipt: candidate_receipt.clone(),
|
||||
@@ -2271,7 +2271,7 @@ fn redundant_votes_ignored() {
|
||||
assert_eq!(votes.valid.len(), 1);
|
||||
assert_eq!(&votes.valid[0].2, valid_vote.validator_signature());
|
||||
|
||||
virtual_overseer.send(FromOverseer::Signal(OverseerSignal::Conclude)).await;
|
||||
virtual_overseer.send(FromOrchestra::Signal(OverseerSignal::Conclude)).await;
|
||||
assert!(virtual_overseer.try_recv().await.is_none());
|
||||
|
||||
test_state
|
||||
|
||||
@@ -23,7 +23,7 @@ use futures::{channel::oneshot, future::BoxFuture, prelude::*, stream::FuturesUn
|
||||
|
||||
use polkadot_node_subsystem::{
|
||||
messages::{CandidateValidationMessage, PreCheckOutcome, PvfCheckerMessage, RuntimeApiMessage},
|
||||
overseer, ActiveLeavesUpdate, FromOverseer, OverseerSignal, SpawnedSubsystem, SubsystemError,
|
||||
overseer, ActiveLeavesUpdate, FromOrchestra, OverseerSignal, SpawnedSubsystem, SubsystemError,
|
||||
SubsystemResult, SubsystemSender,
|
||||
};
|
||||
use polkadot_primitives::v2::{
|
||||
@@ -244,22 +244,22 @@ async fn handle_from_overseer(
|
||||
sender: &mut impl overseer::PvfCheckerSenderTrait,
|
||||
keystore: &SyncCryptoStorePtr,
|
||||
metrics: &Metrics,
|
||||
from_overseer: FromOverseer<PvfCheckerMessage>,
|
||||
from_overseer: FromOrchestra<PvfCheckerMessage>,
|
||||
) -> Option<Conclude> {
|
||||
match from_overseer {
|
||||
FromOverseer::Signal(OverseerSignal::Conclude) => {
|
||||
FromOrchestra::Signal(OverseerSignal::Conclude) => {
|
||||
gum::info!(target: LOG_TARGET, "Received `Conclude` signal, exiting");
|
||||
Some(Conclude)
|
||||
},
|
||||
FromOverseer::Signal(OverseerSignal::BlockFinalized(_, _)) => {
|
||||
FromOrchestra::Signal(OverseerSignal::BlockFinalized(_, _)) => {
|
||||
// ignore
|
||||
None
|
||||
},
|
||||
FromOverseer::Signal(OverseerSignal::ActiveLeaves(update)) => {
|
||||
FromOrchestra::Signal(OverseerSignal::ActiveLeaves(update)) => {
|
||||
handle_leaves_update(state, sender, keystore, metrics, update).await;
|
||||
None
|
||||
},
|
||||
FromOverseer::Communication { msg } => match msg {
|
||||
FromOrchestra::Communication { msg } => match msg {
|
||||
// uninhabited type, thus statically unreachable.
|
||||
},
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ use polkadot_node_subsystem::{
|
||||
AllMessages, CandidateValidationMessage, PreCheckOutcome, PvfCheckerMessage,
|
||||
RuntimeApiMessage, RuntimeApiRequest,
|
||||
},
|
||||
ActivatedLeaf, ActiveLeavesUpdate, FromOverseer, LeafStatus, OverseerSignal, RuntimeApiError,
|
||||
ActivatedLeaf, ActiveLeavesUpdate, FromOrchestra, LeafStatus, OverseerSignal, RuntimeApiError,
|
||||
};
|
||||
use polkadot_node_subsystem_test_helpers::{make_subsystem_context, TestSubsystemContextHandle};
|
||||
use polkadot_primitives::v2::{
|
||||
@@ -134,7 +134,7 @@ impl TestState {
|
||||
},
|
||||
}
|
||||
|
||||
handle.send(FromOverseer::Signal(OverseerSignal::Conclude)).await;
|
||||
handle.send(FromOrchestra::Signal(OverseerSignal::Conclude)).await;
|
||||
}
|
||||
|
||||
/// Convenience function to invoke [`active_leaves_update`] with the new leaf that starts a new
|
||||
@@ -206,7 +206,7 @@ impl TestState {
|
||||
};
|
||||
|
||||
handle
|
||||
.send(FromOverseer::Signal(OverseerSignal::ActiveLeaves(ActiveLeavesUpdate {
|
||||
.send(FromOrchestra::Signal(OverseerSignal::ActiveLeaves(ActiveLeavesUpdate {
|
||||
activated,
|
||||
deactivated: deactivated.into_iter().cloned().collect(),
|
||||
})))
|
||||
|
||||
@@ -12,7 +12,6 @@ parity-util-mem = { version = "0.11.0", default-features = false }
|
||||
|
||||
sp-api = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sp-authority-discovery = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sp-core = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
sp-consensus-babe = { git = "https://github.com/paritytech/substrate", branch = "master" }
|
||||
|
||||
polkadot-primitives = { path = "../../../primitives" }
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
use polkadot_node_subsystem::{
|
||||
errors::RuntimeApiError,
|
||||
messages::{RuntimeApiMessage, RuntimeApiRequest as Request},
|
||||
overseer, FromOverseer, OverseerSignal, SpawnedSubsystem, SubsystemError, SubsystemResult,
|
||||
overseer, FromOrchestra, OverseerSignal, SpawnedSubsystem, SubsystemError, SubsystemResult,
|
||||
};
|
||||
use polkadot_primitives::{
|
||||
runtime_api::ParachainHost,
|
||||
@@ -35,7 +35,6 @@ use polkadot_primitives::{
|
||||
use sp_api::ProvideRuntimeApi;
|
||||
use sp_authority_discovery::AuthorityDiscoveryApi;
|
||||
use sp_consensus_babe::BabeApi;
|
||||
use sp_core::traits::SpawnNamed;
|
||||
|
||||
use cache::{RequestResult, RequestResultCache};
|
||||
use futures::{channel::oneshot, prelude::*, select, stream::FuturesUnordered};
|
||||
@@ -62,7 +61,7 @@ const API_REQUEST_TASK_NAME: &str = "polkadot-runtime-api-request";
|
||||
pub struct RuntimeApiSubsystem<Client> {
|
||||
client: Arc<Client>,
|
||||
metrics: Metrics,
|
||||
spawn_handle: Box<dyn SpawnNamed>,
|
||||
spawn_handle: Box<dyn overseer::gen::Spawner>,
|
||||
/// All the active runtime API requests that are currently being executed.
|
||||
active_requests: FuturesUnordered<oneshot::Receiver<Option<RequestResult>>>,
|
||||
/// Requests results cache
|
||||
@@ -74,12 +73,12 @@ impl<Client> RuntimeApiSubsystem<Client> {
|
||||
pub fn new(
|
||||
client: Arc<Client>,
|
||||
metrics: Metrics,
|
||||
spawn_handle: impl SpawnNamed + 'static,
|
||||
spawner: impl overseer::gen::Spawner + 'static,
|
||||
) -> Self {
|
||||
RuntimeApiSubsystem {
|
||||
client,
|
||||
metrics,
|
||||
spawn_handle: Box::new(spawn_handle),
|
||||
spawn_handle: Box::new(spawner),
|
||||
active_requests: Default::default(),
|
||||
requests_cache: RequestResultCache::default(),
|
||||
}
|
||||
@@ -335,10 +334,10 @@ where
|
||||
|
||||
select! {
|
||||
req = ctx.recv().fuse() => match req? {
|
||||
FromOverseer::Signal(OverseerSignal::Conclude) => return Ok(()),
|
||||
FromOverseer::Signal(OverseerSignal::ActiveLeaves(_)) => {},
|
||||
FromOverseer::Signal(OverseerSignal::BlockFinalized(..)) => {},
|
||||
FromOverseer::Communication { msg } => match msg {
|
||||
FromOrchestra::Signal(OverseerSignal::Conclude) => return Ok(()),
|
||||
FromOrchestra::Signal(OverseerSignal::ActiveLeaves(_)) => {},
|
||||
FromOrchestra::Signal(OverseerSignal::BlockFinalized(..)) => {},
|
||||
FromOrchestra::Communication { msg } => match msg {
|
||||
RuntimeApiMessage::Request(relay_parent, request) => {
|
||||
subsystem.spawn_request(relay_parent, request);
|
||||
},
|
||||
|
||||
@@ -18,6 +18,7 @@ use super::*;
|
||||
|
||||
use ::test_helpers::{dummy_committed_candidate_receipt, dummy_validation_code};
|
||||
use polkadot_node_primitives::{BabeAllowedSlots, BabeEpoch, BabeEpochConfiguration};
|
||||
use polkadot_node_subsystem::SpawnGlue;
|
||||
use polkadot_node_subsystem_test_helpers::make_subsystem_context;
|
||||
use polkadot_primitives::v2::{
|
||||
AuthorityDiscoveryId, BlockNumber, CandidateEvent, CandidateHash, CommittedCandidateReceipt,
|
||||
@@ -241,20 +242,21 @@ fn requests_authorities() {
|
||||
let relay_parent = [1; 32].into();
|
||||
let spawner = sp_core::testing::TaskExecutor::new();
|
||||
|
||||
let subsystem = RuntimeApiSubsystem::new(runtime_api.clone(), Metrics(None), spawner);
|
||||
let subsystem =
|
||||
RuntimeApiSubsystem::new(runtime_api.clone(), Metrics(None), SpawnGlue(spawner));
|
||||
let subsystem_task = run(ctx, subsystem).map(|x| x.unwrap());
|
||||
let test_task = async move {
|
||||
let (tx, rx) = oneshot::channel();
|
||||
|
||||
ctx_handle
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: RuntimeApiMessage::Request(relay_parent, Request::Authorities(tx)),
|
||||
})
|
||||
.await;
|
||||
|
||||
assert_eq!(rx.await.unwrap().unwrap(), runtime_api.authorities);
|
||||
|
||||
ctx_handle.send(FromOverseer::Signal(OverseerSignal::Conclude)).await;
|
||||
ctx_handle.send(FromOrchestra::Signal(OverseerSignal::Conclude)).await;
|
||||
};
|
||||
|
||||
futures::executor::block_on(future::join(subsystem_task, test_task));
|
||||
@@ -267,20 +269,21 @@ fn requests_validators() {
|
||||
let relay_parent = [1; 32].into();
|
||||
let spawner = sp_core::testing::TaskExecutor::new();
|
||||
|
||||
let subsystem = RuntimeApiSubsystem::new(runtime_api.clone(), Metrics(None), spawner);
|
||||
let subsystem =
|
||||
RuntimeApiSubsystem::new(runtime_api.clone(), Metrics(None), SpawnGlue(spawner));
|
||||
let subsystem_task = run(ctx, subsystem).map(|x| x.unwrap());
|
||||
let test_task = async move {
|
||||
let (tx, rx) = oneshot::channel();
|
||||
|
||||
ctx_handle
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: RuntimeApiMessage::Request(relay_parent, Request::Validators(tx)),
|
||||
})
|
||||
.await;
|
||||
|
||||
assert_eq!(rx.await.unwrap().unwrap(), runtime_api.validators);
|
||||
|
||||
ctx_handle.send(FromOverseer::Signal(OverseerSignal::Conclude)).await;
|
||||
ctx_handle.send(FromOrchestra::Signal(OverseerSignal::Conclude)).await;
|
||||
};
|
||||
|
||||
futures::executor::block_on(future::join(subsystem_task, test_task));
|
||||
@@ -293,20 +296,21 @@ fn requests_validator_groups() {
|
||||
let relay_parent = [1; 32].into();
|
||||
let spawner = sp_core::testing::TaskExecutor::new();
|
||||
|
||||
let subsystem = RuntimeApiSubsystem::new(runtime_api.clone(), Metrics(None), spawner);
|
||||
let subsystem =
|
||||
RuntimeApiSubsystem::new(runtime_api.clone(), Metrics(None), SpawnGlue(spawner));
|
||||
let subsystem_task = run(ctx, subsystem).map(|x| x.unwrap());
|
||||
let test_task = async move {
|
||||
let (tx, rx) = oneshot::channel();
|
||||
|
||||
ctx_handle
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: RuntimeApiMessage::Request(relay_parent, Request::ValidatorGroups(tx)),
|
||||
})
|
||||
.await;
|
||||
|
||||
assert_eq!(rx.await.unwrap().unwrap().0, runtime_api.validator_groups);
|
||||
|
||||
ctx_handle.send(FromOverseer::Signal(OverseerSignal::Conclude)).await;
|
||||
ctx_handle.send(FromOrchestra::Signal(OverseerSignal::Conclude)).await;
|
||||
};
|
||||
|
||||
futures::executor::block_on(future::join(subsystem_task, test_task));
|
||||
@@ -319,20 +323,21 @@ fn requests_availability_cores() {
|
||||
let relay_parent = [1; 32].into();
|
||||
let spawner = sp_core::testing::TaskExecutor::new();
|
||||
|
||||
let subsystem = RuntimeApiSubsystem::new(runtime_api.clone(), Metrics(None), spawner);
|
||||
let subsystem =
|
||||
RuntimeApiSubsystem::new(runtime_api.clone(), Metrics(None), SpawnGlue(spawner));
|
||||
let subsystem_task = run(ctx, subsystem).map(|x| x.unwrap());
|
||||
let test_task = async move {
|
||||
let (tx, rx) = oneshot::channel();
|
||||
|
||||
ctx_handle
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: RuntimeApiMessage::Request(relay_parent, Request::AvailabilityCores(tx)),
|
||||
})
|
||||
.await;
|
||||
|
||||
assert_eq!(rx.await.unwrap().unwrap(), runtime_api.availability_cores);
|
||||
|
||||
ctx_handle.send(FromOverseer::Signal(OverseerSignal::Conclude)).await;
|
||||
ctx_handle.send(FromOrchestra::Signal(OverseerSignal::Conclude)).await;
|
||||
};
|
||||
|
||||
futures::executor::block_on(future::join(subsystem_task, test_task));
|
||||
@@ -350,13 +355,14 @@ fn requests_persisted_validation_data() {
|
||||
runtime_api.validation_data.insert(para_a, Default::default());
|
||||
let runtime_api = Arc::new(runtime_api);
|
||||
|
||||
let subsystem = RuntimeApiSubsystem::new(runtime_api.clone(), Metrics(None), spawner);
|
||||
let subsystem =
|
||||
RuntimeApiSubsystem::new(runtime_api.clone(), Metrics(None), SpawnGlue(spawner));
|
||||
let subsystem_task = run(ctx, subsystem).map(|x| x.unwrap());
|
||||
let test_task = async move {
|
||||
let (tx, rx) = oneshot::channel();
|
||||
|
||||
ctx_handle
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: RuntimeApiMessage::Request(
|
||||
relay_parent,
|
||||
Request::PersistedValidationData(para_a, OccupiedCoreAssumption::Included, tx),
|
||||
@@ -368,7 +374,7 @@ fn requests_persisted_validation_data() {
|
||||
|
||||
let (tx, rx) = oneshot::channel();
|
||||
ctx_handle
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: RuntimeApiMessage::Request(
|
||||
relay_parent,
|
||||
Request::PersistedValidationData(para_b, OccupiedCoreAssumption::Included, tx),
|
||||
@@ -378,7 +384,7 @@ fn requests_persisted_validation_data() {
|
||||
|
||||
assert_eq!(rx.await.unwrap().unwrap(), None);
|
||||
|
||||
ctx_handle.send(FromOverseer::Signal(OverseerSignal::Conclude)).await;
|
||||
ctx_handle.send(FromOrchestra::Signal(OverseerSignal::Conclude)).await;
|
||||
};
|
||||
|
||||
futures::executor::block_on(future::join(subsystem_task, test_task));
|
||||
@@ -402,13 +408,14 @@ fn requests_assumed_validation_data() {
|
||||
runtime_api.validation_data.insert(para_b, Default::default());
|
||||
let runtime_api = Arc::new(runtime_api);
|
||||
|
||||
let subsystem = RuntimeApiSubsystem::new(runtime_api.clone(), Metrics(None), spawner);
|
||||
let subsystem =
|
||||
RuntimeApiSubsystem::new(runtime_api.clone(), Metrics(None), SpawnGlue(spawner));
|
||||
let subsystem_task = run(ctx, subsystem).map(|x| x.unwrap());
|
||||
let test_task = async move {
|
||||
let (tx, rx) = oneshot::channel();
|
||||
|
||||
ctx_handle
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: RuntimeApiMessage::Request(
|
||||
relay_parent,
|
||||
Request::AssumedValidationData(para_a, expected_data_hash, tx),
|
||||
@@ -420,7 +427,7 @@ fn requests_assumed_validation_data() {
|
||||
|
||||
let (tx, rx) = oneshot::channel();
|
||||
ctx_handle
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: RuntimeApiMessage::Request(
|
||||
relay_parent,
|
||||
Request::AssumedValidationData(para_a, Hash::zero(), tx),
|
||||
@@ -430,7 +437,7 @@ fn requests_assumed_validation_data() {
|
||||
|
||||
assert_eq!(rx.await.unwrap().unwrap(), None);
|
||||
|
||||
ctx_handle.send(FromOverseer::Signal(OverseerSignal::Conclude)).await;
|
||||
ctx_handle.send(FromOrchestra::Signal(OverseerSignal::Conclude)).await;
|
||||
};
|
||||
|
||||
futures::executor::block_on(future::join(subsystem_task, test_task));
|
||||
@@ -451,13 +458,14 @@ fn requests_check_validation_outputs() {
|
||||
|
||||
let runtime_api = Arc::new(runtime_api);
|
||||
|
||||
let subsystem = RuntimeApiSubsystem::new(runtime_api.clone(), Metrics(None), spawner);
|
||||
let subsystem =
|
||||
RuntimeApiSubsystem::new(runtime_api.clone(), Metrics(None), SpawnGlue(spawner));
|
||||
let subsystem_task = run(ctx, subsystem).map(|x| x.unwrap());
|
||||
let test_task = async move {
|
||||
let (tx, rx) = oneshot::channel();
|
||||
|
||||
ctx_handle
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: RuntimeApiMessage::Request(
|
||||
relay_parent,
|
||||
Request::CheckValidationOutputs(para_a, commitments.clone(), tx),
|
||||
@@ -468,7 +476,7 @@ fn requests_check_validation_outputs() {
|
||||
|
||||
let (tx, rx) = oneshot::channel();
|
||||
ctx_handle
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: RuntimeApiMessage::Request(
|
||||
relay_parent,
|
||||
Request::CheckValidationOutputs(para_b, commitments, tx),
|
||||
@@ -477,7 +485,7 @@ fn requests_check_validation_outputs() {
|
||||
.await;
|
||||
assert_eq!(rx.await.unwrap().unwrap(), runtime_api.validation_outputs_results[¶_b]);
|
||||
|
||||
ctx_handle.send(FromOverseer::Signal(OverseerSignal::Conclude)).await;
|
||||
ctx_handle.send(FromOrchestra::Signal(OverseerSignal::Conclude)).await;
|
||||
};
|
||||
|
||||
futures::executor::block_on(future::join(subsystem_task, test_task));
|
||||
@@ -490,20 +498,21 @@ fn requests_session_index_for_child() {
|
||||
let relay_parent = [1; 32].into();
|
||||
let spawner = sp_core::testing::TaskExecutor::new();
|
||||
|
||||
let subsystem = RuntimeApiSubsystem::new(runtime_api.clone(), Metrics(None), spawner);
|
||||
let subsystem =
|
||||
RuntimeApiSubsystem::new(runtime_api.clone(), Metrics(None), SpawnGlue(spawner));
|
||||
let subsystem_task = run(ctx, subsystem).map(|x| x.unwrap());
|
||||
let test_task = async move {
|
||||
let (tx, rx) = oneshot::channel();
|
||||
|
||||
ctx_handle
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: RuntimeApiMessage::Request(relay_parent, Request::SessionIndexForChild(tx)),
|
||||
})
|
||||
.await;
|
||||
|
||||
assert_eq!(rx.await.unwrap().unwrap(), runtime_api.session_index_for_child);
|
||||
|
||||
ctx_handle.send(FromOverseer::Signal(OverseerSignal::Conclude)).await;
|
||||
ctx_handle.send(FromOrchestra::Signal(OverseerSignal::Conclude)).await;
|
||||
};
|
||||
|
||||
futures::executor::block_on(future::join(subsystem_task, test_task));
|
||||
@@ -537,13 +546,14 @@ fn requests_session_info() {
|
||||
|
||||
let relay_parent = [1; 32].into();
|
||||
|
||||
let subsystem = RuntimeApiSubsystem::new(runtime_api.clone(), Metrics(None), spawner);
|
||||
let subsystem =
|
||||
RuntimeApiSubsystem::new(runtime_api.clone(), Metrics(None), SpawnGlue(spawner));
|
||||
let subsystem_task = run(ctx, subsystem).map(|x| x.unwrap());
|
||||
let test_task = async move {
|
||||
let (tx, rx) = oneshot::channel();
|
||||
|
||||
ctx_handle
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: RuntimeApiMessage::Request(
|
||||
relay_parent,
|
||||
Request::SessionInfo(session_index, tx),
|
||||
@@ -553,7 +563,7 @@ fn requests_session_info() {
|
||||
|
||||
assert_eq!(rx.await.unwrap().unwrap(), Some(dummy_session_info()));
|
||||
|
||||
ctx_handle.send(FromOverseer::Signal(OverseerSignal::Conclude)).await;
|
||||
ctx_handle.send(FromOrchestra::Signal(OverseerSignal::Conclude)).await;
|
||||
};
|
||||
|
||||
futures::executor::block_on(future::join(subsystem_task, test_task));
|
||||
@@ -573,13 +583,14 @@ fn requests_validation_code() {
|
||||
runtime_api.validation_code.insert(para_a, validation_code.clone());
|
||||
let runtime_api = Arc::new(runtime_api);
|
||||
|
||||
let subsystem = RuntimeApiSubsystem::new(runtime_api.clone(), Metrics(None), spawner);
|
||||
let subsystem =
|
||||
RuntimeApiSubsystem::new(runtime_api.clone(), Metrics(None), SpawnGlue(spawner));
|
||||
let subsystem_task = run(ctx, subsystem).map(|x| x.unwrap());
|
||||
let test_task = async move {
|
||||
let (tx, rx) = oneshot::channel();
|
||||
|
||||
ctx_handle
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: RuntimeApiMessage::Request(
|
||||
relay_parent,
|
||||
Request::ValidationCode(para_a, OccupiedCoreAssumption::Included, tx),
|
||||
@@ -591,7 +602,7 @@ fn requests_validation_code() {
|
||||
|
||||
let (tx, rx) = oneshot::channel();
|
||||
ctx_handle
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: RuntimeApiMessage::Request(
|
||||
relay_parent,
|
||||
Request::ValidationCode(para_b, OccupiedCoreAssumption::Included, tx),
|
||||
@@ -601,7 +612,7 @@ fn requests_validation_code() {
|
||||
|
||||
assert_eq!(rx.await.unwrap().unwrap(), None);
|
||||
|
||||
ctx_handle.send(FromOverseer::Signal(OverseerSignal::Conclude)).await;
|
||||
ctx_handle.send(FromOrchestra::Signal(OverseerSignal::Conclude)).await;
|
||||
};
|
||||
|
||||
futures::executor::block_on(future::join(subsystem_task, test_task));
|
||||
@@ -622,13 +633,14 @@ fn requests_candidate_pending_availability() {
|
||||
.insert(para_a, candidate_receipt.clone());
|
||||
let runtime_api = Arc::new(runtime_api);
|
||||
|
||||
let subsystem = RuntimeApiSubsystem::new(runtime_api.clone(), Metrics(None), spawner);
|
||||
let subsystem =
|
||||
RuntimeApiSubsystem::new(runtime_api.clone(), Metrics(None), SpawnGlue(spawner));
|
||||
let subsystem_task = run(ctx, subsystem).map(|x| x.unwrap());
|
||||
let test_task = async move {
|
||||
let (tx, rx) = oneshot::channel();
|
||||
|
||||
ctx_handle
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: RuntimeApiMessage::Request(
|
||||
relay_parent,
|
||||
Request::CandidatePendingAvailability(para_a, tx),
|
||||
@@ -641,7 +653,7 @@ fn requests_candidate_pending_availability() {
|
||||
let (tx, rx) = oneshot::channel();
|
||||
|
||||
ctx_handle
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: RuntimeApiMessage::Request(
|
||||
relay_parent,
|
||||
Request::CandidatePendingAvailability(para_b, tx),
|
||||
@@ -651,7 +663,7 @@ fn requests_candidate_pending_availability() {
|
||||
|
||||
assert_eq!(rx.await.unwrap().unwrap(), None);
|
||||
|
||||
ctx_handle.send(FromOverseer::Signal(OverseerSignal::Conclude)).await;
|
||||
ctx_handle.send(FromOrchestra::Signal(OverseerSignal::Conclude)).await;
|
||||
};
|
||||
|
||||
futures::executor::block_on(future::join(subsystem_task, test_task));
|
||||
@@ -664,20 +676,21 @@ fn requests_candidate_events() {
|
||||
let relay_parent = [1; 32].into();
|
||||
let spawner = sp_core::testing::TaskExecutor::new();
|
||||
|
||||
let subsystem = RuntimeApiSubsystem::new(runtime_api.clone(), Metrics(None), spawner);
|
||||
let subsystem =
|
||||
RuntimeApiSubsystem::new(runtime_api.clone(), Metrics(None), SpawnGlue(spawner));
|
||||
let subsystem_task = run(ctx, subsystem).map(|x| x.unwrap());
|
||||
let test_task = async move {
|
||||
let (tx, rx) = oneshot::channel();
|
||||
|
||||
ctx_handle
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: RuntimeApiMessage::Request(relay_parent, Request::CandidateEvents(tx)),
|
||||
})
|
||||
.await;
|
||||
|
||||
assert_eq!(rx.await.unwrap().unwrap(), runtime_api.candidate_events);
|
||||
|
||||
ctx_handle.send(FromOverseer::Signal(OverseerSignal::Conclude)).await;
|
||||
ctx_handle.send(FromOrchestra::Signal(OverseerSignal::Conclude)).await;
|
||||
};
|
||||
|
||||
futures::executor::block_on(future::join(subsystem_task, test_task));
|
||||
@@ -704,12 +717,13 @@ fn requests_dmq_contents() {
|
||||
runtime_api
|
||||
});
|
||||
|
||||
let subsystem = RuntimeApiSubsystem::new(runtime_api.clone(), Metrics(None), spawner);
|
||||
let subsystem =
|
||||
RuntimeApiSubsystem::new(runtime_api.clone(), Metrics(None), SpawnGlue(spawner));
|
||||
let subsystem_task = run(ctx, subsystem).map(|x| x.unwrap());
|
||||
let test_task = async move {
|
||||
let (tx, rx) = oneshot::channel();
|
||||
ctx_handle
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: RuntimeApiMessage::Request(relay_parent, Request::DmqContents(para_a, tx)),
|
||||
})
|
||||
.await;
|
||||
@@ -717,7 +731,7 @@ fn requests_dmq_contents() {
|
||||
|
||||
let (tx, rx) = oneshot::channel();
|
||||
ctx_handle
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: RuntimeApiMessage::Request(relay_parent, Request::DmqContents(para_b, tx)),
|
||||
})
|
||||
.await;
|
||||
@@ -726,7 +740,7 @@ fn requests_dmq_contents() {
|
||||
vec![InboundDownwardMessage { sent_at: 228, msg: b"Novus Ordo Seclorum".to_vec() }]
|
||||
);
|
||||
|
||||
ctx_handle.send(FromOverseer::Signal(OverseerSignal::Conclude)).await;
|
||||
ctx_handle.send(FromOrchestra::Signal(OverseerSignal::Conclude)).await;
|
||||
};
|
||||
futures::executor::block_on(future::join(subsystem_task, test_task));
|
||||
}
|
||||
@@ -758,12 +772,13 @@ fn requests_inbound_hrmp_channels_contents() {
|
||||
runtime_api
|
||||
});
|
||||
|
||||
let subsystem = RuntimeApiSubsystem::new(runtime_api.clone(), Metrics(None), spawner);
|
||||
let subsystem =
|
||||
RuntimeApiSubsystem::new(runtime_api.clone(), Metrics(None), SpawnGlue(spawner));
|
||||
let subsystem_task = run(ctx, subsystem).map(|x| x.unwrap());
|
||||
let test_task = async move {
|
||||
let (tx, rx) = oneshot::channel();
|
||||
ctx_handle
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: RuntimeApiMessage::Request(
|
||||
relay_parent,
|
||||
Request::InboundHrmpChannelsContents(para_a, tx),
|
||||
@@ -774,7 +789,7 @@ fn requests_inbound_hrmp_channels_contents() {
|
||||
|
||||
let (tx, rx) = oneshot::channel();
|
||||
ctx_handle
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: RuntimeApiMessage::Request(
|
||||
relay_parent,
|
||||
Request::InboundHrmpChannelsContents(para_b, tx),
|
||||
@@ -783,7 +798,7 @@ fn requests_inbound_hrmp_channels_contents() {
|
||||
.await;
|
||||
assert_eq!(rx.await.unwrap().unwrap(), para_b_inbound_channels);
|
||||
|
||||
ctx_handle.send(FromOverseer::Signal(OverseerSignal::Conclude)).await;
|
||||
ctx_handle.send(FromOrchestra::Signal(OverseerSignal::Conclude)).await;
|
||||
};
|
||||
futures::executor::block_on(future::join(subsystem_task, test_task));
|
||||
}
|
||||
@@ -806,7 +821,8 @@ fn requests_validation_code_by_hash() {
|
||||
(runtime_api, validation_code)
|
||||
};
|
||||
|
||||
let subsystem = RuntimeApiSubsystem::new(Arc::new(runtime_api), Metrics(None), spawner);
|
||||
let subsystem =
|
||||
RuntimeApiSubsystem::new(Arc::new(runtime_api), Metrics(None), SpawnGlue(spawner));
|
||||
let subsystem_task = run(ctx, subsystem).map(|x| x.unwrap());
|
||||
|
||||
let relay_parent = [1; 32].into();
|
||||
@@ -814,7 +830,7 @@ fn requests_validation_code_by_hash() {
|
||||
for code in validation_code {
|
||||
let (tx, rx) = oneshot::channel();
|
||||
ctx_handle
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: RuntimeApiMessage::Request(
|
||||
relay_parent,
|
||||
Request::ValidationCodeByHash(code.hash(), tx),
|
||||
@@ -825,7 +841,7 @@ fn requests_validation_code_by_hash() {
|
||||
assert_eq!(rx.await.unwrap().unwrap(), Some(code));
|
||||
}
|
||||
|
||||
ctx_handle.send(FromOverseer::Signal(OverseerSignal::Conclude)).await;
|
||||
ctx_handle.send(FromOrchestra::Signal(OverseerSignal::Conclude)).await;
|
||||
};
|
||||
|
||||
futures::executor::block_on(future::join(subsystem_task, test_task));
|
||||
@@ -839,7 +855,8 @@ fn multiple_requests_in_parallel_are_working() {
|
||||
let spawner = sp_core::testing::TaskExecutor::new();
|
||||
let mutex = runtime_api.availability_cores_wait.clone();
|
||||
|
||||
let subsystem = RuntimeApiSubsystem::new(runtime_api.clone(), Metrics(None), spawner);
|
||||
let subsystem =
|
||||
RuntimeApiSubsystem::new(runtime_api.clone(), Metrics(None), SpawnGlue(spawner));
|
||||
let subsystem_task = run(ctx, subsystem).map(|x| x.unwrap());
|
||||
let test_task = async move {
|
||||
// Make all requests block until we release this mutex.
|
||||
@@ -850,7 +867,7 @@ fn multiple_requests_in_parallel_are_working() {
|
||||
let (tx, rx) = oneshot::channel();
|
||||
|
||||
ctx_handle
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: RuntimeApiMessage::Request(relay_parent, Request::AvailabilityCores(tx)),
|
||||
})
|
||||
.await;
|
||||
@@ -864,7 +881,7 @@ fn multiple_requests_in_parallel_are_working() {
|
||||
let (tx, rx) = oneshot::channel();
|
||||
|
||||
ctx_handle
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: RuntimeApiMessage::Request(relay_parent, Request::AvailabilityCores(tx)),
|
||||
})
|
||||
.await;
|
||||
@@ -877,7 +894,7 @@ fn multiple_requests_in_parallel_are_working() {
|
||||
.into_iter()
|
||||
.for_each(|r| assert_eq!(r.unwrap().unwrap(), runtime_api.availability_cores));
|
||||
|
||||
ctx_handle.send(FromOverseer::Signal(OverseerSignal::Conclude)).await;
|
||||
ctx_handle.send(FromOrchestra::Signal(OverseerSignal::Conclude)).await;
|
||||
};
|
||||
|
||||
futures::executor::block_on(future::join(subsystem_task, test_task));
|
||||
@@ -900,19 +917,20 @@ fn requests_babe_epoch() {
|
||||
let relay_parent = [1; 32].into();
|
||||
let spawner = sp_core::testing::TaskExecutor::new();
|
||||
|
||||
let subsystem = RuntimeApiSubsystem::new(runtime_api.clone(), Metrics(None), spawner);
|
||||
let subsystem =
|
||||
RuntimeApiSubsystem::new(runtime_api.clone(), Metrics(None), SpawnGlue(spawner));
|
||||
let subsystem_task = run(ctx, subsystem).map(|x| x.unwrap());
|
||||
let test_task = async move {
|
||||
let (tx, rx) = oneshot::channel();
|
||||
|
||||
ctx_handle
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: RuntimeApiMessage::Request(relay_parent, Request::CurrentBabeEpoch(tx)),
|
||||
})
|
||||
.await;
|
||||
|
||||
assert_eq!(rx.await.unwrap().unwrap(), epoch);
|
||||
ctx_handle.send(FromOverseer::Signal(OverseerSignal::Conclude)).await;
|
||||
ctx_handle.send(FromOrchestra::Signal(OverseerSignal::Conclude)).await;
|
||||
};
|
||||
|
||||
futures::executor::block_on(future::join(subsystem_task, test_task));
|
||||
@@ -924,7 +942,8 @@ fn requests_submit_pvf_check_statement() {
|
||||
let spawner = sp_core::testing::TaskExecutor::new();
|
||||
|
||||
let runtime_api = Arc::new(MockRuntimeApi::default());
|
||||
let subsystem = RuntimeApiSubsystem::new(runtime_api.clone(), Metrics(None), spawner);
|
||||
let subsystem =
|
||||
RuntimeApiSubsystem::new(runtime_api.clone(), Metrics(None), SpawnGlue(spawner));
|
||||
let subsystem_task = run(ctx, subsystem).map(|x| x.unwrap());
|
||||
|
||||
let relay_parent = [1; 32].into();
|
||||
@@ -936,7 +955,7 @@ fn requests_submit_pvf_check_statement() {
|
||||
// Here we just want to ensure that those requests do not go through the cache.
|
||||
let (tx, rx) = oneshot::channel();
|
||||
ctx_handle
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: RuntimeApiMessage::Request(
|
||||
relay_parent,
|
||||
Request::SubmitPvfCheckStatement(stmt.clone(), sig.clone(), tx),
|
||||
@@ -946,7 +965,7 @@ fn requests_submit_pvf_check_statement() {
|
||||
assert_eq!(rx.await.unwrap().unwrap(), ());
|
||||
let (tx, rx) = oneshot::channel();
|
||||
ctx_handle
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: RuntimeApiMessage::Request(
|
||||
relay_parent,
|
||||
Request::SubmitPvfCheckStatement(stmt.clone(), sig.clone(), tx),
|
||||
@@ -960,7 +979,7 @@ fn requests_submit_pvf_check_statement() {
|
||||
&[(stmt.clone(), sig.clone()), (stmt.clone(), sig.clone())]
|
||||
);
|
||||
|
||||
ctx_handle.send(FromOverseer::Signal(OverseerSignal::Conclude)).await;
|
||||
ctx_handle.send(FromOrchestra::Signal(OverseerSignal::Conclude)).await;
|
||||
};
|
||||
|
||||
futures::executor::block_on(future::join(subsystem_task, test_task));
|
||||
@@ -988,7 +1007,8 @@ fn requests_pvfs_require_precheck() {
|
||||
runtime_api
|
||||
});
|
||||
|
||||
let subsystem = RuntimeApiSubsystem::new(runtime_api.clone(), Metrics(None), spawner);
|
||||
let subsystem =
|
||||
RuntimeApiSubsystem::new(runtime_api.clone(), Metrics(None), SpawnGlue(spawner));
|
||||
let subsystem_task = run(ctx, subsystem).map(|x| x.unwrap());
|
||||
|
||||
let relay_parent = [1; 32].into();
|
||||
@@ -996,13 +1016,13 @@ fn requests_pvfs_require_precheck() {
|
||||
let (tx, rx) = oneshot::channel();
|
||||
|
||||
ctx_handle
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: RuntimeApiMessage::Request(relay_parent, Request::PvfsRequirePrecheck(tx)),
|
||||
})
|
||||
.await;
|
||||
|
||||
assert_eq!(rx.await.unwrap().unwrap(), vec![[1; 32].into(), [2; 32].into()]);
|
||||
ctx_handle.send(FromOverseer::Signal(OverseerSignal::Conclude)).await;
|
||||
ctx_handle.send(FromOrchestra::Signal(OverseerSignal::Conclude)).await;
|
||||
};
|
||||
|
||||
futures::executor::block_on(future::join(subsystem_task, test_task));
|
||||
@@ -1022,13 +1042,14 @@ fn requests_validation_code_hash() {
|
||||
runtime_api.validation_code_hash.insert(para_a, validation_code_hash.clone());
|
||||
let runtime_api = Arc::new(runtime_api);
|
||||
|
||||
let subsystem = RuntimeApiSubsystem::new(runtime_api.clone(), Metrics(None), spawner);
|
||||
let subsystem =
|
||||
RuntimeApiSubsystem::new(runtime_api.clone(), Metrics(None), SpawnGlue(spawner));
|
||||
let subsystem_task = run(ctx, subsystem).map(|x| x.unwrap());
|
||||
let test_task = async move {
|
||||
let (tx, rx) = oneshot::channel();
|
||||
|
||||
ctx_handle
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: RuntimeApiMessage::Request(
|
||||
relay_parent,
|
||||
Request::ValidationCodeHash(para_a, OccupiedCoreAssumption::Included, tx),
|
||||
@@ -1040,7 +1061,7 @@ fn requests_validation_code_hash() {
|
||||
|
||||
let (tx, rx) = oneshot::channel();
|
||||
ctx_handle
|
||||
.send(FromOverseer::Communication {
|
||||
.send(FromOrchestra::Communication {
|
||||
msg: RuntimeApiMessage::Request(
|
||||
relay_parent,
|
||||
Request::ValidationCodeHash(para_b, OccupiedCoreAssumption::Included, tx),
|
||||
@@ -1050,7 +1071,7 @@ fn requests_validation_code_hash() {
|
||||
|
||||
assert_eq!(rx.await.unwrap().unwrap(), None);
|
||||
|
||||
ctx_handle.send(FromOverseer::Signal(OverseerSignal::Conclude)).await;
|
||||
ctx_handle.send(FromOrchestra::Signal(OverseerSignal::Conclude)).await;
|
||||
};
|
||||
|
||||
futures::executor::block_on(future::join(subsystem_task, test_task));
|
||||
|
||||
Reference in New Issue
Block a user