Skip to content

Commit

Permalink
feat: add ovm BlockFileCodec (paradigmxyz#12247)
Browse files Browse the repository at this point in the history
Co-authored-by: Emilia Hane <[email protected]>
  • Loading branch information
lean-apple and emhane authored Nov 12, 2024
1 parent aece53a commit 0cd34f9
Show file tree
Hide file tree
Showing 8 changed files with 439 additions and 23 deletions.
4 changes: 4 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

17 changes: 9 additions & 8 deletions crates/consensus/beacon/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,15 +73,16 @@ reth-exex-types.workspace = true
reth-prune-types.workspace = true
reth-chainspec.workspace = true
alloy-genesis.workspace = true

assert_matches.workspace = true

[features]
optimism = [
"reth-chainspec",
"reth-primitives/optimism",
"reth-provider/optimism",
"reth-blockchain-tree/optimism",
"reth-db/optimism",
"reth-db-api/optimism",
]
"reth-blockchain-tree/optimism",
"reth-chainspec",
"reth-db-api/optimism",
"reth-db/optimism",
"reth-downloaders/optimism",
"reth-primitives/optimism",
"reth-provider/optimism",
"reth-downloaders/optimism"
]
13 changes: 10 additions & 3 deletions crates/net/downloaders/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,9 @@ reth-metrics.workspace = true
metrics.workspace = true

# misc
tracing.workspace = true
rayon.workspace = true
thiserror.workspace = true
tracing.workspace = true

tempfile = { workspace = true, optional = true }
itertools.workspace = true
Expand All @@ -72,9 +72,16 @@ rand.workspace = true
tempfile.workspace = true

[features]
optimism = [
"reth-primitives/optimism",
"reth-db?/optimism",
"reth-db-api?/optimism",
"reth-provider/optimism"
]

test-utils = [
"dep:tempfile",
"dep:reth-db-api",
"tempfile",
"reth-db-api",
"reth-db/test-utils",
"reth-consensus/test-utils",
"reth-network-p2p/test-utils",
Expand Down
3 changes: 1 addition & 2 deletions crates/net/downloaders/src/file_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,8 @@ use tokio_stream::StreamExt;
use tokio_util::codec::FramedRead;
use tracing::{debug, trace, warn};

use crate::receipt_file_client::FromReceiptReader;

use super::file_codec::BlockFileCodec;
use crate::receipt_file_client::FromReceiptReader;

/// Default byte length of chunk to read from chain file.
///
Expand Down
26 changes: 20 additions & 6 deletions crates/optimism/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,15 @@ reth-node-builder.workspace = true
reth-tracing.workspace = true

# eth
alloy-eips.workspace = true
alloy-consensus = { workspace = true, optional = true }
alloy-primitives.workspace = true
alloy-rlp.workspace = true

# misc
futures-util.workspace = true
derive_more = { workspace = true, optional = true }
serde = { workspace = true, optional = true }
clap = { workspace = true, features = ["derive", "env"] }


Expand All @@ -67,9 +71,7 @@ eyre.workspace = true

# reth test-vectors
proptest = { workspace = true, optional = true }
op-alloy-consensus = { workspace = true, features = [
"arbitrary",
], optional = true }
op-alloy-consensus = { workspace = true, optional = true }


[dev-dependencies]
Expand All @@ -80,14 +82,19 @@ reth-cli-commands.workspace = true

[features]
optimism = [
"op-alloy-consensus",
"alloy-consensus",
"dep:derive_more",
"dep:serde",
"reth-primitives/optimism",
"reth-optimism-evm/optimism",
"reth-provider/optimism",
"reth-node-core/optimism",
"reth-optimism-node/optimism",
"reth-execution-types/optimism",
"reth-db/optimism",
"reth-db-api/optimism"
"reth-db-api/optimism",
"reth-downloaders/optimism"
]
asm-keccak = [
"alloy-primitives/asm-keccak",
Expand All @@ -104,6 +111,13 @@ jemalloc = [

dev = [
"dep:proptest",
"reth-cli-commands/arbitrary",
"op-alloy-consensus"
"reth-cli-commands/arbitrary"
]
serde = [
"alloy-consensus?/serde",
"alloy-eips/serde",
"alloy-primitives/serde",
"op-alloy-consensus?/serde",
"reth-execution-types/serde",
"reth-provider/serde"
]
5 changes: 5 additions & 0 deletions crates/optimism/cli/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ pub mod commands;
/// made for op-erigon's import needs).
pub mod receipt_file_codec;

/// OVM block, same as EVM block at bedrock, except for signature of deposit transaction
/// not having a signature back then.
/// Enables decoding and encoding `Block` types within file contexts.
pub mod ovm_file_codec;

pub use commands::{import::ImportOpCommand, import_receipts::ImportReceiptsOpCommand};
use reth_optimism_chainspec::OpChainSpec;

Expand Down
Loading

0 comments on commit 0cd34f9

Please sign in to comment.