@@ -172,12 +172,6 @@ func encodeSigHeader(w io.Writer, header *types.Header, c *params.BorConfig) {
172172 }
173173 }
174174
175- if header .WithdrawalsHash != nil {
176- header .WithdrawalsHash = nil
177-
178- log .Warn ("Bor does not support withdrawals" , "number" , header .Number )
179- }
180-
181175 if err := rlp .Encode (w , enc ); err != nil {
182176 panic ("can't encode: " + err .Error ())
183177 }
@@ -387,11 +381,14 @@ func (c *Bor) verifyHeader(chain consensus.ChainHeaderReader, header *types.Head
387381
388382 // Verify that the gas limit is <= 2^63-1
389383 gasCap := uint64 (0x7fffffffffffffff )
390-
391384 if header .GasLimit > gasCap {
392385 return fmt .Errorf ("invalid gasLimit: have %v, max %v" , header .GasLimit , gasCap )
393386 }
394387
388+ if header .WithdrawalsHash != nil {
389+ return consensus .ErrUnexpectedWithdrawals
390+ }
391+
395392 // All basic checks passed, verify cascading fields
396393 return c .verifyCascadingFields (chain , header , parents )
397394}
@@ -823,10 +820,7 @@ func (c *Bor) Finalize(chain consensus.ChainHeaderReader, header *types.Header,
823820 headerNumber := header .Number .Uint64 ()
824821
825822 if withdrawals != nil || header .WithdrawalsHash != nil {
826- // withdrawals = nil is not required because withdrawals are not used
827- header .WithdrawalsHash = nil
828-
829- log .Warn ("Bor does not support withdrawals" , "number" , headerNumber )
823+ return
830824 }
831825
832826 if IsSprintStart (headerNumber , c .config .CalculateSprint (headerNumber )) {
@@ -904,10 +898,7 @@ func (c *Bor) FinalizeAndAssemble(ctx context.Context, chain consensus.ChainHead
904898 headerNumber := header .Number .Uint64 ()
905899
906900 if withdrawals != nil || header .WithdrawalsHash != nil {
907- // withdrawals != nil not required because withdrawals are not used
908- header .WithdrawalsHash = nil
909-
910- log .Warn ("Bor does not support withdrawals" , "number" , headerNumber )
901+ return nil , consensus .ErrUnexpectedWithdrawals
911902 }
912903
913904 stateSyncData := []* types.StateSyncData {}
0 commit comments