From 9d43890f60d08a029897bf9189fd32b45873b2fa Mon Sep 17 00:00:00 2001 From: Martin Tomazic Date: Thu, 23 Jul 2026 18:54:25 +0200 Subject: [PATCH] docs/node/run-your-node/advanced: Fix pruning documentation As runtime pruning has been fixed, consensus and runtime pruning share same recommendation. --- docs/node/run-your-node/advanced/pruning.md | 62 +++++++++------------ 1 file changed, 27 insertions(+), 35 deletions(-) diff --git a/docs/node/run-your-node/advanced/pruning.md b/docs/node/run-your-node/advanced/pruning.md index 96fa46dab9..ec4730633e 100644 --- a/docs/node/run-your-node/advanced/pruning.md +++ b/docs/node/run-your-node/advanced/pruning.md @@ -4,9 +4,9 @@ To reduce hardware requirements and improve the overall latency of the node, operators are encouraged to prune their state (unless also serving historical state). -As will be explained in the following sections, pruning should be configured from -the start, i.e. late changes to the pruning configuration may not be optimal for -the node's health. +As explained in the [Late Pruning](#late-pruning) section, ideally pruning +should be configured from the start, i.e. late changes to the pruning configuration +may not be optimal for the node's health. ## Consensus Pruning @@ -23,16 +23,33 @@ consensus: where `` is the number of blocks and state versions that will be kept. -### Suggested Pruning Configuration +## ParaTime Pruning + +To configure pruning of the ParaTime data amend your node's configuration with: + +```yaml +# ... sections not relevant are omitted ... +runtime: + # ... sections not relevant are omitted ... + prune: + strategy: "keep_last" + num_kept: +``` + +where `` is the number of ParaTime's state versions that will be kept. -For normal node operation, the minimum requirements is `n=250_000`. However, -it is recommended to set it to `n=400_000`. Assuming blocks are produced every 6 -seconds, the latter corresponds to preserving 1 month of the consensus data. +## Suggested Pruning Configuration + + +For normal node operation, for both consensus and ParaTime pruning, the minimum is +`n=250_000`. However, it is recommended to set it to `n=400_000`. Assuming blocks +are produced every 6 seconds, the latter corresponds to preserving 1 month of the data. Operators that are not resource-restrained and want to contribute to the overall network health are encouraged to set `n=5_000_000` (approximately 1 year of data). -### Late Pruning + +## Late Pruning Due to the [LSM Tree][] design of the underlying databases, enabling pruning after your node has been running for a while, or changing configuration to retain less data, @@ -41,7 +58,8 @@ may not work as expected. To change pruning configuration operators must follow this steps: 1. Gracefuly shutdown the node (validators should take [special care][graceful shutdown]). -2. Configure pruning as described in the [Consensus Pruning](#consensus-pruning) section above. +2. Configure pruning as described in the [Consensus Pruning](#consensus-pruning) + or [ParaTime Pruning](#paratime-pruning) section above. 3. Run offline [pruning command]. 4. Run the [compaction command]. 5. Start the node again. @@ -50,29 +68,3 @@ To change pruning configuration operators must follow this steps: [graceful shutdown]: ../maintenance/shutting-down-a-node.md [pruning command]: https://github.com/oasisprotocol/oasis-core/blob/master/docs/oasis-node/cli.md#prune [compaction command]: https://github.com/oasisprotocol/oasis-core/blob/master/docs/oasis-node/cli.md#compact - -## ParaTime Pruning - -To configure pruning of the ParaTime data amend your node's configuration with: - -```yaml -# ... sections not relevant are omitted ... -runtime: - # ... sections not relevant are omitted ... - prune: - strategy: "keep_last" - num_kept: -``` - -where `` is the number of ParaTime's state versions that will be kept. - -### Suggested Pruning Configuration - -ParaTime state is much larger than the consensus state. As a consequence, as the -number of versions in the state database grows, pruning becomes slower and slower. -For this reason **ParaTime state pruning must be configured -from the start or not configured at all**. - -To configure ParaTime pruning it is recommended to set `n=250_000`. The maximum value is -`n=400_000`. If you need to preserve more data (e.g. nodes serving historical -state) you will have to keep the entire ParaTime's state from the genesis.