From 0f75d798ddfc60defee09f6ec31631582ec96590 Mon Sep 17 00:00:00 2001 From: Alexey Osipov Date: Tue, 7 Nov 2023 19:05:31 +0300 Subject: [PATCH 1/4] Add eth_gasPrices; add blobs to eth_feeHistory --- src/eth/fee_market.yaml | 34 +++++++++++++++++++++ tests/eth_gasPrices/gas-prices-blockhash.io | 2 ++ tests/eth_gasPrices/gas-prices.io | 2 ++ 3 files changed, 38 insertions(+) create mode 100644 tests/eth_gasPrices/gas-prices-blockhash.io create mode 100644 tests/eth_gasPrices/gas-prices.io diff --git a/src/eth/fee_market.yaml b/src/eth/fee_market.yaml index f45a43967..5a578a8ef 100644 --- a/src/eth/fee_market.yaml +++ b/src/eth/fee_market.yaml @@ -6,6 +6,28 @@ schema: title: Gas price $ref: '#/components/schemas/uint' +- name: eth_gasPrices + summary: Returns the current prices for regular, blob gas and maxPriorityFee in wei. + params: [] + result: + name: gasPricesResult + description: Prices of regular and blob gas along with priority fee + schema: + title: gasPricesResults + type: object + required: + - gasPrices + additionalProperties: false + properties: + gas: + title: Gas Price + $ref: '#/components/schemas/uint' + blobGas: + title: Blob gas price + $ref: '#/components/schemas/uint' + maxPriority: + description: Max priority fee per gas + $ref: '#/components/schemas/uint' - name: eth_maxPriorityFeePerGas summary: Returns the current maxPriorityFeePerGas per gas in wei. params: [] @@ -61,12 +83,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 gasUsed and gasLimit. + 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_gasPrices/gas-prices-blockhash.io b/tests/eth_gasPrices/gas-prices-blockhash.io new file mode 100644 index 000000000..f14bdbbe6 --- /dev/null +++ b/tests/eth_gasPrices/gas-prices-blockhash.io @@ -0,0 +1,2 @@ +>> {"jsonrpc":"2.0","id":1,"method":"eth_gasPrices"]} +<< {"jsonrpc":"2.0","id":1,"result":{"gas":"0x7","blobGas":"0x1","maxPriorityFee":"0x2"}} diff --git a/tests/eth_gasPrices/gas-prices.io b/tests/eth_gasPrices/gas-prices.io new file mode 100644 index 000000000..33adc4393 --- /dev/null +++ b/tests/eth_gasPrices/gas-prices.io @@ -0,0 +1,2 @@ +>> {"jsonrpc":"2.0","id":1,"method":"eth_getBalance","params":["0xaa00000000000000000000000000000000000000","latest"]} +<< {"jsonrpc":"2.0","id":1,"result":"0x1"} From 523cab104f45208da7909bc699e9e40ef925e02c Mon Sep 17 00:00:00 2001 From: Alexey Osipov Date: Mon, 27 Nov 2023 13:14:55 +0300 Subject: [PATCH 2/4] eth_blobGasPrice instead of eth_gasPrices --- src/eth/fee_market.yaml | 24 +++++---------------- tests/eth_blobGasPrice/blob-gas-price.io | 2 ++ tests/eth_feeHistory/fee-history.io | 2 +- tests/eth_gasPrices/gas-prices-blockhash.io | 2 -- tests/eth_gasPrices/gas-prices.io | 2 -- 5 files changed, 8 insertions(+), 24 deletions(-) create mode 100644 tests/eth_blobGasPrice/blob-gas-price.io delete mode 100644 tests/eth_gasPrices/gas-prices-blockhash.io delete mode 100644 tests/eth_gasPrices/gas-prices.io diff --git a/src/eth/fee_market.yaml b/src/eth/fee_market.yaml index 5a578a8ef..a2dddff1c 100644 --- a/src/eth/fee_market.yaml +++ b/src/eth/fee_market.yaml @@ -6,28 +6,14 @@ schema: title: Gas price $ref: '#/components/schemas/uint' -- name: eth_gasPrices - summary: Returns the current prices for regular, blob gas and maxPriorityFee in wei. +- name: eth_blobGasPrice + summary: Returns the current price per blob gas in wei. params: [] result: - name: gasPricesResult - description: Prices of regular and blob gas along with priority fee + name: Blob gas price schema: - title: gasPricesResults - type: object - required: - - gasPrices - additionalProperties: false - properties: - gas: - title: Gas Price - $ref: '#/components/schemas/uint' - blobGas: - title: Blob gas price - $ref: '#/components/schemas/uint' - maxPriority: - description: Max priority fee per gas - $ref: '#/components/schemas/uint' + title: Blob gas price + $ref: '#/components/schemas/uint' - name: eth_maxPriorityFeePerGas summary: Returns the current maxPriorityFeePerGas per gas in wei. params: [] diff --git a/tests/eth_blobGasPrice/blob-gas-price.io b/tests/eth_blobGasPrice/blob-gas-price.io new file mode 100644 index 000000000..63be84c04 --- /dev/null +++ b/tests/eth_blobGasPrice/blob-gas-price.io @@ -0,0 +1,2 @@ +>> {"jsonrpc":"2.0","id":1,"method":"eth_blobGasPrice","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 ed112a570..d038d9d81 100644 --- a/tests/eth_feeHistory/fee-history.io +++ b/tests/eth_feeHistory/fee-history.io @@ -1,2 +1,2 @@ >> {"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":["0x2db08786","0x2806be9d"],"gasUsedRatio":[0.0042]}} +<< {"jsonrpc":"2.0","id":1,"result":{"oldestBlock":"0x2","reward":[["0x1","0x1"]],"baseFeePerBlobGas":["0x1","0x2"],"baseFeePerGas":["0x2db08786","0x2806be9d"],"blobGasUsedRatio":[0.5],"gasUsedRatio":[0.0042]}} diff --git a/tests/eth_gasPrices/gas-prices-blockhash.io b/tests/eth_gasPrices/gas-prices-blockhash.io deleted file mode 100644 index f14bdbbe6..000000000 --- a/tests/eth_gasPrices/gas-prices-blockhash.io +++ /dev/null @@ -1,2 +0,0 @@ ->> {"jsonrpc":"2.0","id":1,"method":"eth_gasPrices"]} -<< {"jsonrpc":"2.0","id":1,"result":{"gas":"0x7","blobGas":"0x1","maxPriorityFee":"0x2"}} diff --git a/tests/eth_gasPrices/gas-prices.io b/tests/eth_gasPrices/gas-prices.io deleted file mode 100644 index 33adc4393..000000000 --- a/tests/eth_gasPrices/gas-prices.io +++ /dev/null @@ -1,2 +0,0 @@ ->> {"jsonrpc":"2.0","id":1,"method":"eth_getBalance","params":["0xaa00000000000000000000000000000000000000","latest"]} -<< {"jsonrpc":"2.0","id":1,"result":"0x1"} From 3d8b5ed6e597c2da1f97c0a28bc963ff54239e98 Mon Sep 17 00:00:00 2001 From: Alexey Osipov Date: Thu, 18 Jan 2024 19:31:58 +0300 Subject: [PATCH 3/4] Rename blobGasPrice to blobBaseFee --- src/eth/fee_market.yaml | 8 ++++---- tests/eth_blobGasPrice/blob-gas-price.io | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/eth/fee_market.yaml b/src/eth/fee_market.yaml index a2dddff1c..dbc4cdca0 100644 --- a/src/eth/fee_market.yaml +++ b/src/eth/fee_market.yaml @@ -6,13 +6,13 @@ schema: title: Gas price $ref: '#/components/schemas/uint' -- name: eth_blobGasPrice - summary: Returns the current price per blob gas in wei. +- name: eth_blobBaseFee + summary: Returns the base fee per blob gas in wei. params: [] result: - name: Blob gas price + name: Blob gas base fee schema: - title: Blob gas price + title: Blob gas base fee $ref: '#/components/schemas/uint' - name: eth_maxPriorityFeePerGas summary: Returns the current maxPriorityFeePerGas per gas in wei. diff --git a/tests/eth_blobGasPrice/blob-gas-price.io b/tests/eth_blobGasPrice/blob-gas-price.io index 63be84c04..b87966b73 100644 --- a/tests/eth_blobGasPrice/blob-gas-price.io +++ b/tests/eth_blobGasPrice/blob-gas-price.io @@ -1,2 +1,2 @@ ->> {"jsonrpc":"2.0","id":1,"method":"eth_blobGasPrice","params":[]} +>> {"jsonrpc":"2.0","id":1,"method":"eth_blobBaseFee","params":[]} << {"jsonrpc":"2.0","id":1,"result":"0x1"} From c506d6cb07e22d5692d186fbfaf5f432ace8c3cb Mon Sep 17 00:00:00 2001 From: Alexey Date: Thu, 15 Feb 2024 20:02:39 +0300 Subject: [PATCH 4/4] Update src/eth/fee_market.yaml Co-authored-by: lightclient <14004106+lightclient@users.noreply.github.com> --- src/eth/fee_market.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/eth/fee_market.yaml b/src/eth/fee_market.yaml index dbc4cdca0..1ee5865bc 100644 --- a/src/eth/fee_market.yaml +++ b/src/eth/fee_market.yaml @@ -83,7 +83,7 @@ $ref: '#/components/schemas/ratio' blobGasUsedRatio: title: blobGasUsedRatio - description: An array of block blob gas used ratios. These are calculated as the ratio of gasUsed and gasLimit. + 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'