-
Notifications
You must be signed in to change notification settings - Fork 787
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
[Pruning] Accept pruned-related blocks in blocks processing & rollback #2974
Merged
SergiySW
merged 8 commits into
nanocurrency:develop
from
SergiySW:pruning/ledger_process_rollback
Oct 3, 2020
Merged
[Pruning] Accept pruned-related blocks in blocks processing & rollback #2974
SergiySW
merged 8 commits into
nanocurrency:develop
from
SergiySW:pruning/ledger_process_rollback
Oct 3, 2020
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wezrule
previously approved these changes
Sep 25, 2020
guilhermelawless
previously approved these changes
Sep 28, 2020
wezrule
previously approved these changes
Oct 2, 2020
wezrule
approved these changes
Oct 3, 2020
SergiySW
added a commit
that referenced
this pull request
Nov 6, 2020
This is the initial, experimental implementation of pruning, related to #1094. Node ledger pruning is designed to safely discard parts of the ledger. Now ledger size can be reduced from 23.8 GB to 7.5GB after vacuum. And from 18.8 GB to 5.2 GB after database rebuild. Configuration and considerations - This version of ledger pruning is for experimental use only: - Enable optional ledger pruning with node CLI `--debug_prune` for manual pruning & node launch flag `--enable_pruning` for automatic node background actions. - Pruning rules can be configured in [node.experimental] config with “max_pruning_age” (Time in seconds to limit for blocks age after pruning. Also period for automatic node pruning task, default 1 day, 5 minutes for beta network) & “max_pruning_depth” (Limit for full blocks in chain after pruning, default 0 - unlimited). By default all confirmed blocks older than 1 day can be pruned, except genesis block & last confirmed block in each account chain. - Last confirmed block in account chain & all unconfirmed blocks cannot be pruned from ledger. Pruning is relying on confirmation height, so confirmation height reset or too low online_weight_minimum config can cause issues. - Pruned blocks hashes are located in database table “pruned” & can be used by node internally (#2946). RPC, CLI and other changes - Several RPC calls are modified to support pruned blocks related to main request block (#2977). - RPC “history”: if previous block is pruned, “amount” field is not returned for all blocks, “account” field is not returned for state blocks, also state block type/subtype is “unknown” . If source is pruned, then “account” field is not returned for receive/open legacy & for receive/open state blocks (#2977). - Same as above for QT wallet history (#2977). - RPC “block_info”/“blocks_info”: if previous block is pruned, “amount” field is not returned. RPC “block_count”: for nodes with enabled pruning returns 2 new fields: “full” blocks & “pruned” blocks. “full” + “pruned” = total “blocks” (#2977). - Block count for CLI/RPC/telemetry is sum of full blocks & pruned blocks (#2977). - RPC "pruned_exists" to chekc pruned block existence in local database. Other notes - Node is aggressively pruning ledger during initial bootstrap (until hardcoded block count) to limit node disk space usage, pruning config settings are ignored. If you want to avoid this behavior, finish full bootstrap before pruning start. - `--enable_pruning` flag & config option “enable_voting” are mutually exclusive to prevent representatives start with pruned ledger. Pruning is not available for any representatives (#2947). - Pruned node can serve as bootstrap server for remaining blocks in ledger (#2976). - Multiple internal functions are modified to use pruned blocks in block processor (#2974), internal node wallet actions (#2992), confirmation height processor (#2978) and rep crawler (#2975). - Development: consider using ledger safe functions for code with possible pruned blocks (#2968). Additional updates being reviewed - Include pruned count in telemetry. - Improve RocksDB pruned block count calculation. Co-authored-by: Wesley Shillingford <650038+wezrule@users.noreply.github.com> Co-authored-by: Guilherme Lawless <guilherme@nano.org>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Splitting #2881