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
+5 -9
View File
@@ -17,14 +17,15 @@
use ::test_helpers::{dummy_digest, dummy_hash};
use futures::{channel::oneshot, future::BoxFuture, prelude::*};
use polkadot_node_subsystem::{
jaeger,
messages::{
AllMessages, CandidateValidationMessage, PreCheckOutcome, PvfCheckerMessage,
RuntimeApiMessage, RuntimeApiRequest,
},
ActivatedLeaf, ActiveLeavesUpdate, FromOrchestra, LeafStatus, OverseerSignal, RuntimeApiError,
ActiveLeavesUpdate, FromOrchestra, OverseerSignal, RuntimeApiError,
};
use polkadot_node_subsystem_test_helpers::{
make_subsystem_context, mock::new_leaf, TestSubsystemContextHandle,
};
use polkadot_node_subsystem_test_helpers::{make_subsystem_context, TestSubsystemContextHandle};
use polkadot_primitives::{
BlockNumber, Hash, Header, PvfCheckStatement, SessionIndex, ValidationCode, ValidationCodeHash,
ValidatorId,
@@ -195,12 +196,7 @@ impl TestState {
},
);
Some(ActivatedLeaf {
hash: activated_leaf.block_hash,
span: Arc::new(jaeger::Span::Disabled),
number: activated_leaf.block_number,
status: LeafStatus::Fresh,
})
Some(new_leaf(activated_leaf.block_hash, activated_leaf.block_number))
} else {
None
};