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

Detecting tracing on partial archive node. #3754

Open
dreadedhamish opened this issue Apr 18, 2024 · 1 comment
Open

Detecting tracing on partial archive node. #3754

dreadedhamish opened this issue Apr 18, 2024 · 1 comment

Comments

@dreadedhamish
Copy link

Summary of a discord discussion: https://discord.com/channels/570963863428661248/811272718224719892/1229934212967039006

Partial archive nodes on Erigon are archive nodes that only cover a specified block range, so they index everything but only for blocks after X, and/or before Y, or in the last Z blocks.

When chifra tries to detect whether tracing is enabled on a node it currently checks for traces on block 1, which might not be in the range that is archived.

@dszlachta suggested a workaround by manually editing this file: https://github.com/TrueBlocks/trueblocks-core/blob/master/src/apps/chifra/pkg/rpc/is_node.go#L41

@tjayrush - Do you know if there's some way to query for 'firstArchivedBlock`? In most cases this would be block 1 (or 0). In your case (with a "partial archive") it would return 19,00,000. We don't really care which block we check, just that we check the first available one. (It would be an easy fix if there was such a query on the RPC, but I doubt there is.)

@dreadedhamish - There is nothing in the erigon API to get first block.
It might be easiest to add some options to trueBlocks.toml (beginTrace & endTrace).

alternatively there is the command:
for a regular install: ./build/bin/integration print_stages --datadir= --chain=gnosis
docker after exec'ing in: integration print_stages --datadir= --chain=gnosis
That will print out information on stages and their pruning status, and then one key line:
prune distance: --prune.r.older=90000 --prune.h.before=17232999 --prune.t.before=17232999 --prune.c.before=17232999
You'd have to look out for prune.t.before= or prune.t.after= with block number, and prune.t.older= number of blocks.

@tjayrush - I don't love using an Erigon specific endpoint, although it won't be the first time. Reth probably does it differently.

@tjayrush
Copy link
Member

Thanks for this, at least now the issue won't get lost.

Upshot: we need to implement chifra scrape --touch block. The endpoint is there, it's just not implemented. Should be relatively easy.

@tjayrush tjayrush transferred this issue from TrueBlocks/trueblocks-docs Jun 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants