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

eth.getBlock() JSON Fields Unavailable in v4.6, yet Available in v1.9 #6933

Closed
ymonye opened this issue Mar 25, 2024 · 4 comments
Closed

eth.getBlock() JSON Fields Unavailable in v4.6, yet Available in v1.9 #6933

ymonye opened this issue Mar 25, 2024 · 4 comments
Assignees
Labels
4.x 4.0 related Bug Addressing a bug

Comments

@ymonye
Copy link
Contributor

ymonye commented Mar 25, 2024

Hi all,

I'm in the process of migrating our tools from Web3JS v1.9.0 to v4.6.0. I'd noticed eth.getBlock() on v4 returns less fields than on v1, specifically blobGasUsed, excessBlobGas, and others. This is while pointed to the same Ethereum Mainnet Go-Ethereum archive node, and confirmed a CURL command direct to the GETH node provides those extra values.

Is there an extra parameter to send to eth.getBlock, in order to view all data?

Below is the JSON response pointed to the same node, for block 19513177, using Web3JS v1.9 & v4.6.

Web3JS v1.9.0:
https://pastebin.com/q4XXcfh1

Web3JS v4.6.0:
https://pastebin.com/tEd2bLYK

==========

EDIT: Was initially on Web3JS v4.4, upgraded to v4.6 and the problem persists.

@ymonye ymonye changed the title eth.getBlock() JSON Fields Unavailable in v4.4, yet Available in v1.9 eth.getBlock() JSON Fields Unavailable in v4.6, yet Available in v1.9 Mar 25, 2024
@SantiagoDevRel SantiagoDevRel added the 4.x 4.0 related label Mar 25, 2024
@SantiagoDevRel
Copy link
Member

Hey @ymonye thanks for pointing this out, we'll give provide an answer by tomorrow!

@luu-alex
Copy link
Contributor

luu-alex commented Mar 26, 2024

Hey there! @ymonye we format our responses for our rpc methods and it seems like we need to update the response for the blobs from eip-4844, we'll create PR for this. Thanks for bringing this to our attention :)

@ymonye
Copy link
Contributor Author

ymonye commented Mar 26, 2024

Hey there! @ymonye we format our responses for our rpc methods and it seems like we need to update the response for the blobs from eip-4844, we'll create PR for this. Thanks for bringing this to our attention :)

Thanks @luu-alex! I'd started some of that work on my end to see those changes reflected within my NodeJS ESM code. This was from initially modifying my local node_modules files: eth_types.js, rpc_methods_wrappers.js, & schemas.js.

Afterwards I'd forked the web3.js repo to make the same edits within those Typescript files, yet I however have no idea how to import the the ESM module from the forked web3.js repo into my package. Other than that, please review whenever you get a chance.

I'll continue comparing & contrasting our code which is still reliant on web3.js v1.9 to v4, and will update you guys (or open more pull requests) if there's anything amiss.

@luu-alex
Copy link
Contributor

Afterwards I'd forked the web3.js repo to make the same edits within those Typescript files, yet I however have no idea how to import the the ESM module from the forked web3.js repo into my package. Other than that, please review whenever you get a chance.

To test this in a local project and using a local copy of web3js:
Are you using npm or yarn? You'll have to build after you create your changes so running yarn build in the root of the pacakge.
In the web3.js/package/web3 project, you can use npm link and it'll create a local node_module package for web3 that you can use in your local project. Running npm link web3 in your local project would create a copy that you can test.

Thank you for creating a PR! I'll take a look into this shortly, and we appreciate that you found this issue :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4.x 4.0 related Bug Addressing a bug
Projects
None yet
Development

No branches or pull requests

5 participants