diff --git a/hive_integration/nodocker/engine/cancun/helpers.nim b/hive_integration/nodocker/engine/cancun/helpers.nim index 6b80e8c26..3a1f1dbfa 100644 --- a/hive_integration/nodocker/engine/cancun/helpers.nim +++ b/hive_integration/nodocker/engine/cancun/helpers.nim @@ -46,7 +46,7 @@ func getMinExcessBlobGasForBlobGasPrice(data_gas_price: uint64): uint64 = while current_data_gas_price < data_gas_price: current_excess_data_gas += GAS_PER_BLOB.uint64 - current_data_gas_price = getBlobGasPrice(current_excess_data_gas).truncate(uint64) + current_data_gas_price = getBlobBaseFee(current_excess_data_gas).truncate(uint64) return current_excess_data_gas diff --git a/hive_integration/nodocker/engine/cancun/step_newpayloads.nim b/hive_integration/nodocker/engine/cancun/step_newpayloads.nim index a796f94d3..d906101cc 100644 --- a/hive_integration/nodocker/engine/cancun/step_newpayloads.nim +++ b/hive_integration/nodocker/engine/cancun/step_newpayloads.nim @@ -1,5 +1,5 @@ # Nimbus -# Copyright (c) 2023 Status Research & Development GmbH +# Copyright (c) 2023-2024 Status Research & Development GmbH # Licensed under either of # * Apache License, version 2.0, ([LICENSE-APACHE](LICENSE-APACHE) or # http://www.apache.org/licenses/LICENSE-2.0) @@ -96,7 +96,7 @@ proc verifyPayload(step: NewPayloads, var totalBlobCount = 0 - expectedBlobGasPrice = getBlobGasPrice(expectedExcessBlobGas) + expectedBlobGasPrice = getBlobBaseFee(expectedExcessBlobGas) for tx in blobTxsInPayload: let blobCount = tx.versionedHashes.len diff --git a/nimbus/core/eip4844.nim b/nimbus/core/eip4844.nim index bd2007415..03fa56e63 100644 --- a/nimbus/core/eip4844.nim +++ b/nimbus/core/eip4844.nim @@ -113,8 +113,8 @@ proc getTotalBlobGas*(tx: Transaction): uint64 = proc getTotalBlobGas*(versionedHashesLen: int): uint64 = GAS_PER_BLOB * versionedHashesLen.uint64 -# getBlobGasPrice implements get_data_gas_price from EIP-4844 -func getBlobGasPrice*(excessBlobGas: uint64): UInt256 = +# getBlobBaseFee implements get_data_gas_price from EIP-4844 +func getBlobBaseFee*(excessBlobGas: uint64): UInt256 = fakeExponential( MIN_BLOB_GASPRICE.u256, excessBlobGas.u256, @@ -124,7 +124,7 @@ func getBlobGasPrice*(excessBlobGas: uint64): UInt256 = proc calcDataFee*(versionedHashesLen: int, excessBlobGas: uint64): UInt256 = getTotalBlobGas(versionedHashesLen).u256 * - getBlobGasPrice(excessBlobGas) + getBlobBaseFee(excessBlobGas) func blobGasUsed(txs: openArray[Transaction]): uint64 = for tx in txs: diff --git a/nimbus/core/tx_pool/tx_tasks/tx_classify.nim b/nimbus/core/tx_pool/tx_tasks/tx_classify.nim index aca01642f..49a1a77a6 100644 --- a/nimbus/core/tx_pool/tx_tasks/tx_classify.nim +++ b/nimbus/core/tx_pool/tx_tasks/tx_classify.nim @@ -116,7 +116,7 @@ proc txFeesCovered(xp: TxPoolRef; item: TxItemRef): bool = if item.tx.txType >= TxEip4844: let excessBlobGas = xp.chain.excessBlobGas - blobGasPrice = getBlobGasPrice(excessBlobGas) + blobGasPrice = getBlobBaseFee(excessBlobGas) if item.tx.maxFeePerBlobGas < blobGasPrice: debug "invalid tx: maxFeePerBlobGas smaller than blobGasPrice", maxFeePerBlobGas=item.tx.maxFeePerBlobGas, diff --git a/nimbus/core/validate.nim b/nimbus/core/validate.nim index 29b4e4d85..b45ca5b87 100644 --- a/nimbus/core/validate.nim +++ b/nimbus/core/validate.nim @@ -362,7 +362,7 @@ proc validateTransaction*( if tx.txType >= TxEip4844: # ensure that the user was willing to at least pay the current data gasprice - let blobGasPrice = getBlobGasPrice(excessBlobGas) + let blobGasPrice = getBlobBaseFee(excessBlobGas) if tx.maxFeePerBlobGas < blobGasPrice: return err("invalid tx: maxFeePerBlobGas smaller than blobGasPrice. " & "maxFeePerBlobGas=$1, blobGasPrice=$2" % [$tx.maxFeePerBlobGas, $blobGasPrice]) diff --git a/nimbus/rpc/rpc_utils.nim b/nimbus/rpc/rpc_utils.nim index 839848e14..6cc70e1c0 100644 --- a/nimbus/rpc/rpc_utils.nim +++ b/nimbus/rpc/rpc_utils.nim @@ -300,4 +300,4 @@ proc populateReceipt*(receipt: Receipt, gasUsed: GasInt, tx: Transaction, if tx.txType == TxEip4844: result.blobGasUsed = some(w3Qty(tx.versionedHashes.len.uint64 * GAS_PER_BLOB.uint64)) - result.blobGasPrice = some(getBlobGasPrice(header.excessBlobGas.get(0'u64))) + result.blobGasPrice = some(getBlobBaseFee(header.excessBlobGas.get(0'u64))) diff --git a/nimbus/transaction/call_common.nim b/nimbus/transaction/call_common.nim index 5dc8e91e4..cea0573df 100644 --- a/nimbus/transaction/call_common.nim +++ b/nimbus/transaction/call_common.nim @@ -134,7 +134,7 @@ proc setupHost(call: CallParams): TransactionHost = origin : call.origin.get(call.sender), gasPrice : call.gasPrice, versionedHashes: call.versionedHashes, - blobBaseFee : getBlobGasPrice(vmState.blockCtx.excessBlobGas), + blobBaseFee : getBlobBaseFee(vmState.blockCtx.excessBlobGas), ), forkOverride = call.forkOverride )