Skip to content

Latest commit

 

History

History
196 lines (168 loc) · 10.8 KB

layout.md

File metadata and controls

196 lines (168 loc) · 10.8 KB

Repository layout

This page lists each crate and what it does. Package names are in parentheses; most carry a strata- prefix. For details, read the doc comment at the top of each crate's src/lib.rs. The workspace builds bin/strata, bin/strata-dbtool, bin/strata-signer, bin/datatool and bin/strata-test-cli by default; check default-members in the root Cargo.toml before assuming another crate builds.

OL state transition

These crates make up the OL STF. The checkpoint guest compiles them, so a change here can change the checkpoint verifying key (see ol-specs.md).

  • crates/ol/stf (strata-ol-stf): the versioned STF entry point. It dispatches each operation on OLSpecId.
  • crates/ol/stf-v* (strata-ol-stf-v*): the versioned rules: block, epoch, manifest and transaction processing.
  • crates/ol/state-types (strata-ol-state-types): state accessor traits, ledger entry types, OLSpecId and the fixed OLRootState.
  • crates/ol/state-types-v* (strata-ol-state-types-v*): OLStateV* and its parts: global, epochal, ledger and snark account state.
  • crates/ol/state-container (strata-ol-state-container): OLStateContainer, OLStateSeries, the spec-to-layout map and the container's serde form.
  • crates/ol/state-support-types (strata-ol-state-support-types): state access layers: the in-memory base layer, write batches, write tracking and the indexer.
  • crates/ol/chain-types-v* (strata-ol-chain-types-v*): OL block types. Re-exports the OL log types from strata-common.
  • crates/ol/tx-types-v* (strata-ol-tx-types-v*): OL transactions, their payloads and transaction proofs.
  • crates/ol/msg-types (strata-ol-msg-types): deposit and withdrawal message types.
  • crates/ol/da-common (strata-ol-da-common): DA traits and encoding helpers shared by DA payload versions.
  • crates/ol/da-types-v* (strata-ol-da-types-v*): the versioned DA payload, its scheme and the checkpoint transaction extractor.
  • crates/ol/params (strata-ol-params): OLGenesisParams, OLRuntimeParams and OLParams.
  • crates/da-framework (strata-da-framework): DA diff primitives: DaRegister, DaCounter, DaLinacc, DaQueue and compound types.

Accounts and bridge

OL node services

  • crates/chain-worker (strata-chain-worker): executes and persists OL blocks and epochs.
  • crates/consensus-logic (strata-consensus-logic): fork choice, checkpoint sync, the unfinalized block tracker, MMR reconciliation and the ASM and CSM worker contexts.
  • crates/csm-worker (strata-csm-worker): follows the ASM worker and turns checkpoint logs into client state.
  • crates/ol/canonical-chain-provider (strata-ol-canonical-chain-provider): read-only canonical block and epoch queries, from fork choice or from finalized checkpoints.
  • crates/ol/spec-selection (strata-ol-spec-selection): selects the next epoch's spec from stored epoch summaries and manifests. Not in the guest.
  • crates/ol/state-provider (strata-ol-state-provider): traits and implementations for reading OL state.
  • crates/ol/mmr-index (strata-ol-mmr-index): compares and reconciles OL-owned MMRs with the database index.
  • crates/ol/genesis (strata-ol-genesis): builds the OL genesis state and block.
  • crates/ol/checkpoint (strata-ol-checkpoint): the checkpoint builder and the tracker for checkpoints the ASM rejected.
  • crates/ol/rpc/api and types (strata-ol-rpc-api, strata-ol-rpc-types): the OL JSON-RPC traits and wire types.

Sequencer

Bitcoin I/O

  • crates/btcio (strata-btcio): the L1 reader, the envelope writer and bundler, fee bumping and the broadcaster.

Bitcoin primitives, header verification and SPS-50 parsing come from the pinned strata-common and asm crates.

Storage

Proofs

Shared

Binaries

  • bin/strata (strata): the node. Sequencer, full node, RPC and the in-process prover behind the prover and sp1 features.
  • bin/strata-signer (strata-signer-bin, binary strata-signer): the detached sequencer signer.
  • bin/strata-dbtool (strata-dbtool): offline database inspection and repair.
  • bin/datatool (strata-datatool): generates keys and the ASM and OL parameter files.
  • bin/strata-test-cli (strata-test-cli): builds bridge and EE transactions for the functional tests, and includes mock EE helpers.
  • bin/prover-perf (strata-provers-perf): proof performance reports.

The downstream alpen-ee repository builds strata, strata-signer, strata-datatool and strata-test-cli from a pinned revision for its own functional tests, so their CLIs are public interfaces.

Tests

Other

  • contrib: style and TODO check scripts used by just lint, and dev helpers.
  • docker: images and compose files for a local signet and sequencer stack.
  • .github/workflows: CI, the checkpoint VK guard and the SP1 artifact publisher.

Shared protocol types come from strata-common and the ASM from asm. Both are pinned by tag in the root Cargo.toml.

Every crate shares one version, set in [workspace.package] in the root Cargo.toml. It matches the release tag, so bump it to the new version before tagging. The SP1 guest in provers/sp1/guest-checkpoint is its own workspace and sets the same version directly.