-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Added EIP-4844 Headers for BlockHeaderOutput. Issue: 6933 #6937
Merged
Merged
Changes from 1 commit
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
740bd93
Added EIP-4844 Headers for BlockHeaderOutput. getBlock() now referenc…
ymonye 804ee89
Updated blockSchema & blockHeaderSchema to reflect shared properties.
ymonye ec6a4fc
Removed changes from yarn.lock.
ymonye d0a63c3
Removed author & excessDataGas from the BlockOutput interface.
ymonye 38a5b21
Separated old and new properties in the BlockOutput interface.
ymonye 8fdfa11
Moved the Withdrawals interface above BlockOutput.
ymonye File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe you would want to edit
blockSchema
and add the new properties there, not editing blockHeaderSchema and just using blockSchemaThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, yeah I'd noticed both the
withdrawals
&withdrawalsRoot
properties only appear underblockHeaderSchema
, in theschemas.ts
file. When I call getBlock() on web3.js v1.9, it outputs both of those properties. This is why I'd assumedgetBlock()
probably neededblockHeaderSchema
defined within v4'srpc_method_wrappers.ts
file instead ofblockSchema
, and thought it was a typo.Should
blockSchema
&blockHeaderSchema
have identical properties then?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yea its a bit confusing, It seems like
blockSchema
needs to also have updated properties ofwithdrawals
andwithdrawalsRoot
.blockHeaderSchema
is only being used for subscriptions. We may need to update the blockHeaderSchema as well, if you want to check and confirm result of a subscription the result you can also edit blockheaderSchema, otherwise you can focus on just updating blockSchemaThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ok, I've updated both blockSchema & blockHeaderSchema in
schemas.ts
, with blockHeaderSchema retaining the below author & excessDataGas properties while missing from blockSchema. Please let me know if blockSchema should also have these.blockSchema & blockHeaderSchema also have different nested arrays for the
transactions
property, and were left as originally found.The BlockOutput & BlockHeaderOutput interfaces in
eth_types.ts
were also updated accordingly.Under eth_types.ts, I'd noticed a number of properties are formatted as either
bigint | number
orNumbers
, whether they are defined under BlockOutput or BlockHeaderOutput.For example: totalDifficulty in BlockOutput:
readonly totalDifficulty?: bigint | number;
Whereas in BlockHeaderOutput, totalDifficulty is formatted as:
readonly totalDifficulty?: Numbers;
I'm unsure if it should be one or the other, but I've left as-is. Also the extra properties: author & excessDataGas were not added to the BlockOutput interface, as they are not present in blockSchema. However I did add everything else from BlockHeaderOutput interface into BlockOutput, while formatting the ones with
Numbers
asbigint | number
. Please advise if that was the correct move.Also, let me know if those author & excessDataGase properites should also be present across blockSchema/blockHeaderSchema & BlockOutput/BlockHeaderOutput.
yarn.lock
had its changes reverted, as well asrpc_method_wrappers.ts
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, it appears the 'newHeads' & 'newBlockHeaders' subscriptions only return formatted data from the
BlockBase
interface ineth_types.ts
, and not from theBlockHeaderOutput
interface.https://docs.web3js.org/api/web3-eth/class/NewHeadsSubscription
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Adding a note here so I don't forget after sleep. Looks like more parameters are missing from v4.6 yet present in v1.9, outside the scope of EIP-4844 changes, specifically across other
eth_*
functions. I'll do a much proper rundown thru the next couple of days, likely into the weekend.For ex: the
id
parameter is missing in thelogs
array, from eth_getTransactionReceipt. Example below from an ETH mainnet request:web3 v4.6:
{"address":"0xb584d4be1a5470ca1a8778e9b86c81e165204599","blockHash":"0x47c58ebbaaff9a9a9ee60d74029224df7cac63b5c09972d4306e7500d8078b55","blockNumber":"19529894","data":"0x0000000000000000000000000000000000000000000000000000022ecb25c000","logIndex":"469","removed":false,"topics":["0x90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a15","0x0000000000000000000000000a25e45792fef9fb600a81f0d7ac4ab9e893fc71","0x0000000000000000000000000000000000000000000000000000000000000064"],"transactionHash":"0xe2bad713807549fe3bb0bf0a69dce0ddc634c8dbec655660ea038279ef5bdb91","transactionIndex":"170"}
web3 v1.9:
{"address":"0xb584D4bE1A5470CA1a8778E9B86c81e165204599","blockHash":"0x47c58ebbaaff9a9a9ee60d74029224df7cac63b5c09972d4306e7500d8078b55","blockNumber":19529894,"data":"0x0000000000000000000000000000000000000000000000000000022ecb25c000","id":"log_ff3f9ddd","logIndex":469,"removed":false,"topics":["0x90890809c654f11d6e72a28fa60149770a0d11ec6c92319d6ceb2bb0a4ea1a15","0x0000000000000000000000000a25e45792fef9fb600a81f0d7ac4ab9e893fc71","0x0000000000000000000000000000000000000000000000000000000000000064"],"transactionHash":"0xe2bad713807549fe3bb0bf0a69dce0ddc634c8dbec655660ea038279ef5bdb91","transactionIndex":170}