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

EIP-4844: Add blob details to Block class #4570

Closed
sealer3 opened this issue Feb 2, 2024 · 11 comments
Closed

EIP-4844: Add blob details to Block class #4570

sealer3 opened this issue Feb 2, 2024 · 11 comments
Labels
enhancement New feature or improvement. fixed/complete This Bug is fixed or Enhancement is complete and published. minor-bump Planned for the next minor version bump. v6 Issues regarding v6

Comments

@sealer3
Copy link

sealer3 commented Feb 2, 2024

Describe the Feature

In addition to blob transactions (added with #4554), EIP-4844 adds blob_gas_used and excess_blob_gas to block headers. Ethers should allow these to be accessible from the Block class.

Code Example

const block = await provider.getBlock();

// These would return null if the fork has not yet happened
console.log(block.blobGasUsed);
console.log(block.excessBlobGas);
@sealer3 sealer3 added the enhancement New feature or improvement. label Feb 2, 2024
@ricmoo
Copy link
Member

ricmoo commented Feb 2, 2024

This will come in the near future with the sidecar support. But thanks for opening a ticket to track this too.

Also, the fields will need to be added to the TransactionResponse and TransactionReceipt.

If you have any links to BLOb transactions on Sepolia, that would be quite useful too.

Currently, the Transaction object has live fields for the EIP-4844 fields, and support for serializing and inference but will need to add the ability to attach the kzg operations.

@ricmoo ricmoo added on-deck This Enhancement or Bug is currently being worked on. minor-bump Planned for the next minor version bump. v6 Issues regarding v6 labels Feb 2, 2024
@sealer3
Copy link
Author

sealer3 commented Feb 2, 2024

Sure, here's a few type-3 transactions on Sepolia:
0x0f8c63e3c10157c3aceddcbfbed059067e3ad50c96184d2f3bc327f737bc736e (1 blobVersionedHash)
0x56702af308f7608e00d6160732820aee4134e27d651af9a975ecd8a460ed183f (2 blobVersionedHashes)
0x6c4aef4c26410b1fcbf24d0148e3d66a10cb3e9ad4ca10a71782489688cdd45a (4 blobVersionedHashes)
0x6fe578aed357b111ab499cc4e35f087855cfa6b5d65546589ac459f41d3592b8 (1 blobVersionedHash)
0x5662f3daa247990d4f60fbb1bf462b9408fef8ea380e00fb4ab0e025510b358c (3 blobVersionedHashes)

@ricmoo
Copy link
Member

ricmoo commented Feb 3, 2024

Also adding a link to this issue provided by Tim Beiko: Sepolia Blobscan.

@ricmoo
Copy link
Member

ricmoo commented Feb 3, 2024

I've added the fields to the Block, TransactionResponse and TransactionReceipt. I think the kzg will be part of a future minor bump, but would love an extra set of eyes to check on the above commit. :)

@sealer3
Copy link
Author

sealer3 commented Feb 3, 2024

Thank you! The changes in that commit look correct to me.

Another Dencun thing to consider adding soon is the parentBeaconBlockRoot field to the Block object, as per https://eips.ethereum.org/EIPS/eip-4788.

@ricmoo
Copy link
Member

ricmoo commented Feb 6, 2024

Thanks! I've added it, along with receiptsRoot and stateRoot, since I'm updating the Block object anyways.

@sealer3
Copy link
Author

sealer3 commented Feb 6, 2024

Excellent, thank you! The receiptsRoot and stateRoot are under-appreciated yet so powerful.

@ricmoo
Copy link
Member

ricmoo commented Feb 6, 2024

Completely agree! Originally they weren’t included because some nodes don’t return them (Ganche and other simulation nodes), but it seems safe to add them as “possibly null” values.

I will investigate adding a type-guard too for validated Blocks. :)

@wmitsuda
Copy link

wmitsuda commented Feb 6, 2024

hello, just for the sake of completeness, this is the corresponding commit in the API specs with all the changes: ethereum/execution-apis@057892b

@ricmoo
Copy link
Member

ricmoo commented Feb 9, 2024

This has been included in v6.11.0.

Please try it out and let me know if you have any issues. :)

@ricmoo ricmoo added fixed/complete This Bug is fixed or Enhancement is complete and published. and removed on-deck This Enhancement or Bug is currently being worked on. labels Feb 9, 2024
@sealer3
Copy link
Author

sealer3 commented Feb 16, 2024

Excellent, we're now able to show these details in Otterscan block pages! Thank you again. It's working well.

@sealer3 sealer3 closed this as completed Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or improvement. fixed/complete This Bug is fixed or Enhancement is complete and published. minor-bump Planned for the next minor version bump. v6 Issues regarding v6
Projects
None yet
Development

No branches or pull requests

3 participants