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

feat: validate blob_gas_used in header #4676

Merged
merged 2 commits into from
Sep 20, 2023
Merged

Conversation

Rjected
Copy link
Member

@Rjected Rjected commented Sep 20, 2023

Previously we were not validating the blob gas used in the header, this adds blob_gas_used validation based on the number of versioned hashes in the block.

@Rjected Rjected added A-consensus Related to the consensus engine M-eip This change relates to the implementation of an EIP E-cancun Related to the Cancun network upgrade labels Sep 20, 2023
@codecov
Copy link

codecov bot commented Sep 20, 2023

Codecov Report

Merging #4676 (53160e4) into main (24d7bde) will increase coverage by 0.00%.
The diff coverage is 98.48%.

Impacted file tree graph

Files Changed Coverage Δ
crates/interfaces/src/consensus.rs 93.33% <ø> (ø)
crates/rpc/rpc-types/src/eth/engine/payload.rs 80.74% <ø> (ø)
crates/consensus/common/src/validation.rs 73.50% <98.48%> (+2.74%) ⬆️

... and 14 files with indirect coverage changes

Flag Coverage Δ
integration-tests 16.75% <0.00%> (-0.11%) ⬇️
unit-tests 63.46% <98.48%> (+0.06%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Components Coverage Δ
reth binary 32.17% <ø> (ø)
blockchain tree 83.75% <ø> (ø)
pipeline 88.54% <ø> (ø)
storage (db) 73.47% <ø> (ø)
trie 94.73% <ø> (ø)
txpool 49.91% <ø> (+0.46%) ⬆️
networking 77.20% <ø> (-0.32%) ⬇️
rpc 57.82% <ø> (ø)
consensus 63.30% <98.48%> (+0.62%) ⬆️
revm 28.16% <ø> (ø)
payload builder 8.45% <ø> (ø)
primitives 86.59% <ø> (+0.07%) ⬆️

Copy link
Collaborator

@mattsse mattsse left a comment

Choose a reason for hiding this comment

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

lgtm

Comment on lines +252 to +253
// Check that the blob gas used in the header matches the sum of the blob gas used by each
// blob tx
Copy link
Collaborator

Choose a reason for hiding this comment

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

this is correct even for the first block which is supposed to have blob gas 0

@mattsse mattsse added this pull request to the merge queue Sep 20, 2023
Merged via the queue into main with commit 24a8590 Sep 20, 2023
@mattsse mattsse deleted the dan/validate-blob-gas-used branch September 20, 2023 07:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-consensus Related to the consensus engine E-cancun Related to the Cancun network upgrade M-eip This change relates to the implementation of an EIP
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants