From 4b225e0d273e92982b2c539d63eaaa756c5285a4 Mon Sep 17 00:00:00 2001 From: Alexey Date: Fri, 16 Feb 2024 22:37:59 +0300 Subject: [PATCH] Add eth_blobBaseFee; add blobs to eth_feeHistory (#486) * Add eth_gasPrices; add blobs to eth_feeHistory * eth_blobGasPrice instead of eth_gasPrices * Rename blobGasPrice to blobBaseFee * Update src/eth/fee_market.yaml Co-authored-by: lightclient <14004106+lightclient@users.noreply.github.com> --------- Co-authored-by: lightclient <14004106+lightclient@users.noreply.github.com> --- src/eth/fee_market.yaml | 20 ++++++++++++++++++++ tests/eth_blobGasPrice/blob-gas-price.io | 2 ++ tests/eth_feeHistory/fee-history.io | 2 +- 3 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 tests/eth_blobGasPrice/blob-gas-price.io diff --git a/src/eth/fee_market.yaml b/src/eth/fee_market.yaml index f45a43967..1ee5865bc 100644 --- a/src/eth/fee_market.yaml +++ b/src/eth/fee_market.yaml @@ -6,6 +6,14 @@ schema: title: Gas price $ref: '#/components/schemas/uint' +- name: eth_blobBaseFee + summary: Returns the base fee per blob gas in wei. + params: [] + result: + name: Blob gas base fee + schema: + title: Blob gas base fee + $ref: '#/components/schemas/uint' - name: eth_maxPriorityFeePerGas summary: Returns the current maxPriorityFeePerGas per gas in wei. params: [] @@ -61,12 +69,24 @@ type: array items: $ref: '#/components/schemas/uint' + baseFeePerBlobGas: + title: baseFeePerBlobGasArray + description: An array of block base fees per blob gas. This includes the next block after the newest of the returned range, because this value can be derived from the newest block. Zeroes are returned for pre-EIP-4844 blocks. + type: array + items: + $ref: '#/components/schemas/uint' gasUsedRatio: title: gasUsedRatio description: An array of block gas used ratios. These are calculated as the ratio of gasUsed and gasLimit. type: array items: $ref: '#/components/schemas/ratio' + blobGasUsedRatio: + title: blobGasUsedRatio + description: An array of block blob gas used ratios. These are calculated as the ratio of blobGasUsed and the max blob gas per block. + type: array + items: + $ref: '#/components/schemas/ratio' reward: title: rewardArray description: A two-dimensional array of effective priority fees per gas at the requested block percentiles. diff --git a/tests/eth_blobGasPrice/blob-gas-price.io b/tests/eth_blobGasPrice/blob-gas-price.io new file mode 100644 index 000000000..b87966b73 --- /dev/null +++ b/tests/eth_blobGasPrice/blob-gas-price.io @@ -0,0 +1,2 @@ +>> {"jsonrpc":"2.0","id":1,"method":"eth_blobBaseFee","params":[]} +<< {"jsonrpc":"2.0","id":1,"result":"0x1"} diff --git a/tests/eth_feeHistory/fee-history.io b/tests/eth_feeHistory/fee-history.io index 7eb6898bf..352bb6d2a 100644 --- a/tests/eth_feeHistory/fee-history.io +++ b/tests/eth_feeHistory/fee-history.io @@ -1,3 +1,3 @@ // gets fee history information >> {"jsonrpc":"2.0","id":1,"method":"eth_feeHistory","params":["0x1","0x2",[95,99]]} -<< {"jsonrpc":"2.0","id":1,"result":{"oldestBlock":"0x2","reward":[["0x1","0x1"]],"baseFeePerGas":["0x2dbf1f99","0x281d620d"],"gasUsedRatio":[0.007565458319646006]}} +<< {"jsonrpc":"2.0","id":1,"result":{"oldestBlock":"0x2","reward":[["0x1","0x1"]],"baseFeePerBlobGas":["0x1","0x2"],"baseFeePerGas":["0x2dbf1f99","0x281d620d"],"blobGasUsedRatio":[0.5],"gasUsedRatio":[0.007565458319646006]}}