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
The intended way of working with `kona-derive` is to use the [`DerivationPipeline`][dp] which implements the [`Pipeline`][p] trait. To create an instance of the [`DerivationPipeline`][dp], it's recommended to use the [`PipelineBuilder`][pb] as follows.
14
+
15
+
```rust,ignore
16
+
use std::sync::Arc;
17
+
use op_alloy_genesis::RollupConfig;
18
+
use kona_derive::sources::EthereumDataSource;
19
+
use kona_derive::pipeline::PipelineBuilder;
20
+
use kona_derive::stages::{StatefulAttributesBuilder};
21
+
22
+
let chain_provider = ...;
23
+
let l2_chain_provider = ...;
24
+
let blob_provider = ...;
25
+
let l1_origin = ...;
26
+
27
+
let cfg = Arc::new(RollupConfig::default());
28
+
let attributes = StatefulAttributesBuilder::new(
29
+
cfg.clone(),
30
+
l2_chain_provider.clone(),
31
+
chain_provider.clone(),
32
+
);
33
+
let dap = EthereumDataSource::new(
34
+
chain_provider.clone(),
35
+
blob_provider,
36
+
cfg.as_ref()
37
+
);
38
+
39
+
// Construct a new derivation pipeline.
40
+
let pipeline = PipelineBuilder::new()
41
+
.rollup_config(cfg)
42
+
.dap_source(dap)
43
+
.l2_chain_provider(l2_chain_provider)
44
+
.chain_provider(chain_provider)
45
+
.builder(attributes)
46
+
.origin(l1_origin)
47
+
.build();
48
+
```
49
+
50
+
[p]: ./src/traits/pipeline.rs
51
+
[pb]: ./src/pipeline/builder.rs
52
+
[dp]: ./src/pipeline/core.rs
53
+
11
54
## Features
12
55
13
56
The most up-to-date feature list will be available on the [docs.rs `Feature Flags` tab][ff] of the `kona-derive` crate.
14
57
15
58
Some features include the following.
16
59
-`serde`: Serialization and Deserialization support for `kona-derive` types.
17
-
-`k256`: [secp256k1][k] public key recovery support.
60
+
-`metrics`: Enables prometheus metric collection. _Note: This requires an `std` environment._
18
61
-`online`: Exposes an [alloy-provider][ap] powered data source using "online" HTTP requests.
62
+
-`test-utils`: Test utilities for downstream libraries.
19
63
20
-
By default, `kona-derive` enables features `serde` and `k256`.
21
-
22
-
Key recovery using the [secp256k1][k] curve sits behind a `k256` feature flag so that when compiled in `offline` mode,
23
-
secp recovery can fall through to the fpp host, accelerating key recovery. This was necessary since invalid instructions
24
-
were found when compiling `k256` recovery down to a bare-metal MIPS target. Since public key recovery requires elliptic
25
-
curve pairings, `k256` fall-through host recovery should drastically accelerate derivation on the FPVM.
64
+
By default, `kona-derive` enables the `serde` feature.
0 commit comments