Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add eth_blobBaseFee; add blobs to eth_feeHistory #486

Merged
merged 5 commits into from
Feb 16, 2024

Conversation

flcl42
Copy link
Contributor

@flcl42 flcl42 commented Nov 7, 2023

Blob gas price oracle and historical API

Makes sending blob more convenient. Notes and prototype

Add eth_blobBaseFee

A new method that returns blob gas price prediction

Update for eth_feeHistory

Add two fields related to blob gas

  • Base fee per blob gas series
  • Blob gas used ratio

Copy link
Member

@lightclient lightclient left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this! The changes to eth_feeHistory look good, but I'm not sure about the new method eth_gasPrices.

src/eth/fee_market.yaml Outdated Show resolved Hide resolved
@lightclient
Copy link
Member

Another thought on eth_gasPrices, the value gasPrice is really a legacy value for legacy txs. I don't think we should be adding new methods using it.

@flcl42
Copy link
Contributor Author

flcl42 commented Nov 8, 2023

Another thought on eth_gasPrices, the value gasPrice is really a legacy value for legacy txs. I don't think we should be adding new methods using it.

is there a better way of calculating max_fee_per_gas for eip-1559 txs?

Copy link

@w3github w3github left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why is it yaml?

@flcl42
Copy link
Contributor Author

flcl42 commented Nov 27, 2023

@flcl42 @lightclient I am pro for adding gasPrice and maxPriorityFeePerGas value, libraries like ethers.js call eth_getBlock, eth_gasPrice and eth_maxPriorityFeePerGas to determine EIP-1559 compatible transaction fees and it would be great to have a call that would do it all ( See the code here https://github.com/ethers-io/ethers.js/pull/4463/files#diff-0cd3541ddf16280f37de4cee3b994f2f6c4e000568a37c919d5b1e62f74be872R902 )

Of course adding a dedicated RPC method for retrieving eth_blobGasPrice would be great as a backup.

Let's start with simpler approach and see how convenient may be to have just that separate method for now.

@flcl42
Copy link
Contributor Author

flcl42 commented Nov 27, 2023

why is it yaml?

Do you mean json might work better?

@flcl42 flcl42 marked this pull request as ready for review November 27, 2023 10:42
@flcl42 flcl42 changed the title Add eth_gasPrices; add blobs to eth_feeHistory Add eth_blobGasPrice; add blobs to eth_feeHistory Nov 27, 2023
@lightclient
Copy link
Member

is there a better way of calculating max_fee_per_gas for eip-1559 txs?

base fee of parent * small multiple like 1.25 + result of eth_maxPriorityFeePerGas

@flcl42 flcl42 changed the title Add eth_blobGasPrice; add blobs to eth_feeHistory Add eth_blobBaseFee; add blobs to eth_feeHistory Jan 18, 2024
@ryanschneider
Copy link

lgtm! I asked on Discord but does the rename to "blob base fee" in ethereum/EIPs#8095 mean we need to update any other 4844 RPC field names (e.g. maxFeePerBlobGas, etc.). I cursory scan says no but wanted to mention it here in case I missed anything.

@jxom
Copy link

jxom commented Jan 31, 2024

Curious what are the next steps for this PR?

Copy link
Member

@lightclient lightclient left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should be ratio of blobGasUsed and the limit for blobs isn't defined in the api currently, but we can use same naming as the EIP which is "max blob gas per block".

src/eth/fee_market.yaml Outdated Show resolved Hide resolved
Copy link
Contributor

@Rjected Rjected left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Both APIs look good, we should be able to support eth_blobBaseFee easily and already support the additional blob fields in feeHistory

Co-authored-by: lightclient <14004106+lightclient@users.noreply.github.com>
@Gabriel-Trintinalia
Copy link

looks good!

@fvictorio
Copy link

I know this has been merged already, but I wonder why this method doesn't accept a block tag?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

10 participants