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: add block rewards to trace_block #3491

Merged
merged 11 commits into from
Jul 2, 2023
Merged

Conversation

onbjerg
Copy link
Member

@onbjerg onbjerg commented Jun 30, 2023

Closes #3443

@onbjerg onbjerg added C-bug An unexpected or incorrect behavior M-changelog This change should be included in the changelog A-rpc Related to the RPC implementation labels Jun 30, 2023
@codecov
Copy link

codecov bot commented Jun 30, 2023

Codecov Report

Merging #3491 (6bd50a3) into main (d14f995) will decrease coverage by 0.09%.
The diff coverage is 4.16%.

Impacted file tree graph

Impacted Files Coverage Δ
bin/reth/src/args/rpc_server_args.rs 47.61% <0.00%> (-0.27%) ⬇️
crates/rpc/rpc-builder/src/lib.rs 67.63% <0.00%> (-0.82%) ⬇️
crates/storage/provider/src/lib.rs 100.00% <ø> (ø)
...tes/storage/provider/src/providers/database/mod.rs 30.79% <0.00%> (-0.36%) ⬇️
crates/storage/provider/src/providers/mod.rs 8.39% <0.00%> (-0.18%) ⬇️
crates/storage/provider/src/test_utils/noop.rs 21.88% <0.00%> (-0.29%) ⬇️
crates/storage/provider/src/traits/receipts.rs 43.75% <ø> (ø)
crates/rpc/rpc/src/trace.rs 41.13% <6.38%> (-4.12%) ⬇️

... and 13 files with indirect coverage changes

Flag Coverage Δ
integration-tests 16.25% <4.16%> (-0.04%) ⬇️
unit-tests 64.03% <0.00%> (-0.08%) ⬇️

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

Components Coverage Δ
reth binary 23.04% <0.00%> (-0.02%) ⬇️
blockchain tree 81.42% <ø> (-0.27%) ⬇️
pipeline 87.10% <ø> (ø)
storage (db) 73.82% <0.00%> (-0.12%) ⬇️
trie 95.64% <ø> (ø)
txpool 51.14% <ø> (ø)
networking 77.92% <ø> (-0.03%) ⬇️
rpc 57.88% <4.91%> (-0.27%) ⬇️
consensus 62.58% <ø> (-0.20%) ⬇️
revm 34.99% <ø> (ø)
payload builder 6.83% <ø> (ø)
primitives 88.47% <ø> (-0.01%) ⬇️

@onbjerg onbjerg marked this pull request as ready for review June 30, 2023 09:31
(self.inner.eth_api.block_by_id(block_id).await?, traces.as_mut())
{
if let Some(header_td) = self.provider().header_td(&block.header.hash)? {
if let Some(base_block_reward) = base_block_reward(
Copy link
Member Author

Choose a reason for hiding this comment

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

if this is none we are past the merge and there are no block rewards and no ommers

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.

naming nits,

Reader doesn't make sense here imo, so we should stick with Provider naming

crates/storage/provider/src/traits/spec.rs Outdated Show resolved Hide resolved
crates/storage/provider/src/traits/spec.rs Outdated Show resolved Hide resolved
@@ -396,7 +399,7 @@ where
&self,
block_id: BlockId,
) -> EthResult<Option<Vec<LocalizedTransactionTrace>>> {
let traces = self
let mut traces: Option<Vec<LocalizedTransactionTrace>> = self
Copy link
Collaborator

Choose a reason for hiding this comment

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

perf: can use futures::try_join with the cache call

Copy link
Member

Choose a reason for hiding this comment

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

let's do in follow-up as i'd like to unblock this asap

@gakonst gakonst force-pushed the onbjerg/trace-block-rewards branch from 5ad6a3b to 3ccc5af Compare July 2, 2023 11:51
crates/rpc/rpc/src/eth/api/transactions.rs Outdated Show resolved Hide resolved
crates/rpc/rpc/src/trace.rs Show resolved Hide resolved
@gakonst gakonst enabled auto-merge July 2, 2023 13:21
@gakonst gakonst added this pull request to the merge queue Jul 2, 2023
Merged via the queue into main with commit 4f32f56 Jul 2, 2023
@gakonst gakonst deleted the onbjerg/trace-block-rewards branch July 2, 2023 15:44
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 M-changelog This change should be included in the changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add block rewards to trace_block response
3 participants