Skip to content

Commit

Permalink
Add eth_blobBaseFee; add blobs to eth_feeHistory (#486)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
flcl42 and lightclient committed Feb 16, 2024
1 parent d79298e commit 4b225e0
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
20 changes: 20 additions & 0 deletions src/eth/fee_market.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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: []
Expand Down Expand Up @@ -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.
Expand Down
2 changes: 2 additions & 0 deletions tests/eth_blobGasPrice/blob-gas-price.io
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
>> {"jsonrpc":"2.0","id":1,"method":"eth_blobBaseFee","params":[]}
<< {"jsonrpc":"2.0","id":1,"result":"0x1"}
2 changes: 1 addition & 1 deletion tests/eth_feeHistory/fee-history.io
Original file line number Diff line number Diff line change
@@ -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]}}

0 comments on commit 4b225e0

Please sign in to comment.