Backport: Implement basic equivocations detection loop (#2375)

* Implement basic equivocations detection loop (#2367)

* FinalityProofsBuf adjustments

- store a Vec<FinalityProof>
- transform prune `buf_limit` to Option

* FinalityProof: add target_header_hash()

* Target client: implement best_synced_header_hash()

* Implement first version of the equivocations detection loop

* Address code review comments

* Leftover

* polkadot-staging adjustments
This commit is contained in:
Serban Iorga
2023-08-23 19:31:17 +03:00
committed by Bastian Köcher
parent cc3bbc690b
commit 588508acd4
18 changed files with 572 additions and 79 deletions
@@ -19,6 +19,7 @@
//! `<BridgedName>` chain.
use crate::{
finality_base::best_synced_header_id,
messages_lane::{
BatchProofTransaction, MessageLaneAdapter, ReceiveMessagesDeliveryProofCallBuilder,
SubstrateMessageLane,
@@ -428,11 +429,7 @@ where
// now let's read id of best finalized peer header at our best finalized block
let peer_on_self_best_finalized_id =
best_finalized_peer_header_at_self::<SelfChain, PeerChain>(
self_client,
self_best_id.hash(),
)
.await?;
best_synced_header_id::<PeerChain, SelfChain>(self_client, self_best_id.hash()).await?;
// read actual header, matching the `peer_on_self_best_finalized_id` from the peer chain
let actual_peer_on_self_best_finalized_id =