From 5f1a1115d02dc0c07ed4da09f3e668d95f6231f8 Mon Sep 17 00:00:00 2001 From: NathanBSC Date: Mon, 29 Jul 2024 15:31:47 +0800 Subject: [PATCH 1/2] consensus/parlia: exclude inturn validator when calculate backoffTime --- consensus/parlia/parlia.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/consensus/parlia/parlia.go b/consensus/parlia/parlia.go index 2b7e16090b..1ef615c716 100644 --- a/consensus/parlia/parlia.go +++ b/consensus/parlia/parlia.go @@ -2029,12 +2029,17 @@ func (p *Parlia) backOffTime(snap *Snapshot, header *types.Header, val common.Ad delay = 0 } - // Exclude the recently signed validators + // Exclude the recently signed validators and inTurnAddr temp := make([]common.Address, 0, len(validators)) for _, addr := range validators { if snap.signRecentlyByCounts(addr, counts) { continue } + if p.chainConfig.IsBohr(header.Number, header.Time) { + if addr == inTurnAddr { + continue + } + } temp = append(temp, addr) } validators = temp From 204639ecd23b4c92b89c8c558fd318f5fe0fab95 Mon Sep 17 00:00:00 2001 From: NathanBSC Date: Mon, 29 Jul 2024 16:12:00 +0800 Subject: [PATCH 2/2] consensus/parlia: improve comments --- consensus/parlia/parlia.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/consensus/parlia/parlia.go b/consensus/parlia/parlia.go index 1ef615c716..7f7b6e493c 100644 --- a/consensus/parlia/parlia.go +++ b/consensus/parlia/parlia.go @@ -2029,7 +2029,7 @@ func (p *Parlia) backOffTime(snap *Snapshot, header *types.Header, val common.Ad delay = 0 } - // Exclude the recently signed validators and inTurnAddr + // Exclude the recently signed validators and the in turn validator temp := make([]common.Address, 0, len(validators)) for _, addr := range validators { if snap.signRecentlyByCounts(addr, counts) {