Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add ovm BlockFileCodec #12247

Merged
merged 31 commits into from
Nov 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
896016a
draft: copy BlockFileCodec to create ovm blockfile codec
lean-apple Oct 31, 2024
40256df
Move ovm block codec into reth-optimism-cli
emhane Nov 4, 2024
af9dc68
Copy Block into ovm block codec
emhane Nov 4, 2024
fe04465
fixup! Move ovm block codec into reth-optimism-cli
emhane Nov 4, 2024
62f5a85
refactor: v1 for complete ovm file codec - needs to double check
lean-apple Nov 5, 2024
933b426
fix: fix import
lean-apple Nov 5, 2024
c6dc713
chore: remove useless fmt changes
lean-apple Nov 5, 2024
bde90a8
merge: main into ovm-block-file-codec
lean-apple Nov 5, 2024
929be8b
fix: signature import
lean-apple Nov 5, 2024
2e612c7
fix: fix optimis feature deps
lean-apple Nov 5, 2024
ad2a050
fix: fix for zepter - feature propragation
lean-apple Nov 5, 2024
fb8f9b6
fix: fix doc
lean-apple Nov 5, 2024
641d392
fix: make clippy and zepter happy
lean-apple Nov 5, 2024
717bc3f
refactor: move back ovm file codec to optimism cli without integration
lean-apple Nov 7, 2024
ada04f1
refactor: adapt tx signed and recovered for optimism
lean-apple Nov 7, 2024
afd6ff2
test: add first basic deposit tx
lean-apple Nov 7, 2024
e05a1c5
test: add first batch of tests for decoding tx in optimism
lean-apple Nov 7, 2024
3adb33a
chore: update ovm file codec with new changes in signature
lean-apple Nov 7, 2024
b72d39e
test: complete and gather some tests
lean-apple Nov 7, 2024
3c216c7
chore: clippy
lean-apple Nov 7, 2024
3a54186
refactor: clean encoding part
lean-apple Nov 8, 2024
e251a52
Merge branch 'main' into ovm-block-file-codec
lean-apple Nov 8, 2024
f810842
chore: clean comments
lean-apple Nov 8, 2024
d5818a0
fix: clippy
lean-apple Nov 8, 2024
6b67fbd
refactor: remove useless fns + TransactionSignedEcRecovered
lean-apple Nov 12, 2024
2382bc3
fix: fix import
lean-apple Nov 12, 2024
e02d116
Merge branch 'main' into ovm-block-file-codec
lean-apple Nov 12, 2024
a110044
Merge branch 'main' into ovm-block-file-codec
lean-apple Nov 12, 2024
1d20079
fix: add dynamic fee getter
lean-apple Nov 12, 2024
a757f78
refactor: remove redundant trait impl
lean-apple Nov 12, 2024
41f23e1
test: add eip 1559 type test
lean-apple Nov 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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 @@ -45,9 +45,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 @@ -71,9 +71,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
Loading