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 authored and GitHub committed 2023-09-07 13:24:40 +03:00
1 parent 1346143194
commit 15503883e2
33 files changed
+387 -620

No files matched your search

@@ -40,7 +40,7 @@ use polkadot_node_subsystem::{
errors::RuntimeApiError,
jaeger,
messages::{AllMessages, ReportPeerMessage, RuntimeApiMessage, RuntimeApiRequest},
ActivatedLeaf, ActiveLeavesUpdate, LeafStatus,
ActiveLeavesUpdate,
};
use polkadot_node_subsystem_test_helpers as test_helpers;
use polkadot_node_subsystem_util::{reputation::add_reputation, TimeoutExt};
@@ -49,6 +49,7 @@ use polkadot_primitives::{
ScheduledCore, SessionIndex, SessionInfo, ValidatorId, ValidatorIndex,
};
use polkadot_primitives_test_helpers::TestCandidateBuilder;
use test_helpers::mock::new_leaf;
mod prospective_parachains;
@@ -310,12 +311,10 @@ async fn setup_system(virtual_overseer: &mut VirtualOverseer, test_state: &TestS
overseer_signal(
virtual_overseer,
OverseerSignal::ActiveLeaves(ActiveLeavesUpdate::start_work(ActivatedLeaf {
hash: test_state.relay_parent,
number: 1,
status: LeafStatus::Fresh,
span: Arc::new(jaeger::Span::Disabled),
})),
OverseerSignal::ActiveLeaves(ActiveLeavesUpdate::start_work(new_leaf(
test_state.relay_parent,
1,
))),
)
.await;