polkadot: pin one block per session (#1220)

* polkadot: propagate UnpinHandle to ActiveLeafUpdate

Also extract the leaf creation for tests
into a common function.

* dispute-coordinator: try pinned blocks for slashin

* apparently 1.72 is smarter than 1.70

* address nits

* rename fresh_leaf to new_leaf
This commit is contained in:
ordian
2023-09-07 12:24:40 +02:00
committed by GitHub
parent 1346143194
commit 15503883e2
33 changed files with 387 additions and 620 deletions
@@ -19,7 +19,6 @@
use std::{
collections::HashSet,
sync::Arc,
task::Poll,
time::{Duration, Instant},
};
@@ -51,10 +50,11 @@ use polkadot_node_subsystem::{
AllMessages, DisputeCoordinatorMessage, DisputeDistributionMessage, ImportStatementsResult,
NetworkBridgeTxMessage, RuntimeApiMessage, RuntimeApiRequest,
},
ActivatedLeaf, ActiveLeavesUpdate, FromOrchestra, LeafStatus, OverseerSignal, Span,
ActiveLeavesUpdate, FromOrchestra, OverseerSignal,
};
use polkadot_node_subsystem_test_helpers::{
mock::make_ferdie_keystore, subsystem_test_harness, TestSubsystemContextHandle,
mock::{make_ferdie_keystore, new_leaf},
subsystem_test_harness, TestSubsystemContextHandle,
};
use polkadot_primitives::{
AuthorityDiscoveryId, CandidateHash, CandidateReceipt, ExecutorParams, Hash, SessionIndex,
@@ -735,12 +735,7 @@ async fn activate_leaf(
) {
handle
.send(FromOrchestra::Signal(OverseerSignal::ActiveLeaves(ActiveLeavesUpdate {
activated: Some(ActivatedLeaf {
hash: activate,
number: 10,
status: LeafStatus::Fresh,
span: Arc::new(Span::Disabled),
}),
activated: Some(new_leaf(activate, 10)),
deactivated: deactivate.into_iter().collect(),
})))
.await;