From 3240fb478bc4d520414aa686b46c8cb864908566 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?P=C3=A9ter=20Szil=C3=A1gyi?= Date: Thu, 25 May 2023 10:16:42 +0300 Subject: [PATCH] consensus/misc: tiny optimizations Co-authored-by: Martin Holst Swende --- consensus/misc/eip4844.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/consensus/misc/eip4844.go b/consensus/misc/eip4844.go index 7bbc69471e21..041605dd0f9f 100644 --- a/consensus/misc/eip4844.go +++ b/consensus/misc/eip4844.go @@ -73,9 +73,9 @@ func CalcExcessDataGas(parentExcessDataGas *big.Int, blobs int) *big.Int { targetGas := big.NewInt(params.BlobTxTargetDataGasPerBlock) if excessDataGas.Cmp(targetGas) < 0 { - return new(big.Int) + return excessDataGas.SetUint64(0) } - return new(big.Int).Sub(excessDataGas, targetGas) + return excessDataGas.Sub(excessDataGas, targetGas) } // CalcBlobFee calculates the blobfee from the header's excess data gas field.