From e8939bc12e9bb98a870557c13dabd471f0cf552e Mon Sep 17 00:00:00 2001 From: Shivam Sharma Date: Tue, 17 Oct 2023 12:43:58 +0530 Subject: [PATCH] chg : withdrawals check in bor consensus --- consensus/bor/bor.go | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/consensus/bor/bor.go b/consensus/bor/bor.go index 9bfc069174..d1a9b9f2b2 100644 --- a/consensus/bor/bor.go +++ b/consensus/bor/bor.go @@ -816,6 +816,16 @@ func (c *Bor) Finalize(chain consensus.ChainHeaderReader, header *types.Header, headerNumber := header.Number.Uint64() + if len(withdrawals) > 0 { + log.Error("Bor does not support withdrawals", "number", headerNumber) + return + } + + if header.WithdrawalsHash != nil { + log.Error("Bor does not support withdrawalHash", "number", headerNumber) + return + } + if IsSprintStart(headerNumber, c.config.CalculateSprint(headerNumber)) { ctx := context.Background() cx := statefull.ChainContext{Chain: chain, Bor: c} @@ -892,6 +902,10 @@ func (c *Bor) FinalizeAndAssemble(ctx context.Context, chain consensus.ChainHead return nil, errors.New("Bor does not support withdrawals") } + if header.WithdrawalsHash != nil { + return nil, errors.New("Bor does not support withdrawalHash") + } + stateSyncData := []*types.StateSyncData{} headerNumber := header.Number.Uint64()