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

Is it possible to have a archive node that prunes from time to time? #1768

Open
mikeletux-cube opened this issue Apr 3, 2024 · 2 comments
Open
Labels
bug Something isn't working

Comments

@mikeletux-cube
Copy link

Describe the bug

I'm aware that this is not a bug but I'd like to discuss one scenario that I'm trying to implement in my environment.

Turns out that for our application, we need to select a block hash and from that point onwards our application will be following all blocks from the blockchain.

First of all, we tried with the --pruning=archive flag so that we keep all blockchain history in storage. This is not very convenient for us for two reasons:

  • We've been having issues syncing an archive node from scratch due to having our node stuck in block 2585476 (as far as I read the problematic block was 2585474). Someone from the Bittensor community team said that a snapshot was gonna to be published to overcome this situation. Do we know when this is going to be published or how to solve the situation? Archive nodes from Bittensor are working but there was no solution for the rest of us.
  • Also for us is not very convenient to use an archive node because, as I said, past blocks are not important as long as our software follow the chain, so to save storage from time to time we'd like to prune.

We also explored the flags --blocks-pruning 100000 --state-pruning 100000 and so a --sync=warp so that we sync the latest state of the blockchain and we keep the last 100k blocks and states. The thing about this is that, if we stop or restart the service for some maintenance operation, the sync doesn't start where it was left and our software tries to continue also where it left it and complains that block/state that it needs next is not there.

In Ethereum (Geth + lighthouse) it is possible to sync the head of the chain and have an archive node from that point onwards, and if we stop the service for maintenance purposes, when started again, it starts syncing from where it left it, allowing our software to keep up with the chain again. Is there any way of doing this in subtensor/substrate?

Just for your information: we'd like to keep a couple of nodes that are able to sync warp and when synced, keep all future blocks from that point on in local storage, so at some given point we can switch one node off, prune it, and when it's synced up again do the same with the other one, avoiding the need of an full archive node since genesis.

I've read a lot of docs and check also scripts about nodetensor and substrate, but I haven't been able to find a solution for my specific problem.

many thanks in advace!

To Reproduce

Everything explained in Describe the bug

Expected behavior

If possible, do a warp sync of a subtensor node and keep all blocks from the time the node is fully synced.

Screenshots

No response

Environment

Ubuntu 20.04

Additional context

No response

@mikeletux-cube mikeletux-cube added the bug Something isn't working label Apr 3, 2024
@llater
Copy link

llater commented Apr 9, 2024

This is not a bug

@mikeletux-cube
Copy link
Author

That is true, it is not a bug. I think the bug tag is added automatically.

It is a question, but I think it is a genuine one.

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants