pallet-beefy: ensure mandatory block once per session (#11269)

* pallet-beefy: ensure mandatory block once per session

Signed-off-by: acatangiu <adrian@parity.io>

* pallet-beefy: fix tests with auth changes every session

Signed-off-by: acatangiu <adrian@parity.io>

* Apply suggestions from code review

Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>

* beefy: fix incorrect skip session metric on node restart

Co-authored-by: André Silva <123550+andresilva@users.noreply.github.com>
This commit is contained in:
Adrian Catangiu
2022-04-28 14:19:32 +03:00
committed by GitHub
parent 21341f35e2
commit 0d73371bb8
5 changed files with 46 additions and 34 deletions
+4 -1
View File
@@ -242,7 +242,10 @@ where
debug!(target: "beefy", "🥩 New active validator set: {:?}", active);
metric_set!(self, beefy_validator_set_id, active.id());
// BEEFY should produce a signed commitment for each session
if active.id() != self.last_signed_id + 1 && active.id() != GENESIS_AUTHORITY_SET_ID {
if active.id() != self.last_signed_id + 1 &&
active.id() != GENESIS_AUTHORITY_SET_ID &&
self.last_signed_id != 0
{
metric_inc!(self, beefy_skipped_sessions);
}