Skip to content
This repository was archived by the owner on Jan 31, 2025. It is now read-only.

Commit 3e2d5fa

Browse files
authored
Merge branch 'main' into 0xkitsune/alloy
2 parents 2bfcbb2 + 35b36f9 commit 3e2d5fa

File tree

14 files changed

+112
-78
lines changed

14 files changed

+112
-78
lines changed

Cargo.lock

Lines changed: 52 additions & 45 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,8 @@ revm = { version = "12.1", features = ["alloydb", "optimism"] }
4646

4747
# Kona + OP Types
4848
superchain-registry = "0.2.6"
49-
kona-derive = { git = "https://github.com/ethereum-optimism/kona", rev = "4e57dd35ea08b31d0baa293c7a12165f28e6cd92", features = [
50-
"online",
51-
] }
49+
kona-primitives = { git = "https://github.com/ethereum-optimism/kona", version = "0.0.2", features = ["online"] }
50+
kona-derive = { git = "https://github.com/ethereum-optimism/kona", version = "0.0.3", features = ["online"] }
5251

5352
# Internal
5453
op-test-vectors = { path = "crates/op-test-vectors" }

README.md

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,14 +38,32 @@ Each has it's own cli tool to generate test fixtures. [opt8n](./bin/opt8n) can b
3838

3939
**`op-test-vectors`**
4040

41+
A rust crate exposing types used to generate test fixtures in [./fixtures](./fixtures/).
42+
43+
`op-test-vectors` contains two primary modules:
44+
4145
- [`execution`](./crates/op-test-vectors/src/execution.rs): Rust types for the execution test fixtures.
4246
- [`derivation`](./crates/op-test-vectors/src/derivation.rs): Rust types for the derivation test fixtures.
4347

44-
**`opt8n` Commands**
48+
**`opt8n`**
49+
50+
A binary to generate execution test fixtures.
51+
52+
`opt8n` has two subcommands:
4553

4654
- `repl`: Spins up a REPL that allows the user to send transactions to and generate a test fixture from those transactions.
4755
- `script`: Executes a forge script against an anvil instance and generates the test fixture.
4856

57+
**`opdn`**
58+
59+
A binary to generate derivation test fixtures.
60+
61+
`opdn` has the following subcommands:
62+
63+
- `from-l2`: Generates a derivation test fixture from the specified range of L2 blocks.
64+
- `from-l1`: Generates a derivation test fixture from the specified range of L1 blocks.
65+
- `info`: Outputs the L2 block info including the L1 origin for the given L2 block number.
66+
4967
## Book
5068

5169
The [book][book] contains an in-depth overview of the project, contributor guidelines, and tutorials for creating your own test fixtures as well as you own test runners.

bin/opdn/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,5 +30,6 @@ alloy-eips.workspace = true
3030

3131
# OP Types + Kona
3232
op-test-vectors.workspace = true
33+
kona-primitives.workspace = true
3334
kona-derive.workspace = true
3435
superchain-registry.workspace = true

bin/opdn/src/cmd/blobs.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use kona_derive::online::{
99
OnlineBeaconClient, OnlineBlobProviderWithFallback, SimpleSlotDerivation,
1010
};
1111
use kona_derive::traits::BlobProvider;
12-
use kona_derive::types::{Blob, BlockInfo, IndexedBlobHash};
12+
use kona_primitives::{Blob, BlockInfo, IndexedBlobHash};
1313

1414
/// Loads blobs for the given block number.
1515
pub async fn load(

bin/opdn/src/cmd/fixtures.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ use kona_derive::online::{
88
AlloyChainProvider, OnlineBeaconClient, OnlineBlobProviderWithFallback, SimpleSlotDerivation,
99
};
1010
use kona_derive::traits::ChainProvider;
11+
use kona_primitives::Blob;
1112
use op_test_vectors::derivation::FixtureBlock;
1213

1314
/// Constructs [FixtureBlock]s for the given L1 blocks.
@@ -21,7 +22,7 @@ pub async fn build_fixture_blocks(
2122
OnlineBeaconClient,
2223
SimpleSlotDerivation,
2324
>,
24-
) -> Result<Vec<FixtureBlock>> {
25+
) -> Result<Vec<FixtureBlock<Blob>>> {
2526
let mut fixtures = Vec::with_capacity(blocks.len());
2627
for b in blocks {
2728
let block_info = l1_provider

bin/opdn/src/cmd/from_l1.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@ use color_eyre::{
66
Result,
77
};
88
use hashbrown::HashMap;
9-
use kona_derive::{
10-
online::*,
11-
types::{L2BlockInfo, StageError},
12-
};
9+
use kona_derive::{errors::StageError, online::*};
10+
use kona_primitives::L2BlockInfo;
1311
use op_test_vectors::derivation::DerivationFixture;
1412
use reqwest::Url;
1513
use std::path::PathBuf;

bin/opdn/src/cmd/from_l2.rs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,8 @@ use color_eyre::{
66
Result,
77
};
88
use hashbrown::HashMap;
9-
use kona_derive::{
10-
online::*,
11-
types::{L2BlockInfo, StageError},
12-
};
9+
use kona_derive::{errors::StageError, online::*};
10+
use kona_primitives::L2BlockInfo;
1311
use op_test_vectors::derivation::DerivationFixture;
1412
use reqwest::Url;
1513
use std::path::PathBuf;

bin/opdn/src/cmd/util.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//! Utilities
22
3-
use kona_derive::types::{L2ExecutionPayloadEnvelope, L2PayloadAttributes, RawTransaction};
3+
use kona_primitives::{L2ExecutionPayloadEnvelope, L2PayloadAttributes, RawTransaction};
44

55
/// Converts an [L2ExecutionPayloadEnvelope] to an [L2PayloadAttributes].
66
pub fn to_payload_attributes(payload: L2ExecutionPayloadEnvelope) -> L2PayloadAttributes {

bin/range-finder/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,5 @@ alloy-eips.workspace = true
2727

2828
# OP Types + Kona
2929
kona-derive.workspace = true
30+
kona-primitives.workspace = true
3031
superchain-registry.workspace = true

0 commit comments

Comments
 (0)