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
@@ -36,13 +36,12 @@ use polkadot_node_primitives::{
SignedFullStatementWithPVD, Statement, UncheckedSignedFullStatement,
};
use polkadot_node_subsystem::{
jaeger,
messages::{
network_bridge_event, AllMessages, ReportPeerMessage, RuntimeApiMessage, RuntimeApiRequest,
},
ActivatedLeaf, LeafStatus, RuntimeApiError,
RuntimeApiError,
};
use polkadot_node_subsystem_test_helpers::mock::make_ferdie_keystore;
use polkadot_node_subsystem_test_helpers::mock::{make_ferdie_keystore, new_leaf};
use polkadot_primitives::{
ExecutorParams, GroupIndex, Hash, HeadData, Id as ParaId, IndexedVec, SessionInfo,
ValidationCode,
@@ -787,12 +786,7 @@ fn receiving_from_one_sends_to_another_and_to_candidate_backing() {
// register our active heads.
handle
.send(FromOrchestra::Signal(OverseerSignal::ActiveLeaves(
ActiveLeavesUpdate::start_work(ActivatedLeaf {
hash: hash_a,
number: 1,
status: LeafStatus::Fresh,
span: Arc::new(jaeger::Span::Disabled),
}),
ActiveLeavesUpdate::start_work(new_leaf(hash_a, 1)),
)))
.await;
@@ -1032,12 +1026,7 @@ fn receiving_large_statement_from_one_sends_to_another_and_to_candidate_backing(
// register our active heads.
handle
.send(FromOrchestra::Signal(OverseerSignal::ActiveLeaves(
ActiveLeavesUpdate::start_work(ActivatedLeaf {
hash: hash_a,
number: 1,
status: LeafStatus::Fresh,
span: Arc::new(jaeger::Span::Disabled),
}),
ActiveLeavesUpdate::start_work(new_leaf(hash_a, 1)),
)))
.await;
@@ -1567,12 +1556,7 @@ fn delay_reputation_changes() {
// register our active heads.
handle
.send(FromOrchestra::Signal(OverseerSignal::ActiveLeaves(
ActiveLeavesUpdate::start_work(ActivatedLeaf {
hash: hash_a,
number: 1,
status: LeafStatus::Fresh,
span: Arc::new(jaeger::Span::Disabled),
}),
ActiveLeavesUpdate::start_work(new_leaf(hash_a, 1)),
)))
.await;
@@ -2052,12 +2036,7 @@ fn share_prioritizes_backing_group() {
// register our active heads.
handle
.send(FromOrchestra::Signal(OverseerSignal::ActiveLeaves(
ActiveLeavesUpdate::start_work(ActivatedLeaf {
hash: hash_a,
number: 1,
status: LeafStatus::Fresh,
span: Arc::new(jaeger::Span::Disabled),
}),
ActiveLeavesUpdate::start_work(new_leaf(hash_a, 1)),
)))
.await;
@@ -2379,12 +2358,7 @@ fn peer_cant_flood_with_large_statements() {
// register our active heads.
handle
.send(FromOrchestra::Signal(OverseerSignal::ActiveLeaves(
ActiveLeavesUpdate::start_work(ActivatedLeaf {
hash: hash_a,
number: 1,
status: LeafStatus::Fresh,
span: Arc::new(jaeger::Span::Disabled),
}),
ActiveLeavesUpdate::start_work(new_leaf(hash_a, 1)),
)))
.await;
@@ -2609,12 +2583,7 @@ fn handle_multiple_seconded_statements() {
// register our active heads.
handle
.send(FromOrchestra::Signal(OverseerSignal::ActiveLeaves(
ActiveLeavesUpdate::start_work(ActivatedLeaf {
hash: relay_parent_hash,
number: 1,
status: LeafStatus::Fresh,
span: Arc::new(jaeger::Span::Disabled),
}),
ActiveLeavesUpdate::start_work(new_leaf(relay_parent_hash, 1)),
)))
.await;