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

Allow index in pruned mode (e.g. -blockfilterindex) #15867

Closed
maflcko opened this issue Apr 22, 2019 · 6 comments
Closed

Allow index in pruned mode (e.g. -blockfilterindex) #15867

maflcko opened this issue Apr 22, 2019 · 6 comments

Comments

@maflcko
Copy link
Member

maflcko commented Apr 22, 2019

Indexes can be turned off an on between restarts and they are initially synced on their own thread.

Both are a potential reason they could "lag behind" and thus they appear incompatible with pruned mode. However, if they only lag by MIN_BLOCKS_TO_KEEP, we could allow them to catch up on startup. If they lag behind by more, the background thread might just fetch the blocks from the network?

See also #14121 (comment)

Motivation to maintain indexes in pruned mode is that they can be serve to other peers (p2p), or over rpc, or even be used by the own wallet.

@jonasschnelli
Copy link
Contributor

Maybe also introduce a function that pauses IBD/catch-up in case an index gets close to lagging > MIN_BLOCKS_TO_KEEP.

That functionality could also be useful for external listeners (ZMQ, RPC),... things like lightning daemons (if external applications would have an option to report back their sync state/hash of sync-tip).

@pstratem
Copy link
Contributor

pstratem commented Jun 6, 2019

how does the wallet deal with falling behind in pruned mode?

@jonasschnelli
Copy link
Contributor

how does the wallet deal with falling behind in pruned mode?

This is not part of this PR. But I have a branch (you can search for it) where the wallet would request the blocks filtered out and are not available on disk (due to pruning) from the p2p network.

If you meant to ask how wallets deal with that situation in the current master, they would just fail to load (can lead to shutdown during init) if they fall behind prune depth.

@pstratem
Copy link
Contributor

pstratem commented Jun 8, 2019

@jonasschnelli yeah, i'm suggesting looking at how the wallet handles this for an idea of how to do so with the filters

@prusnak
Copy link
Contributor

prusnak commented Jun 18, 2020

It makes sense for a pruned node to have the blockfilterindex available for non-pruned blocks.

@maflcko
Copy link
Member Author

maflcko commented Feb 18, 2021

#15946

@maflcko maflcko closed this as completed Feb 18, 2021
@bitcoin bitcoin locked as resolved and limited conversation to collaborators Aug 18, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants
@prusnak @jonasschnelli @pstratem @maflcko and others