From 25ed1353314463fb9dd8a4ee4d9df418d7c8b722 Mon Sep 17 00:00:00 2001 From: meta-bot Date: Mon, 1 Nov 2021 00:25:02 +0600 Subject: [PATCH] reorg is off in pandora now --- consensus/pandora/subscription.go | 40 +++++++++++++++---------------- 1 file changed, 19 insertions(+), 21 deletions(-) diff --git a/consensus/pandora/subscription.go b/consensus/pandora/subscription.go index 7c1c060016a8..bf8d5373b452 100644 --- a/consensus/pandora/subscription.go +++ b/consensus/pandora/subscription.go @@ -4,8 +4,6 @@ import ( "context" "fmt" - "github.com/ethereum/go-ethereum/common" - "github.com/ethereum/go-ethereum/common/hexutil" "github.com/ethereum/go-ethereum/log" "github.com/ethereum/go-ethereum/rlp" @@ -201,25 +199,25 @@ func (p *Pandora) processEpochInfo(info *EpochInfoPayload) error { p.setEpochInfo(epochInfo.Epoch, epochInfo) - if info.ReorgInfo != nil { - log.Info("reorg event received") - // reorg info is present so reorg is triggered in vanguard side - parentHash := common.BytesToHash(info.ReorgInfo.PanParentHash) - parentBlock := p.chain.GetHeaderByHash(parentHash) - if parentBlock != nil { - // it is an invalid behaviour. Pandora doesn't have the block that should be present - parentBlockNumber := parentBlock.Number.Uint64() - err := p.chain.SetHead(parentBlockNumber) - if err != nil { - log.Error("failed to revert to the mentioned block in reorg", "block number", parentBlockNumber, "block hash", parentHash, "error", err) - return err - } - } else { - // requested block is not present. Maybe the node is in previous block and received this Epoch. - // but we can just move on. - log.Info("failed to find block for reorg", "requested hash", parentHash) - } - } + //if info.ReorgInfo != nil { + // log.Info("reorg event received") + // // reorg info is present so reorg is triggered in vanguard side + // parentHash := common.BytesToHash(info.ReorgInfo.PanParentHash) + // parentBlock := p.chain.GetHeaderByHash(parentHash) + // if parentBlock != nil { + // // it is an invalid behaviour. Pandora doesn't have the block that should be present + // parentBlockNumber := parentBlock.Number.Uint64() + // err := p.chain.SetHead(parentBlockNumber) + // if err != nil { + // log.Error("failed to revert to the mentioned block in reorg", "block number", parentBlockNumber, "block hash", parentHash, "error", err) + // return err + // } + // } else { + // // requested block is not present. Maybe the node is in previous block and received this Epoch. + // // but we can just move on. + // log.Info("failed to find block for reorg", "requested hash", parentHash) + // } + //} return nil }