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

fix: use blob_fee to calculate blob_gas_used in receipts #4523

Merged
merged 1 commit into from
Sep 8, 2023

Conversation

Rjected
Copy link
Member

@Rjected Rjected commented Sep 8, 2023

Previously we used the max_fee_per_blob_gas to determine blob_gas_used in receipts. This is not correct, because the max_fee_per_blob_gas is only used to bound a transaction's blob gas price, and is not used to calculate actual blob gas price. The actual blob gas price is derived from the excess_blob_gas in the header. The correct calculation is now added, and excess_blob_gas is added to TransactionMeta.

This also changes the precision of the blob fee methods to U128 instead of U256.

@Rjected Rjected added C-bug An unexpected or incorrect behavior A-rpc Related to the RPC implementation E-cancun Related to the Cancun network upgrade labels Sep 8, 2023
@codecov
Copy link

codecov bot commented Sep 8, 2023

Codecov Report

Merging #4523 (c51b1b9) into main (1ed5ae1) will decrease coverage by 0.01%.
The diff coverage is 41.17%.

Impacted file tree graph

Files Changed Coverage Δ
crates/primitives/src/header.rs 94.88% <0.00%> (ø)
crates/primitives/src/transaction/meta.rs 0.00% <ø> (ø)
crates/rpc/rpc/src/eth/api/block.rs 50.00% <0.00%> (-0.95%) ⬇️
crates/rpc/rpc/src/eth/api/transactions.rs 30.88% <0.00%> (ø)
...torage/provider/src/providers/database/provider.rs 80.27% <0.00%> (-0.06%) ⬇️
crates/primitives/src/constants/eip4844.rs 85.45% <63.63%> (ø)

... and 8 files with indirect coverage changes

Flag Coverage Δ
integration-tests 16.71% <0.00%> (-0.03%) ⬇️
unit-tests 63.91% <41.17%> (-0.01%) ⬇️

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

Components Coverage Δ
reth binary 29.71% <ø> (ø)
blockchain tree 83.58% <ø> (ø)
pipeline 90.56% <ø> (ø)
storage (db) 75.32% <0.00%> (-0.01%) ⬇️
trie 94.88% <ø> (ø)
txpool 47.47% <ø> (ø)
networking 77.42% <ø> (-0.03%) ⬇️
rpc 57.43% <0.00%> (-0.02%) ⬇️
consensus 63.40% <ø> (ø)
revm 31.74% <ø> (ø)
payload builder 6.34% <ø> (ø)
primitives 86.44% <53.84%> (+0.02%) ⬆️

📢 Have feedback on the report? Share it here.

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.

nice

@mattsse mattsse added this pull request to the merge queue Sep 8, 2023
Merged via the queue into main with commit 8398742 Sep 8, 2023
24 checks passed
@mattsse mattsse deleted the dan/use-correct-blob-gas-price-in-receipts branch September 8, 2023 11:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rpc Related to the RPC implementation C-bug An unexpected or incorrect behavior E-cancun Related to the Cancun network upgrade
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants