From d5e7b2df854192c4bd066920d72c7e00411d71c8 Mon Sep 17 00:00:00 2001 From: buddh0 Date: Mon, 18 Mar 2024 15:23:45 +0800 Subject: [PATCH] fix: Withdrawals turn into empty from nil when BlockBody has Sidecars --- core/block_validator.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/block_validator.go b/core/block_validator.go index eb04297844..2df060644d 100644 --- a/core/block_validator.go +++ b/core/block_validator.go @@ -104,7 +104,7 @@ func (v *BlockValidator) ValidateBody(block *types.Block) error { if hash := types.DeriveSha(block.Withdrawals(), trie.NewStackTrie(nil)); hash != *header.WithdrawalsHash { return fmt.Errorf("withdrawals root hash mismatch (header value %x, calculated %x)", *header.WithdrawalsHash, hash) } - } else if block.Withdrawals() != nil { + } else if len(block.Withdrawals()) != 0 { // Withdrawals turn into empty from nil when BlockBody has Sidecars // Withdrawals are not allowed prior to shanghai fork return errors.New("withdrawals present in block body") }