Skip to content

feat: add marf compress node config#6811

Merged
federico-stacks merged 16 commits intostacks-network:developfrom
federico-stacks:feat/marf-compress-config
Feb 27, 2026
Merged

feat: add marf compress node config#6811
federico-stacks merged 16 commits intostacks-network:developfrom
federico-stacks:feat/marf-compress-config

Conversation

@federico-stacks
Copy link
Copy Markdown
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: true

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

@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
Copy Markdown

codecov Bot commented Jan 14, 2026

Codecov Report

❌ Patch coverage is 86.02620% with 32 lines in your changes missing coverage. Please review.
✅ Project coverage is 81.48%. Comparing base (b61a766) to head (f8815ff).
⚠️ Report is 28 commits behind head on develop.

Files with missing lines Patch % Lines
stacks-node/src/main.rs 0.00% 15 Missing ⚠️
stacks-node/src/nakamoto_node/miner.rs 66.66% 5 Missing ⚠️
stacks-node/src/neon_node.rs 90.00% 3 Missing ⚠️
stackslib/src/chainstate/burn/db/sortdb.rs 92.10% 3 Missing ⚠️
.../chainstate/burn/operations/leader_block_commit.rs 60.00% 2 Missing ⚠️
stackslib/src/chainstate/stacks/db/mod.rs 90.47% 2 Missing ⚠️
stackslib/src/burnchains/burnchain.rs 94.11% 1 Missing ⚠️
stackslib/src/chainstate/burn/sortition.rs 50.00% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           develop    #6811       +/-   ##
============================================
+ Coverage    59.40%   81.48%   +22.07%     
============================================
  Files          412      412               
  Lines       218187   218682      +495     
  Branches       338      338               
============================================
+ Hits        129610   178185    +48575     
+ Misses       88577    40497    -48080     
Files with missing lines Coverage Δ
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.46%) ⬇️
stacks-node/src/nakamoto_node/relayer.rs 83.97% <100.00%> (+8.02%) ⬆️
stacks-node/src/node.rs 87.31% <100.00%> (+0.15%) ⬆️
stacks-node/src/run_loop/boot_nakamoto.rs 80.66% <100.00%> (+3.42%) ⬆️
stacks-node/src/tenure.rs 100.00% <100.00%> (ø)
stackslib/src/burnchains/mod.rs 82.59% <ø> (+2.59%) ⬆️
.../chainstate/burn/operations/leader_key_register.rs 98.58% <100.00%> (+77.73%) ⬆️
stackslib/src/chainstate/coordinator/mod.rs 81.80% <100.00%> (+2.86%) ⬆️
stackslib/src/chainstate/stacks/index/marf.rs 84.53% <ø> (+5.20%) ⬆️
... and 12 more

... and 294 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 b61a766...f8815ff. 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
@federico-stacks federico-stacks self-assigned this Feb 16, 2026
@federico-stacks federico-stacks mentioned this pull request Feb 20, 2026
4 tasks
jacinta-stacks
jacinta-stacks previously approved these changes Feb 25, 2026
Copy link
Copy Markdown
Contributor

@francesco-stacks francesco-stacks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, just a couple of sanity checks and nits. Just resolve the comments them if everything looks correct!

Comment thread stackslib/src/net/api/postblock_proposal.rs Outdated
Comment thread stackslib/src/chainstate/stacks/index/storage.rs Outdated
Copy link
Copy Markdown
Contributor

@francesco-stacks francesco-stacks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Comment thread stackslib/src/config/mod.rs Outdated
Copy link
Copy Markdown
Member

@jcnelson jcnelson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just had one question about the default for MARF compression. Otherwise LGTM.

Comment thread stackslib/src/chainstate/burn/db/sortdb.rs
Comment thread stackslib/src/chainstate/stacks/index/marf.rs
Comment thread stacks-node/src/tests/signer/v0/reorg.rs
Copy link
Copy Markdown
Contributor

@cylewitruk-stacks cylewitruk-stacks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Copy Markdown
Contributor

@cylewitruk-stacks cylewitruk-stacks left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@federico-stacks federico-stacks added this pull request to the merge queue Feb 27, 2026
Merged via the queue into stacks-network:develop with commit c5600aa Feb 27, 2026
2 checks passed
@federico-stacks federico-stacks deleted the feat/marf-compress-config branch February 27, 2026 19:37
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Mar 7, 2026

This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions Bot added the locked label Mar 7, 2026
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Mar 7, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants