The DA Compression Service is a dedicated service within fuel-core responsible for compressing block data before submission to the Data Availability (DA) layer (Ethereum L1). This service operates independently to reduce the cost of posting transaction data to the DA layer by compressing blocks and maintaining a temporal registry of compression state. For information about the relayer service that handles DA layer synchronization, see Relayer Service Architecture.
Sources: CHANGELOG.md152-162
The DA Compression Service was introduced in version 0.42.0 as a dedicated service, replacing the previous off-chain worker approach. The service processes blocks produced by the block producer and compresses them before they are submitted to the DA layer, significantly reducing gas costs for data availability.
Figure: DA Compression Service Architecture
The service uses outputs (not events) from executed blocks as the primary data source for compression operations.
Sources: CHANGELOG.md152-162 CHANGELOG.md233-234 CHANGELOG.md69-71
The DA Compression Service maintains a dedicated database domain within the CombinedDatabase system. This database stores compression-related state including temporal registries and merkleized tables.
| Component | Type | Purpose |
|---|---|---|
CompressionDatabase | Domain-specific DB | Primary storage for compression data |
Registrations | Merkleized Table | Stores temporal registry with merkle root |
| Compression State | Temporal Data | Maintains compression history for rewind capability |
The database integrates with the broader storage architecture:
Figure: Compression Database Integration
The Registrations table is merkleized to produce a registry root that is included in compressed block headers. This root represents the state of the temporal registry after compression operations.
Sources: CHANGELOG.md79-80 CHANGELOG.md81-82 CHANGELOG.md137-139
The DA Compression Service receives block data from the block production pipeline and processes it through the compression logic before making it available to the relayer.
Figure: Compression Service Data Flow
Key aspects of the data flow:
Sources: CHANGELOG.md69-71 CHANGELOG.md137-139 CHANGELOG.md81-82
The compression service can be configured to start syncing from a specific block height rather than from genesis. This is useful for networks that want to enable compression after the chain has already been running.
CLI Argument:
--da-compression-starting-height <HEIGHT>: Override the starting height for compression database synchronizationWhen this argument is provided, the service will not attempt to sync the compression database from genesis, avoiding unnecessary processing of historical blocks.
Figure: Compression Service Initialization Flow
Sources: CHANGELOG.md116-117 CHANGELOG.md126-128
The compression logic accepts a Config reference for configuration:
| Configuration Aspect | Impact |
|---|---|
| Compression Mode | DaCompressionMode configuration (implementation details in compression crate) |
| Registry Management | Controls temporal registry update behavior |
| Evictor Cache | Registry root calculation excludes evictor cache state |
Sources: CHANGELOG.md140-142 CHANGELOG.md97-98
The temporal registry tracks compression-related state over time. This registry is merkleized to produce a commitment that is included in compressed block headers, ensuring verifiability of the compression process.
Figure: Registry Merkleization Process
Key properties:
Sources: CHANGELOG.md137-139 CHANGELOG.md97-98
The compression database supports state rewind operations, allowing the service to roll back to previous states. This is essential for maintaining consistency when chain reorganizations occur or when historical state needs to be accessed.
Figure: Compression DB State Rewind State Machine
The state rewind capability ensures that:
Sources: CHANGELOG.md81-82
The compression service is tightly integrated with the block production pipeline:
Figure: Compression Integration with Block Production
The producer calls the compression service after block execution, passing the block outputs (not events) for compression. The compressed result is then available to the relayer for DA layer submission.
Sources: CHANGELOG.md69-71 CHANGELOG.md152-162
| Property | Value | Description |
|---|---|---|
| Service Location | crates/services/compression | Dedicated service crate |
| Compression Logic | crates/compression | Core compression algorithms |
| Database Domain | CompressionDatabase | Part of CombinedDatabase |
| Input Data | Block Outputs | Uses outputs, not events |
| Registry Type | Temporal + Merkleized | Supports time-based queries and verification |
| State Management | Rewindable | Supports rollback to previous heights |
Sources: CHANGELOG.md152-162 CHANGELOG.md69-71 CHANGELOG.md81-82 CHANGELOG.md116-117
Refresh this wiki