pruning: add pruning option - #681
Open
p4xxus wants to merge 48 commits into
Open
Conversation
if pruning selected: - we fist look that file up -> if it doesn't exist, create a random pruning-stripe and insert the corresponding seed - delete tape files for all other stripes it doesn't compile yet, as the prunable_blob type has changed and I still need to do some work there
- passing pruning_seed to `TimedSyncedRequest`, which doesn't use 0 as the default anymore - added `PruningSeed` as a `BlockChainRequest` and ..`Response`
…ouldn't retrieve the metadata if it already existed
- return [`BlockchainError::NotFound`] if it get's read (via [`BlockchainReadRequest`]) - basically ignore the pruned ones whenever we write (via [`BlockchainWriteRequest`])
* cuprated: add custom allocators * default to jemalloc on musl * add mimalloc-secure flag * opt in jemalloc
* cuprated: Dockerfile * enable Alpine in CI the monerod from github is compiled with glibc, which doesnt work well on alpine due to it's usage of musl, even with gcompat * update randomx-rs to a876ab6 * fix typo in alpine comment * update randomx-rs to 76c2385 Fixes OpenBSD builds
update tapes
Fix doc CI.
* update repo for 0.1.0-preview * update RPC docs * fix minor doc errors * include changelog how did I forget * fix download links
remove unnecessary version field
…te#663) * cuprated: add p2p.clear_net.seed_nodes config option Add a `seed_nodes` field to `ClearNetConfig`, appended to the network's built-in seed list in `clearnet_p2p_config()`. `Network::FakeChain` ships no built-in seeds, so a regtest or otherwise isolated network currently has no way to bootstrap — the first node panics in `connection_maintainer` with "No seed nodes available to get peers from". This option lets such a network point its nodes at each other. The field is commented out in the generated config and defaults to empty, so behaviour on Mainnet/Testnet/Stagenet is unchanged. Useful for regtest, integration testing, and private networks. Verified: `cuprated --regtest` with `seed_nodes = ["<addr>"]` loads the value, dials the configured address and completes a handshake. * cuprated: add --seed-node argument Adds a repeatable `--seed-node <IP:PORT>` argument that appends to `p2p.clear_net.seed_nodes`, following the existing `--outbound-connections` override pattern. This makes a multi-node regtest reachable without writing a config file: cuprated --regtest --seed-node 127.0.0.1:18080 `apply_args` loses its `const` qualifier, as extending a `Vec` is not a const operation.
- also added helper method for tx_id retrieval - can/will be further optimized
…e not writing to the tip blocks if we're not pruned
- added function read_prunable_tape that reads the tape if it exists - had to remove check if txs are correct, since it cannot retrieve the tx if it's pruned
- removed 2 db calls by just looking up the first value in the tip instead of calculating it
- it now deletes from the smallest tx upwards, instead of calculating and fetching the tx id from the db - in order to sort correctly, big endianness of tx_id in prunable_tip is required
…e the tapes if we have them but are now pruning
…in the prev commit
p4xxus
marked this pull request as draft
August 11, 2026 19:43
Boog900
requested changes
Aug 11, 2026
Boog900
left a comment
Member
There was a problem hiding this comment.
Thanks for working on this. The code looks great. This is only an initial review but I do have some suggestions.
- adding tx to tip is part of `add_tx_info_to_dynamic_tables` - removing from tip is part of `add_block_to_dynamic_tables` - height to remove to is passed as a param to `add_block_to_dynamic_tables`
…iate pruning: - stripe indicies are indexed at 1 but I didn't do that - now storing `Metadata` instead of just the `PruningSeed` in the db struct - added logic for populating the `pruning_tip` - generally some refactoring
- now passing it down from `launch` to the `CoreSvcService`
- stripe_idx wasn't correctly increased - now correctly opening prunable_blobs - created fn `add_blocks_to_dynamic_tables` to first remove tip and then do the rest - changed `prunable_tip` from be to le bytes
p4xxus
marked this pull request as ready for review
August 14, 2026 21:19
…re's nothing to read thus fixed failing tests
This PR has some simplifications and bug fixes
Boog900
approved these changes
Sep 3, 2026
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
Closes #657
dbstructprunable_tipcontains the transactions of the top 5500 blocks by TxId to blobWhy
to use less space for a monero node
Where
prunable_tip(Keyspace) andmetadata(Metadata)), updatedprunable_blobto use optional tape for prunable partContextCacheHow
dbstructincoming block:
prunable_tipso after adding the new blocks we're back to 5500 blocksprunable_tipretrieval of tx (
read_prunable_tape):I used Gemini Pro 3.1 to find bugs and general help. It was thoroughly reviewed though.