No description
Find a file
Sergey Kroshnin 8e5f4262c2
Experimental ledger pruning (#2881)
This is the initial, experimental implementation of pruning, related to https://github.com/nanocurrency/nano-node/issues/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 (https://github.com/nanocurrency/nano-node/pull/2946).

RPC, CLI and other changes
- Several RPC calls are modified to support pruned blocks related to main request block (https://github.com/nanocurrency/nano-node/pull/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 (https://github.com/nanocurrency/nano-node/pull/2977).
- Same as above for QT wallet history (https://github.com/nanocurrency/nano-node/pull/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” (https://github.com/nanocurrency/nano-node/pull/2977).
- Block count for CLI/RPC/telemetry is sum of full blocks & pruned blocks (https://github.com/nanocurrency/nano-node/pull/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 (https://github.com/nanocurrency/nano-node/pull/2947).
- Pruned node can serve as bootstrap server for remaining blocks in ledger (https://github.com/nanocurrency/nano-node/pull/2976).
- Multiple internal functions are modified to use pruned blocks in block processor (https://github.com/nanocurrency/nano-node/pull/2974), internal node wallet actions (https://github.com/nanocurrency/nano-node/pull/2992), confirmation height processor (https://github.com/nanocurrency/nano-node/pull/2978) and rep crawler (https://github.com/nanocurrency/nano-node/pull/2975).
- Development: consider using ledger safe functions for code with possible pruned blocks (https://github.com/nanocurrency/nano-node/pull/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>
2020-11-06 21:04:19 +03:00
.github github container repo (#3034) 2020-11-03 13:16:29 -08:00
api/flatbuffers Add Flatbuffers schema evolution rules to IDL (#2644) 2020-04-21 12:11:01 -05:00
ci github container repo (#3034) 2020-11-03 13:16:29 -08:00
CL Fix typo in comment 2017-12-28 01:24:23 -06:00
cmake/legacyModules Add RocksDB as a submodule (#2943) 2020-09-18 18:43:55 +02:00
cpptoml@5399650056 TOML config file support and migration (#2221) 2019-08-23 18:49:32 +02:00
crypto Update Argon2 to release 20190702 (#2357) 2019-10-22 15:47:16 +03:00
debian-control add test network to build artifacts for non DB tags (#3000) 2020-10-20 10:04:56 -07:00
docker github container repo (#3034) 2020-11-03 13:16:29 -08:00
etc add test network to build artifacts for non DB tags (#3000) 2020-10-20 10:04:56 -07:00
flatbuffers@3b458f7a17 IPC 2.0 (#2487) 2020-02-21 00:02:44 +01:00
gtest@dea0216d0c Migrate Gtest to submodule (#1661) 2019-03-14 07:26:43 -04:00
images Update README (#709) 2018-03-08 06:17:14 -05:00
lmdb@e931980823 update lmdb to 0.9.25 (#2834) 2020-07-24 11:33:36 -07:00
miniupnp@582375b64f Update miniupnp submodule to version 2.1 @582375b (#1659) 2019-01-29 16:26:30 -05:00
nano Experimental ledger pruning (#2881) 2020-11-06 21:04:19 +03:00
nano-pow-server@00591aeae9 Shared Boost in distribution packages (#2813) 2020-06-16 10:37:37 -04:00
rocksdb@38e99ec803 Update RocksDB version to 6.13.3 (#3010) 2020-10-28 18:10:30 +00:00
util build bootstrap artifacts to be compatible with rpath linking (#2988) 2020-09-28 14:08:33 -07:00
valgrind Use the MDB_NOMEMINIT flag with the ledger db environment (#2077) 2019-06-25 12:11:21 +01:00
.clang-format.base Remove compiler warnings (incl from third party headers) (#2072) 2019-07-12 17:28:21 +01:00
.gitignore Adding plist files to ignore filter. (#3005) 2020-10-26 13:30:47 +01:00
.gitlab-ci.yml adding support for rpm building (#1175) 2019-02-15 11:23:58 -05:00
.gitmodules Update RocksDB version to 6.13.3 (#3010) 2020-10-28 18:10:30 +00:00
asan_blacklist Fixing an asan issue. 2014-11-04 22:01:22 -06:00
CMakeLists.txt Allow [[deprecated]] attribute (#3033) 2020-11-03 16:10:24 +00:00
doxygen.config Rename internal project bits from RaiBlocks to Nano (#1504) 2018-12-28 14:58:50 -06:00
Info.plist.in add test network to build artifacts for non DB tags (#3000) 2020-10-20 10:04:56 -07:00
LICENSE Updating copyright holders and license to BSD 3-clause (#2814) 2020-06-16 15:55:35 +01:00
logo.png Minimal wallet rebranding 2018-02-06 20:26:00 -06:00
Nano.icns Rename internal project bits from RaiBlocks to Nano (#1504) 2018-12-28 14:58:50 -06:00
Nano.ico Rename internal project bits from RaiBlocks to Nano (#1504) 2018-12-28 14:58:50 -06:00
Nano.rc Rename internal project bits from RaiBlocks to Nano (#1504) 2018-12-28 14:58:50 -06:00
nanocurrency-beta.spec.in Enforce Cxx17 (#2878) 2020-08-12 10:13:31 +01:00
nanocurrency.spec.in Enforce Cxx17 (#2878) 2020-08-12 10:13:31 +01:00
qt.conf Found the correct magic recipe to get packaging working. 2014-11-09 18:51:16 -06:00
README.md Fix link to contributors guide (#2969) 2020-10-06 14:10:17 -05:00
rep_weights_beta.bin Beta reset in prep for rocksdb heavy testing (#2973) 2020-09-24 14:07:29 -07:00
rep_weights_live.bin Update live bootstrap weights for V21 (#2815) 2020-06-16 16:23:53 +01:00
resources.qrc fixed the inclusion of the logo file into the binary using QT resources 2017-04-20 13:19:26 -05:00
SECURITY.md Remove Guilherme's pubkey from security policy (#3006) 2020-10-19 13:10:31 -05:00
tsan_clang_blacklist TSAN suppressions file (#1941) 2019-04-30 16:55:32 +01:00
tsan_suppressions Suppress RocksDB TSAN warnings (#2345) 2019-10-16 18:29:16 +01:00
valgrind.supp Valgrind fixes & suppressions (#1814) 2019-03-15 13:55:45 +03:00


Logo

Live Artifacts Beta Artifacts GitHub release (latest by date) GitHub tag (latest by date) Tests RelWithDebug Tests Discord


What is Nano?

Nano is a digital payment protocol designed to be accessible and lightweight, with a focus on removing inefficiencies present in other cryptocurrencies. With ultrafast transactions and zero fees on a secure, green and decentralized network, this makes Nano ideal for everyday transactions.


Guides & Documentation

Other documentation details can be found at https://docs.nano.org.



Want to Contribute?

Please see the contributors guide.


Contact us

We want to hear about any trouble, success, delight, or pain you experience when using Nano. Let us know by filing an issue, joining us on Reddit, or joining us on Discord.