Skip to content

Commit 446fdeb

Browse files
authored
consensus/ethash: fix blob gas error message formatting (#33300)
Fixes error messages to print the actual blob gas value instead of the pointer address by dereferencing `ExcessBlobGas`, `BlobGasUsed` and `ParentBeaconRoot`.
1 parent b3b46ce commit 446fdeb

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

consensus/ethash/consensus.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -278,11 +278,11 @@ func (ethash *Ethash) verifyHeader(chain consensus.ChainHeaderReader, header, pa
278278
// Verify the non-existence of cancun-specific header fields
279279
switch {
280280
case header.ExcessBlobGas != nil:
281-
return fmt.Errorf("invalid excessBlobGas: have %d, expected nil", header.ExcessBlobGas)
281+
return fmt.Errorf("invalid excessBlobGas: have %d, expected nil", *header.ExcessBlobGas)
282282
case header.BlobGasUsed != nil:
283-
return fmt.Errorf("invalid blobGasUsed: have %d, expected nil", header.BlobGasUsed)
283+
return fmt.Errorf("invalid blobGasUsed: have %d, expected nil", *header.BlobGasUsed)
284284
case header.ParentBeaconRoot != nil:
285-
return fmt.Errorf("invalid parentBeaconRoot, have %#x, expected nil", header.ParentBeaconRoot)
285+
return fmt.Errorf("invalid parentBeaconRoot, have %#x, expected nil", *header.ParentBeaconRoot)
286286
}
287287
// Add some fake checks for tests
288288
if ethash.fakeDelay != nil {

0 commit comments

Comments
 (0)