Skip to content

Conversation

@federico-stacks
Copy link
Contributor

@federico-stacks federico-stacks commented Jan 13, 2026

Description

This PR introduces a node configuration option to explicitly enable the MARF compression feature:

[node]
...
marf_compress = true    # default: false

NOTE: This PR is built on top of #6654, so would be easy to review once the base PR is merged first. However, if the two PRs need to be reviewed in different order, this one can be reviewed commit-by-commit starting from feat: add NodeConfig.marf_compress (2b90dd3) and continuing through the end of the branch (up to 7eeeb3f).

Applicable issues

Additional info (benefits, drawbacks, caveats)

With this PR, MARF options defined in the node configuration are propagated to the following databases:

  • Clarity VM: via MarfedKV::open(..) (already supported)
  • Chainstate: via StacksChainState::open_index(..) (updated to accept MARF options)
  • Sortition DB: via SortitionDB::open_index(..) (updated to accept MARF options)

Some refactoring was required to ensure MARF options are correctly passed through to the Chainstate and Sortition databases. These changes do not affect core logic. The most notable adjustments are:

  • In ChainsCoordinator::run(), burnchain databases are now retrieved directly from the Burnchain instance rather than opened inline, allowing MARF options to be inherited consistently.
  • In NakamotoBlockProposal::validate_replay(), StacksChainState is now accepted as a handle for reopening connections, making it easier to inherit MARF options.
  • In Burchain struct, serialization traits were removed (as they do not appear to be used in practice), avoiding the need to apply them to MARFOpenOpts.

Checklist

  • Test coverage for new or modified code paths
  • Changelog is updated
  • Required documentation changes (e.g., docs/rpc/openapi.yaml and rpc-endpoints.md for v2 endpoints, event-dispatcher.md for new events)
  • New clarity functions have corresponding PR in clarity-benchmarking repo

jcnelson and others added 30 commits November 4, 2025 23:02
…ue if it's 0, store a bitmap and non-empty trie ptrs if the list is sparse, and store node patches atop full nodes (and read them back)
…then record the original node from which it was copied so that a TrieNodePatch can be calculated and stored instead
… each node and see if we can instead patch an existing node instead of storing a (mostly-unchanged) copy
…ead due to a mismatch between cur_block and cur_block_id borne out of retargeting a trie
@federico-stacks federico-stacks force-pushed the feat/marf-compress-config branch from e82fa1f to 0f2c048 Compare January 13, 2026 23:13
@codecov
Copy link

codecov bot commented Jan 14, 2026

Codecov Report

❌ Patch coverage is 73.51431% with 722 lines in your changes missing coverage. Please review.
✅ Project coverage is 64.34%. Comparing base (9e6280e) to head (229fb88).
⚠️ Report is 69 commits behind head on develop.

Files with missing lines Patch % Lines
...lib/src/chainstate/stacks/index/test/marf_perfs.rs 0.00% 153 Missing ⚠️
stackslib/src/chainstate/stacks/index/node.rs 83.59% 103 Missing ⚠️
...lib/src/chainstate/stacks/index/test/node_patch.rs 65.40% 82 Missing ⚠️
stackslib/src/chainstate/stacks/index/bits.rs 66.94% 79 Missing ⚠️
stackslib/src/chainstate/stacks/index/storage.rs 74.50% 77 Missing ⚠️
stackslib/src/chainstate/stacks/index/test/marf.rs 53.33% 70 Missing ⚠️
stacks-node/src/tests/marf/marf_compress_on.rs 5.45% 52 Missing ⚠️
stacks-node/src/main.rs 0.00% 15 Missing ⚠️
contrib/stacks-inspect/src/main.rs 0.00% 13 Missing ⚠️
stackslib/src/chainstate/stacks/index/test/trie.rs 95.73% 11 Missing ⚠️
... and 21 more

❌ Your project check has failed because the head coverage (64.34%) is below the target coverage (80.00%). You can increase the head coverage or adjust the target coverage.

❗ There is a different number of reports uploaded between BASE (9e6280e) and HEAD (229fb88). Click for more details.

HEAD has 23 uploads less than BASE
Flag BASE (9e6280e) HEAD (229fb88)
96 73
Additional details and impacted files
@@             Coverage Diff              @@
##           develop    #6811       +/-   ##
============================================
- Coverage    79.61%   64.34%   -15.27%     
============================================
  Files          589      598        +9     
  Lines       357111   358670     +1559     
============================================
- Hits        284300   230803    -53497     
- Misses       72811   127867    +55056     
Files with missing lines Coverage Δ
stacks-common/src/util/macros.rs 85.41% <ø> (+0.34%) ⬆️
stacks-node/src/burnchains/mocknet_controller.rs 69.12% <100.00%> (+0.14%) ⬆️
stacks-node/src/nakamoto_node/peer.rs 97.05% <100.00%> (+0.04%) ⬆️
stacks-node/src/nakamoto_node/relayer.rs 78.18% <100.00%> (-5.48%) ⬇️
stacks-node/src/node.rs 87.17% <100.00%> (+0.15%) ⬆️
stacks-node/src/run_loop/boot_nakamoto.rs 78.00% <100.00%> (-2.00%) ⬇️
stacks-node/src/tenure.rs 100.00% <100.00%> (ø)
stacks-node/src/tests/mod.rs 67.35% <ø> (-5.10%) ⬇️
stacks-node/src/tests/nakamoto_integrations.rs 22.84% <100.00%> (-18.93%) ⬇️
stackslib/src/burnchains/mod.rs 82.59% <ø> (ø)
... and 46 more

... and 366 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 9e6280e...229fb88. Read the comment docs.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@federico-stacks federico-stacks force-pushed the feat/marf-compress-config branch from 8e487b3 to d5376fc Compare January 14, 2026 11:12
@federico-stacks federico-stacks marked this pull request as ready for review January 16, 2026 11:49
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.

2 participants