From bec3c39b731059e1f0ab953df79fc14c48ffc2cd Mon Sep 17 00:00:00 2001 From: Raneet Debnath Date: Wed, 29 Mar 2023 17:36:57 +0530 Subject: [PATCH 1/2] consensus/bor: revert handle unauthorized signer in consensus.Prepare --- consensus/bor/bor.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/consensus/bor/bor.go b/consensus/bor/bor.go index 39dcdaea61..af7be1c555 100644 --- a/consensus/bor/bor.go +++ b/consensus/bor/bor.go @@ -694,10 +694,10 @@ func (c *Bor) Prepare(chain consensus.ChainHeaderReader, header *types.Header) e // Bail out early if we're unauthorized to sign a block. This check also takes // place before block is signed in `Seal`. - if !snap.ValidatorSet.HasAddress(currentSigner.signer) { - // Check the UnauthorizedSignerError.Error() msg to see why we pass number-1 - return &UnauthorizedSignerError{number - 1, currentSigner.signer.Bytes()} - } + // if !snap.ValidatorSet.HasAddress(currentSigner.signer) { + // // Check the UnauthorizedSignerError.Error() msg to see why we pass number-1 + // return &UnauthorizedSignerError{number - 1, currentSigner.signer.Bytes()} + // } // Set the correct difficulty header.Difficulty = new(big.Int).SetUint64(Difficulty(snap.ValidatorSet, currentSigner.signer)) From 7bd393fc682d3268ff70289c632f8003e63307d1 Mon Sep 17 00:00:00 2001 From: Raneet Debnath Date: Thu, 30 Mar 2023 08:33:31 +0530 Subject: [PATCH 2/2] Revert "consensus/bor: handle unauthorized signer in consensus.Prepare (#651)" This reverts commit 9ce8c7de75a1b5021bb6f2b8086e813c8244b22c. --- consensus/bor/bor.go | 7 ------- 1 file changed, 7 deletions(-) diff --git a/consensus/bor/bor.go b/consensus/bor/bor.go index af7be1c555..a920a1992d 100644 --- a/consensus/bor/bor.go +++ b/consensus/bor/bor.go @@ -692,13 +692,6 @@ func (c *Bor) Prepare(chain consensus.ChainHeaderReader, header *types.Header) e currentSigner := *c.authorizedSigner.Load() - // Bail out early if we're unauthorized to sign a block. This check also takes - // place before block is signed in `Seal`. - // if !snap.ValidatorSet.HasAddress(currentSigner.signer) { - // // Check the UnauthorizedSignerError.Error() msg to see why we pass number-1 - // return &UnauthorizedSignerError{number - 1, currentSigner.signer.Bytes()} - // } - // Set the correct difficulty header.Difficulty = new(big.Int).SetUint64(Difficulty(snap.ValidatorSet, currentSigner.signer))