Skip to content

Commit

Permalink
Merge pull request #1049 from maticnetwork/shivam/POS-1733-2
Browse files Browse the repository at this point in the history
chg : withdrawals check in bor consensus
  • Loading branch information
temaniarpit27 authored Oct 17, 2023
2 parents 3d8ee19 + e8939bc commit f957755
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions consensus/bor/bor.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}

Check warning on line 822 in consensus/bor/bor.go

View check run for this annotation

Codecov / codecov/patch

consensus/bor/bor.go#L820-L822

Added lines #L820 - L822 were not covered by tests

if header.WithdrawalsHash != nil {
log.Error("Bor does not support withdrawalHash", "number", headerNumber)
return
}

Check warning on line 827 in consensus/bor/bor.go

View check run for this annotation

Codecov / codecov/patch

consensus/bor/bor.go#L825-L827

Added lines #L825 - L827 were not covered by tests

if IsSprintStart(headerNumber, c.config.CalculateSprint(headerNumber)) {
ctx := context.Background()
cx := statefull.ChainContext{Chain: chain, Bor: c}
Expand Down Expand Up @@ -892,6 +902,10 @@ func (c *Bor) FinalizeAndAssemble(ctx context.Context, chain consensus.ChainHead
return nil, errors.New("Bor does not support withdrawals")
}

Check warning on line 903 in consensus/bor/bor.go

View check run for this annotation

Codecov / codecov/patch

consensus/bor/bor.go#L901-L903

Added lines #L901 - L903 were not covered by tests

if header.WithdrawalsHash != nil {
return nil, errors.New("Bor does not support withdrawalHash")
}

Check warning on line 907 in consensus/bor/bor.go

View check run for this annotation

Codecov / codecov/patch

consensus/bor/bor.go#L905-L907

Added lines #L905 - L907 were not covered by tests

stateSyncData := []*types.StateSyncData{}

headerNumber := header.Number.Uint64()
Expand Down

0 comments on commit f957755

Please sign in to comment.