You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Adds the durable-commit applier, the two-stage JMT commit pipeline,
and the AptosDB integration for native positions. Builds on the
durable storage tier in `[storage-core-db]` and the shared primitives
in `[shared] LeafEntry trait + StateSummary Option` / `[shared] Lift
async-commit pipeline`.
The in-memory scanner mirror (the `NativeStateStore` DashMap and
its readers) is layered on top in a later `[in-memory-store]`
commit; the durable + JMT side here stands on its own.
Commit applier:
- `NativeStateCommitter::apply`: per-shard `SchemaBatch` fan-out
against `position_db` for every Position write, returning
`NativeMerkleLeafUpdates` (`MerkleLeafUpdate` per write) for
the JMT pipeline. Stale-index entries for prior versions are
written into the same batch so the pruner can drop them later.
Commit pipeline:
- `PositionBufferedState` — alias of the shared
`BufferedState<L, S, P, X>` generic with position's pipeline
parameters and a no-op `PositionExtras`. Constructed via
`spawn_commit_pipeline`.
- `PositionSnapshotCommitter` driver (`merklize_position`): pulls
`PositionSnapshotToCommit` payloads, runs the snapshot through
`ShardedJmtMerkleDb::merklize_snapshot`, forwards the resulting
`PositionMerkleCommit` downstream.
- `PositionMerkleBatchCommitter`: pulls `PositionMerkleCommit`s and
persists per-shard JMT batches + top-levels batch to
`position_merkle_db`.
State-shape primitives in `storage-interface`:
`storage/storage-interface/src/state_store/sharded_jmt_state.rs`
with the JMT-sharded pipeline primitives that aren't main-state
shared: `LeafSlot<V>` + `impl LeafEntry for LeafSlot<V>`,
`ShardedJmtState<Slot>` (16 `MapLayer` chains + `extend` /
`make_delta` / `is_descendant_of`), the inherent impl on
`StateAndSummary<ShardedJmtState<Slot: LeafEntry>>`
(`new_empty`, `extend`, `make_delta`, etc.), and
`pre_shard_jmt_updates`. Adds two `StateSummary` constructors
that only JMT-sharded pipelines without a hot companion need:
`new_global_only(version, smt)` and `new_empty_global_only()`.
In-aptosdb crate:
- `PositionSlot` — type alias of `LeafSlot<()>` (value not carried
in-slot; lives in `position_db` durably).
- `PositionStateStore` — owner / coordinator, type alias of the
shared `PipelineStateStore<L, BS>` (also added in this commit,
in `crate::common`). Wraps the shared `current_state` mutex
(readable by outside consumers) and the `PositionBufferedState`
mutex (commit-path serialization).
- `PositionDb` gains the `commit` / `commit_single_shard` /
`write_progress` / `find_prior_version` methods that the
committer uses.
AptosDB wiring:
- `AptosDB` gains optional handles for `PositionDb` +
`PositionMerkleDb` + `PositionStateStore`. Accessed by the rest
of the codebase via `native_position_handles` /
`native_state_committer`.
- `init_native_position`: opens 16 sharded position DBs +
unsharded merkle DB with production CF tuning. Spawns the
async commit pipeline seeded with the empty-tree placeholder
root. Idempotent (rejects second call). Logs the open.
- `commit_native_position` (in `aptosdb_writer.rs`): rayon-spawned
alongside main-state commit; drains
`output.write_set().native_position_iter()` (the WriteSet
sibling bucket from [types]) through `NativeStateCommitter`,
feeding the resulting `MerkleLeafUpdate`s into the position
JMT pipeline.
Cargo.toml deps + lib.rs mod exports for the new files.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments