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(primitives): add Receipts to encapsulate Vec<Vec<Option<Receipt>> #4626

Merged
merged 25 commits into from
Sep 27, 2023

Conversation

tcoratger
Copy link
Contributor

@tcoratger tcoratger commented Sep 16, 2023

Should resolve #4621.

@codecov
Copy link

codecov bot commented Sep 16, 2023

Codecov Report

Merging #4626 (3c55fb8) into main (b994d15) will increase coverage by 0.02%.
The diff coverage is 50.60%.

Impacted file tree graph

Files Coverage Δ
bin/reth/src/init.rs 97.54% <100.00%> (ø)
crates/primitives/src/lib.rs 100.00% <ø> (ø)
crates/primitives/src/prune/part.rs 100.00% <ø> (ø)
crates/storage/provider/src/chain.rs 74.24% <100.00%> (ø)
...torage/provider/src/providers/database/provider.rs 78.90% <100.00%> (ø)
crates/storage/provider/src/test_utils/blocks.rs 79.75% <100.00%> (ø)
crates/revm/src/processor.rs 84.34% <33.33%> (+2.14%) ⬆️
...der/src/bundle_state/bundle_state_with_receipts.rs 92.54% <84.61%> (+0.36%) ⬆️
crates/rpc/rpc/src/eth/api/pending_block.rs 0.00% <0.00%> (ø)
crates/payload/basic/src/lib.rs 0.00% <0.00%> (ø)
... and 1 more

... and 10 files with indirect coverage changes

Flag Coverage Δ
integration-tests 16.17% <0.00%> (-0.01%) ⬇️
unit-tests 63.29% <50.60%> (+0.03%) ⬆️

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

Components Coverage Δ
reth binary 32.11% <100.00%> (ø)
blockchain tree 83.69% <ø> (ø)
pipeline 88.45% <ø> (ø)
storage (db) 73.49% <90.00%> (+0.01%) ⬆️
trie 94.48% <ø> (ø)
txpool 49.97% <ø> (+0.46%) ⬆️
networking 76.42% <ø> (-0.06%) ⬇️
rpc 57.73% <0.00%> (+<0.01%) ⬆️
consensus 62.59% <ø> (+0.12%) ⬆️
revm 28.46% <33.33%> (+0.12%) ⬆️
payload builder 8.16% <0.00%> (-0.05%) ⬇️
primitives 86.24% <46.80%> (-0.12%) ⬇️

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.

smol nit

crates/revm/src/processor.rs Outdated Show resolved Hide resolved
@rakita
Copy link
Collaborator

rakita commented Sep 18, 2023

Just one more code blocks that can be moved to a function inside Receipts

gas_spent_by_tx: self
.receipts
.last()
.map(|block_r| {
block_r
.iter()
.enumerate()
.map(|(id, tx_r)| {
(
id as u64,
tx_r.as_ref()
.expect("receipts have not been pruned")
.cumulative_gas_used,
)
})
.collect()
})
.unwrap_or_default(),
}

@tcoratger
Copy link
Contributor Author

Just one more code blocks that can be moved to a function inside Receipts

gas_spent_by_tx: self
.receipts
.last()
.map(|block_r| {
block_r
.iter()
.enumerate()
.map(|(id, tx_r)| {
(
id as u64,
tx_r.as_ref()
.expect("receipts have not been pruned")
.cumulative_gas_used,
)
})
.collect()
})
.unwrap_or_default(),
}

@rakita Done

crates/primitives/src/receipt.rs Show resolved Hide resolved
crates/primitives/src/receipt.rs Show resolved Hide resolved
crates/primitives/src/receipt.rs Outdated Show resolved Hide resolved
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, pending @rakita

and conflicts

@tcoratger
Copy link
Contributor Author

lgtm, pending @rakita

and conflicts

@mattsse Conflicts are resolved :)

Copy link
Collaborator

@rakita rakita left a comment

Choose a reason for hiding this comment

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

Have a request for change here: #4626 (comment)

auto-merge was automatically disabled September 23, 2023 17:49

Head branch was pushed to by a user without write access

Copy link
Collaborator

@rakita rakita left a comment

Choose a reason for hiding this comment

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

lgtm

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

@rakita
Copy link
Collaborator

rakita commented Sep 25, 2023

@tcoratger there is one conflict at crates/payload/basic/src/lib.rs

auto-merge was automatically disabled September 25, 2023 14:17

Head branch was pushed to by a user without write access

@tcoratger
Copy link
Contributor Author

@tcoratger there is one conflict at crates/payload/basic/src/lib.rs

@rakita Just solved :)

@rakita rakita added this pull request to the merge queue Sep 27, 2023
@mattsse mattsse added the C-debt Refactor of code section that is hard to understand or maintain label Sep 27, 2023
Merged via the queue into paradigmxyz:main with commit 2138a8b Sep 27, 2023
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-debt Refactor of code section that is hard to understand or maintain
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add Receipts type that would encapsulate Vec<Vec<Option<Receipt>>
5 participants