-
Notifications
You must be signed in to change notification settings - Fork 785
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
Support Ledger Pruning #1094
Comments
Are you also thinking of a mechanism to make pending deposits compatible with pruning? |
All mechanisms that involve pruning must not break the ledger. This includes not pruning the sending block for blocks that have no corresponding receiving block but which could in the future (i.e., we are free to locally prune sends to address 0, since there can be no receive block generated from that address). |
Has the core team ever discussed the possibility of making such that the receive block is automatically generated after its send block, by making changes in the protocol? |
@Omarino99 account holder must sign the receive block, but may not be online/cold wallet/etc |
@cryptocode what I'm suggesting would be changing the protocol such that receive blocks don't require the signature of the account. I guess this has already been discussed? I know it would bring up different problems though. |
@rkeene on the roadmap I find this:
Isn't this just plain wrong? It would work only on certain accounts. Everyone who doesn't know the protocol believes that it would be possible to prune all accounts, while instead it's not possible. |
It can be either considered incorrect or incomplete. Considering it incomplete is the most charitable interpretation, so we shall proceed under that interpretation. The most likely reason it is incomplete is because the author elided the detail that pending information would also be included in the ledger for simplicity or simply failed to consider this additional detail or simply thought it was implied that referable blocks could not be elided. Ultimately the number of pending blocks are they can go down over time, so they are a very minor factor regarding ledger pruning. I think the best thing we can do regarding this information is update the roadmap documentation to be more specific. |
If a spammer wants to increase the ledger, to circumvent the pruning he just needs to transact for millions of different accounts, correct? |
@kaiquenunes23 account creation and transaction creation is controlled/limited by PoW. @rkeene Ledger pruning will prune off blocks other than the frontier (head block) +1 or 2 previous for each account. Which to my understanding [Limits history of transactions]
|
|
Should this be configurable in the node config so instead of just frontier and previous you can choose frontier + x previous blocks (x min 1). Might give a middle ground between full history and minimal. |
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>
Is this still something we're shooting for? |
Closing this issue since experimental ledger pruning has been around since V22, and we have a few newer pruning related issues: |
As a part of node stratification (#1092) not all nodes will need the full ledger, and a mechanism will need to be created to determine which parts of the ledger can be safely discarded on each node. This mechanism will be called pruning.
More details will be added as time goes on.
The text was updated successfully, but these errors were encountered: