How matter-labs/zksync-os-server works
ZKsync OS Server is a ZK Stack sequencer. Its principal workflow accepts transactions through JSON-RPC, executes them into blocks, forms batches, obtains proofs, and submits batch operations to L1; state and API data are persisted separately. The repository also includes peer networking, L1 event watchers, and replay storage. The README documents the broad sequencer-to-batcher and downstream separation; several implementation links below are dashed because the relevant orchestration source was not sampled.
Main entry points: block_executor.rs Block Execution · fri_proving_pipeline_step.rs FRI Pipeline · pipeline_component.rs L1 Sender · tx_handler.rs JSON-RPC
Components 16
Transaction Ingress
- JSON-RPC
lib/rpc/src/tx_handler.rs - Transaction Pool
lib/mempool/src/pool.rs
Sequencing and State
- Block Execution
lib/sequencer/src/execution/block_executor.rs - Persistent State
lib/storage/src/db/repository.rs
Batch and Proof
- Batch Builder
node/bin/src/batcher/batch_builder.rs - Prover Input
node/bin/src/prover_input_generator/mod.rs - FRI Pipeline
node/bin/src/prover_api/fri_proving_pipeline_step.rs - FRI Job Manager
node/bin/src/prover_api/fri_job_manager.rs - Proof Storage
node/bin/src/prover_api/proof_storage.rs
L1 Integration
- L1 Sender
lib/l1_sender/src/pipeline_component.rs - L1 Operations
lib/l1_sender/src/commands/mod.rs - L1 Watchers
lib/l1_watcher/src/watcher.rs
Node Services
- Peer Network
lib/network/src/service.rs - Replay Archive
lib/replay_archive/src/component.rs
Other components
- RPC Client
- L1 Network
Connections 14
- RPC Client → JSON-RPC: submits transactions
README.md - JSON-RPC → Transaction Pool: forwards transactions
- Transaction Pool → Block Execution: supplies transactions
- Block Execution → Persistent State: persists state
README.md - Block Execution → Batch Builder: produces blocks
README.md - Batch Builder → Prover Input: generates inputs
- Prover Input → FRI Pipeline: feeds proving
- FRI Pipeline → FRI Job Manager: adds jobs
node/bin/src/prover_api/fri_proving_pipeline_step.rs - FRI Job Manager → Proof Storage: stores failures
node/bin/src/prover_api/fri_job_manager.rs - FRI Pipeline → L1 Sender: forwards proofs
- L1 Sender → L1 Operations: runs operations
lib/l1_sender/src/pipeline_component.rs - L1 Sender → L1 Network: submits batches
- L1 Network → L1 Watchers: emits events
- Peer Network → L1 Watchers: coordinates updates