Skip to content

Conversation

jcnelson
Copy link
Member

@jcnelson jcnelson commented Aug 11, 2025

Description

Implements #6350 by re-implementing WritableMarfStore as an enum of a persistent disk-backed variant (the one we currently have), and a new ephemeral variant in which writes are committed to a RAM-backed Sqlite store, and in which reads will hit both the in-RAM sqlite store and an internal ReadOnlyMarfStore handle. This feature will be used to allow the node to replay blocks without the possibility of committing them to disk.

Applicable issues

Additional info (benefits, drawbacks, caveats)

A caveat: blocks produced with the ephemeral variant will not have the same state root hash as they would have had they been produced with the persistent variant. This is a consequence of the fact that the new block's MARF key/value pairs and side-storage live in a separate MARF, whose trie is not linked to the disk-backed parent trie. This is acceptable because the purpose of this PR is to allow the node to replay already-processed blocks in order to extract the transaction receipts. The node already knows the "true" state root hash.

This PR is a draft until it has enough test coverage.

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
  • New integration test(s) added to bitcoin-tests.yml

obycode and others added 16 commits March 3, 2025 11:34
…1.0.0.8

Merge release/3.1.0.0.8 to master
…1.0.0.9

Merge release/3.1.0.0.9 to master
…1.0.0.11

Merge release/3.1.0.0.11 to master
…1.0.0.12

Merge release/3.1.0.0.12 to master
…1.0.0.13

Merge release/3.1.0.0.13 to master
…e on disk, and a RAM-backed MARF store which loads data from a read-only handle. Implement ClarityBlockStore for the ephemeral variant
@jcnelson jcnelson requested a review from rdeioris August 11, 2025 14:48
@aldur aldur linked an issue Aug 11, 2025 that may be closed by this pull request
@jcnelson jcnelson marked this pull request as ready for review August 21, 2025 01:40
@jcnelson jcnelson requested review from a team as code owners August 21, 2025 01:40
@jcnelson jcnelson requested review from kantai and obycode August 21, 2025 01:41
jcnelson and others added 4 commits August 21, 2025 04:10
…ich combine to form a WritableMarfStore trait. This factoring consolidates code between PersistentWritableMarfStore and EphemeralMarfStore and separates transaction lifecycle concerns from the act of writing data.
@jcnelson jcnelson requested a review from moodmosaic August 29, 2025 01:10
@jcnelson
Copy link
Member Author

@obycode @kantai @rdeioris I've added a trait for WritableMarfStore now. Please take a look when you get a chance.

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.

[Chainstate] Add support for an ephemeral MARF
4 participants