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

Add tracing by block logic for geth #1016

Merged
merged 6 commits into from
May 8, 2024
Merged

Conversation

carterqw2
Copy link

@carterqw2 carterqw2 commented Jan 24, 2024

Description

Previously blockscout when using geth (unlike other clients) would trace transactions one by one, using the debug_traceTransaction RPC endpoint, that would result in an excessive number of requests for blocks with big number of TXs and unnecessary load on archive nodes. After switching from the custom JS tracer to the callTracer it became possible to use debug_traceBlockByHash or debug_traceBlockByNumber endpoints.
This PR cherry-picks the following upstream commits:
bc30e00 and 4c2c9e3 that enable block tracing instead of individual TX tracing for geth.

Other changes

No.

Tested

Tests included in the commit.
Tested locally with rc1staging env.

Copy link

github-actions bot commented Jan 24, 2024

Unit Test Results

       5 files  ±0     363 suites  ±0   3m 39s ⏱️ +10s
2 636 tests ±0  2 562 ✔️ ±0  74 💤 ±0  0 ±0 
2 650 runs  ±0  2 574 ✔️ ±0  76 💤 ±0  0 ±0 

Results for commit 47bf6dd. ± Comparison against base commit 7318e03.

♻️ This comment has been updated with latest results.

@carterqw2 carterqw2 marked this pull request as ready for review January 25, 2024 10:26
@carterqw2 carterqw2 requested a review from a team as a code owner January 25, 2024 10:26
@rkachowski
Copy link

After deploying 178f8ec to rc1staging it looks like the ingestion of internal transaction drops significantly
image
image

indeed i'm not sure it's even indexing internal transactions anymore - the following query returns no records

select *
from internal_transactions
where transaction_hash in (select hash from public.transactions order by block_number desc limit 1000);

@carterqw2
Copy link
Author

I've updated the blockchain client to match the upstream format in this PR, it's already deployed to rc1staging. I also updated the blockscout's code to match the previous expectations of having block hashes in internal transaction responses. I tested it locally, seems to be working. @rkachowski could you take another look please?

@rkachowski
Copy link

Hey @carterqw2 , this requires archive nodes to be deployed at 1fc347330 - correct?

@carterqw2
Copy link
Author

Hey @carterqw2 , this requires archive nodes to be deployed at 1fc347330 - correct?

Yeah, I updated them on rc1staging for testing but not on other envs yet.

@carterqw2 carterqw2 merged commit 7cee218 into master May 8, 2024
23 checks passed
@carterqw2 carterqw2 deleted the carterqw2/block-tracing branch May 8, 2024 12:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants