chg : withdrawals check in bor consensus

This commit is contained in:
Shivam Sharma 2023-10-17 12:43:58 +05:30
parent 808c41d7a8
commit e8939bc12e

View file

@ -816,6 +816,16 @@ func (c *Bor) Finalize(chain consensus.ChainHeaderReader, header *types.Header,
headerNumber := header.Number.Uint64() 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)) { if IsSprintStart(headerNumber, c.config.CalculateSprint(headerNumber)) {
ctx := context.Background() ctx := context.Background()
cx := statefull.ChainContext{Chain: chain, Bor: c} 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") 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{} stateSyncData := []*types.StateSyncData{}
headerNumber := header.Number.Uint64() headerNumber := header.Number.Uint64()