Default pruneBlockLimit increased from 1450 to 6000 (approx 5 days), to be more similar to the AT states retention time of full nodes.

This commit is contained in:
CalDescent 2023-01-15 12:00:32 +00:00
parent e91e612b55
commit 30105199a2
2 changed files with 2 additions and 4 deletions

View File

@ -757,9 +757,7 @@ public class BlockChain {
try (final Repository repository = RepositoryManager.getRepository()) { try (final Repository repository = RepositoryManager.getRepository()) {
repository.checkConsistency(); repository.checkConsistency();
// Set the number of blocks to validate based on the pruned state of the chain int blocksToValidate = Math.min(Settings.getInstance().getPruneBlockLimit() - 10, 1440);
// If pruned, subtract an extra 10 to allow room for error
int blocksToValidate = (isTopOnly || archiveEnabled) ? Settings.getInstance().getPruneBlockLimit() - 10 : 1440;
int startHeight = Math.max(repository.getBlockRepository().getBlockchainHeight() - blocksToValidate, 1); int startHeight = Math.max(repository.getBlockRepository().getBlockchainHeight() - blocksToValidate, 1);
BlockData detachedBlockData = repository.getBlockRepository().getDetachedBlockSignature(startHeight); BlockData detachedBlockData = repository.getBlockRepository().getDetachedBlockSignature(startHeight);

View File

@ -159,7 +159,7 @@ public class Settings {
* This prevents the node from being able to serve older blocks */ * This prevents the node from being able to serve older blocks */
private boolean topOnly = false; private boolean topOnly = false;
/** The amount of recent blocks we should keep when pruning */ /** The amount of recent blocks we should keep when pruning */
private int pruneBlockLimit = 1450; private int pruneBlockLimit = 6000;
/** How often to attempt AT state pruning (ms). */ /** How often to attempt AT state pruning (ms). */
private long atStatesPruneInterval = 3219L; // milliseconds private long atStatesPruneInterval = 3219L; // milliseconds