Chain-selection subsystem data revert (#5350)

* Chain-selection subsystem data revert

* Cargo fmt

* Better code comments

* Remove unwraps

* Document public method

* Remove duplicated 'ChainSelectionSubsystem' impl block

* Fix typos

* Nitpicks

* Revert returns a service Error

* Removed superflous error handling

* Apply suggestions from code review

* Rename tree 'revert' to 'revert_to'

Co-authored-by: Sebastian Kunert <skunert49@gmail.com>
This commit is contained in:
Davide Galassi
2022-04-28 17:44:14 +02:00
committed by GitHub
parent ac23b3f96c
commit bbdfc3d9c6
6 changed files with 243 additions and 45 deletions
@@ -501,7 +501,7 @@ where
match rx.await.map_err(Error::DetermineUndisputedChainCanceled) {
// If request succeded we will receive (block number, block hash).
Ok((subchain_number, subchain_head)) => {
// The the total lag accounting for disputes.
// The total lag accounting for disputes.
let lag_disputes = initial_leaf_number.saturating_sub(subchain_number);
self.metrics.note_disputes_finality_lag(lag_disputes);
(lag_disputes, subchain_head)