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

Removal of old trie logs specified by historical block limit #5390

Closed
15 of 21 tasks
non-fungible-nelson opened this issue Apr 25, 2023 · 2 comments
Closed
15 of 21 tasks
Assignees
Labels
bonsai TeamGroot GH issues worked on by Groot Team

Comments

@non-fungible-nelson
Copy link
Contributor

non-fungible-nelson commented Apr 25, 2023

How to enable this feature: https://wiki.hyperledger.org/display/BESU/Limit+Trie+Logs+for+Bonsai

There is no need to keep all the trie logs for a near-head node as the state for old blocks is rarely needed. This will place a configurable limit on how many trie logs are kept reducing storage needed for a node.

  • Add configurable limit for number trie logs to be kept. This should be the same as the Bonsai read limit config
    --bonsai-historical-block-limit parameter
  • Prune old trie logs that are not needed
  • Trie logs are stored by block hash so there will need to be a way of determining with block hashes to remove the trie logs for
  • The logic used for the block pruning which keeps a list of block hashes for each block number could possibly be reused for pruning the trie log
  • This should be enabled independently of the chain data pruning feature and can be used together
  • Measure storage saved by having the trie log pruning enabled
  • Test that reorgs have their trie log pruned

Acceptance Criteria

  • DB size of long running node should be the same before and after resync

Notes:

  • The ChainDataPruner could be a helpful place to start and reuse some of the same logic

Tasks:


Nice to have:

  • Reorg acceptance test
  • Optimisation 3: Cache finalizedBlockHeader in Blockchain or use Observer pattern to pass it to the pruner
  • Consider an option to only prune forks
  • Prevent block building from saving orphaned trie logs ?
  • Optimisation 2: Prune in batches instead of every block?
@non-fungible-nelson non-fungible-nelson added the icebox items that need more consideration, time, or can wait label Apr 25, 2023
@jframe jframe added TeamGroot GH issues worked on by Groot Team bonsai and removed icebox items that need more consideration, time, or can wait labels Sep 6, 2023
@siladu siladu self-assigned this Sep 18, 2023
@siladu
Copy link
Contributor

siladu commented Sep 18, 2023

Might be useful for testing https://github.com/ahamlat/RocksdDB-Column-Families-Size

@siladu
Copy link
Contributor

siladu commented Sep 25, 2023

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bonsai TeamGroot GH issues worked on by Groot Team
Projects
None yet
Development

No branches or pull requests

5 participants