#pipeline #derivation #stack #op #source #l2 #traits

kona-derive

A no_std derivation pipeline implementation for the OP Stack

12 releases

0.2.3 Jan 16, 2025
0.2.0 Dec 4, 2024
0.1.0 Nov 20, 2024
0.0.2 Jun 22, 2024
0.0.1 Feb 22, 2024

#3 in #l2

Download history 127/week @ 2024-10-21 189/week @ 2024-10-28 189/week @ 2024-11-04 59/week @ 2024-11-11 298/week @ 2024-11-18 4/week @ 2024-11-25 180/week @ 2024-12-02 163/week @ 2024-12-09 59/week @ 2024-12-16 40/week @ 2024-12-23 26/week @ 2024-12-30 172/week @ 2025-01-06 306/week @ 2025-01-13 43/week @ 2025-01-20 19/week @ 2025-01-27 32/week @ 2025-02-03

413 downloads per month
Used in 9 crates (6 directly)

MIT license

1MB
7.5K SLoC

kona-derive

CI Kona Derive License Codecov

A no_std compatible implementation of the OP Stack's derivation pipeline.

Usage

The intended way of working with kona-derive is to use the DerivationPipeline which implements the Pipeline trait. To create an instance of the DerivationPipeline, it's recommended to use the PipelineBuilder as follows.

use std::sync::Arc;
use maili_genesis::RollupConfig;
use kona_derive::sources::EthereumDataSource;
use kona_derive::pipeline::PipelineBuilder;
use kona_derive::attributes::StatefulAttributesBuilder;

let chain_provider = todo!();
let l2_chain_provider = todo!();
let blob_provider = todo!();
let l1_origin = todo!();

let cfg = Arc::new(RollupConfig::default());
let attributes = StatefulAttributesBuilder::new(
   cfg.clone(),
   l2_chain_provider.clone(),
   chain_provider.clone(),
);
let dap = EthereumDataSource::new(
   chain_provider.clone(),
   blob_provider,
   cfg.as_ref()
);

// Construct a new derivation pipeline.
let pipeline = PipelineBuilder::new()
   .rollup_config(cfg)
   .dap_source(dap)
   .l2_chain_provider(l2_chain_provider)
   .chain_provider(chain_provider)
   .builder(attributes)
   .origin(l1_origin)
   .build();

Features

The most up-to-date feature list will be available on the docs.rs Feature Flags tab of the kona-derive crate.

Some features include the following.

  • serde: Serialization and Deserialization support for kona-derive types.
  • test-utils: Test utilities for downstream libraries.

By default, kona-derive enables the serde feature.

Dependencies

~33MB
~671K SLoC