Skip to content

Add prune_rocksdb_state to VM for pruning historic storage entries#3231

Draft
Copilot wants to merge 2 commits into
stagingfrom
copilot/add-prune-rocksdb-state-method
Draft

Add prune_rocksdb_state to VM for pruning historic storage entries#3231
Copilot wants to merge 2 commits into
stagingfrom
copilot/add-prune-rocksdb-state-method

Conversation

Copilot AI commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

Adds a mechanism to prune historic state from storage maps (e.g. authority signatures, batch certificates) via the VM's sequential operation queue, preventing concurrent storage conflicts during pruning.

Changes

  • SequentialOperation / SequentialOperationResult — new PruneRocksDBState variant; dispatched in start_sequential_queue
  • VM::prune_rocksdb_state<S, T, V> — public method accepting any Map-implementing store and a key iterator; executes deletion sequentially
  • BlockStore — exposes authority_map() and certificate_map() as public getters so callers can obtain the map handle to pass to prune_rocksdb_state

Usage

// Prune authority data for blocks older than 100 rounds
let old_hashes: Vec<_> = (0..=cutoff_height)
    .filter_map(|h| vm.block_store().get_block_hash(h).ok().flatten())
    .collect();

let authority_map = vm.block_store().authority_map().clone();
vm.prune_rocksdb_state(authority_map, old_hashes);

The method works with any Map implementation (MemoryMap, DataMap/RocksDB), so it is not restricted to the rocks feature. Two tests are included: a lightweight unit test using MemoryMap (no parameter download required), and a feature-gated integration test that verifies authority data is pruned while transactions remain intact.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • parameters.provable.com
    • Triggering command: /home/REDACTED/work/snarkVM/snarkVM/target/debug/deps/snarkvm_synthesizer-c7cf0b1472ec429a /home/REDACTED/work/snarkVM/snarkVM/target/debug/deps/snarkvm_synthesizer-c7cf0b1472ec429a test_prune_authority_data_while_keeping_transactions /home/REDACTED/work/snarkVM/snarkVM/target/debug/build/aws-lc-sys-760136680ef973d9/home/REDACTED/work/snarkVM/snarkVM/target/debug/deps/test_vm_execute_and_finalize-731149e23e4aca95.0r6uwswaj5420asqwgxy5tdpd.1tkhv7x.rcgu.o /home/REDACTED/work/snarkVM/snarkVM/target/debug/build/aws-lc-sys-760136680ef973d9/home/REDACTED/work/snarkVM/snarkVM/target/debug/deps/test_vm_execute_and_finalize-731149e23e4aca95.0ufm2ybsg680p6u5zd5qpg8ep.1tkhv7x.rcgu.o /out�� /out/bc1b343226bc6a17-a_time.o 5bf43a734a4.03ri36zu42y8m2ofyaj9ap8uz.0xdcyd3.rcgu.o 5bf43a734a4.050o7lam6z1ii3dkxh3jihpoj.0xdcyd3.rcgu.o 5bf43a734a4.0erw4iwbl0tmyq4cpa7rjvac0.0xdcyd3.rcgu.o 5bf43a734a4.0h4efwsrb6bfnuqyot1uvwk5v.0xdcyd3.rcgu.o 5bf43a734a4.0hsmfv16r3iv276eyd3p5cubz.0xdcyd3.rcgu.o 5bf43a734a4.0mqjbxjuz9c73sk863cg9tr7y.0xdcyd3.rcgu.o 5bf43a734a4.0z4c86aggvwf9548dl10jjlin.0xdcyd3.rcgu.o 5bf43a734a4.14xavcn359fkm0m3qmat7oi6s.0xdcyd3.rcgu.o 5bf43a734a4.1tb7tl3penownsx0bzl3zgb14.0xdcyd3.rcgu.o 5bf43a734a4.1vxye9boby2wz6v0rql1zrcxv.0xdcyd3.rcgu.o 5bf43a734a4.1ysvw0xf5af2qcahvrsqhdghz.0xdcyd3.rcgu.o 5bf43a734a4.22aukhyhbsluwo0p2v22js2mn.0xdcyd3.rcgu.o 5bf43a734a4.2abhtsldh8cdvhp6sq1zqjpq2.0xdcyd3.rcgu.o 5bf43a734a4.2gvcqf3c89mu75fjuqnhe2c8l.0xdcyd3.rcgu.o (dns block)
  • s3.us-west-1.amazonaws.com
    • Triggering command: /home/REDACTED/work/snarkVM/snarkVM/target/debug/deps/snarkvm_synthesizer-c7cf0b1472ec429a /home/REDACTED/work/snarkVM/snarkVM/target/debug/deps/snarkvm_synthesizer-c7cf0b1472ec429a test_prune_authority_data_while_keeping_transactions /home/REDACTED/work/snarkVM/snarkVM/target/debug/build/aws-lc-sys-760136680ef973d9/home/REDACTED/work/snarkVM/snarkVM/target/debug/deps/test_vm_execute_and_finalize-731149e23e4aca95.0r6uwswaj5420asqwgxy5tdpd.1tkhv7x.rcgu.o /home/REDACTED/work/snarkVM/snarkVM/target/debug/build/aws-lc-sys-760136680ef973d9/home/REDACTED/work/snarkVM/snarkVM/target/debug/deps/test_vm_execute_and_finalize-731149e23e4aca95.0ufm2ybsg680p6u5zd5qpg8ep.1tkhv7x.rcgu.o /out�� /out/bc1b343226bc6a17-a_time.o 5bf43a734a4.03ri36zu42y8m2ofyaj9ap8uz.0xdcyd3.rcgu.o 5bf43a734a4.050o7lam6z1ii3dkxh3jihpoj.0xdcyd3.rcgu.o 5bf43a734a4.0erw4iwbl0tmyq4cpa7rjvac0.0xdcyd3.rcgu.o 5bf43a734a4.0h4efwsrb6bfnuqyot1uvwk5v.0xdcyd3.rcgu.o 5bf43a734a4.0hsmfv16r3iv276eyd3p5cubz.0xdcyd3.rcgu.o 5bf43a734a4.0mqjbxjuz9c73sk863cg9tr7y.0xdcyd3.rcgu.o 5bf43a734a4.0z4c86aggvwf9548dl10jjlin.0xdcyd3.rcgu.o 5bf43a734a4.14xavcn359fkm0m3qmat7oi6s.0xdcyd3.rcgu.o 5bf43a734a4.1tb7tl3penownsx0bzl3zgb14.0xdcyd3.rcgu.o 5bf43a734a4.1vxye9boby2wz6v0rql1zrcxv.0xdcyd3.rcgu.o 5bf43a734a4.1ysvw0xf5af2qcahvrsqhdghz.0xdcyd3.rcgu.o 5bf43a734a4.22aukhyhbsluwo0p2v22js2mn.0xdcyd3.rcgu.o 5bf43a734a4.2abhtsldh8cdvhp6sq1zqjpq2.0xdcyd3.rcgu.o 5bf43a734a4.2gvcqf3c89mu75fjuqnhe2c8l.0xdcyd3.rcgu.o (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI linked an issue Apr 23, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add prune_rocksdb_state method for historic state pruning Add prune_rocksdb_state to VM for pruning historic storage entries Apr 23, 2026
Copilot AI requested a review from vicsn April 23, 2026 21:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature] Enable pruning of historic state

2 participants