diff --git a/Cargo.lock b/Cargo.lock index 40d887762ebe..e62d4a6a862c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -124,7 +124,7 @@ dependencies = [ "c-kzg", "derive_more 1.0.0", "serde", - "serde_with", + "serde_with 3.11.0", ] [[package]] @@ -186,7 +186,7 @@ dependencies = [ "k256", "rand 0.8.5", "serde", - "serde_with", + "serde_with 3.11.0", ] [[package]] @@ -430,9 +430,9 @@ dependencies = [ [[package]] name = "alloy-rlp" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26154390b1d205a4a7ac7352aa2eb4f81f391399d4e2f546fb81a2f8bb383f62" +checksum = "da0822426598f95e45dd1ea32a738dac057529a709ee645fcc516ffa4cbde08f" dependencies = [ "alloy-rlp-derive", "arrayvec", @@ -441,9 +441,9 @@ dependencies = [ [[package]] name = "alloy-rlp-derive" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d0f2d905ebd295e7effec65e5f6868d153936130ae718352771de3e7d03c75c" +checksum = "2b09cae092c27b6f1bde952653a22708691802e57bfef4a2973b80bea21efd3f" dependencies = [ "proc-macro2", "quote", @@ -533,7 +533,7 @@ dependencies = [ "alloy-primitives", "alloy-rpc-types-engine 0.4.2", "serde", - "serde_with", + "serde_with 3.11.0", "thiserror", ] @@ -1852,7 +1852,7 @@ dependencies = [ "anstream", "anstyle", "clap_lex", - "strsim", + "strsim 0.11.1", ] [[package]] @@ -2318,14 +2318,38 @@ dependencies = [ "syn 2.0.79", ] +[[package]] +name = "darling" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a01d95850c592940db9b8194bc39f4bc0e89dee5c4265e4b1807c34a9aba453c" +dependencies = [ + "darling_core 0.13.4", + "darling_macro 0.13.4", +] + [[package]] name = "darling" version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6f63b86c8a8826a49b8c21f08a2d07338eec8d900540f8630dc76284be802989" dependencies = [ - "darling_core", - "darling_macro", + "darling_core 0.20.10", + "darling_macro 0.20.10", +] + +[[package]] +name = "darling_core" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "859d65a907b6852c9361e3185c862aae7fafd2887876799fa55f5f99dc40d610" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim 0.10.0", + "syn 1.0.109", ] [[package]] @@ -2338,17 +2362,28 @@ dependencies = [ "ident_case", "proc-macro2", "quote", - "strsim", + "strsim 0.11.1", "syn 2.0.79", ] +[[package]] +name = "darling_macro" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c972679f83bdf9c42bd905396b6c3588a843a17f0f16dfcfa3e2c5d57441835" +dependencies = [ + "darling_core 0.13.4", + "quote", + "syn 1.0.109", +] + [[package]] name = "darling_macro" version = "0.20.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d336a2a514f6ccccaa3e09b02d41d35330c07ddf03a62165fcec10bb561c7806" dependencies = [ - "darling_core", + "darling_core 0.20.10", "quote", "syn 2.0.79", ] @@ -5306,7 +5341,7 @@ dependencies = [ "arbitrary", "derive_more 1.0.0", "serde", - "serde_with", + "serde_with 3.11.0", "spin", ] @@ -6892,6 +6927,7 @@ dependencies = [ "serde_json", "strum", "sysinfo", + "taiko-reth-primitives", "tempfile", "test-fuzz", "thiserror", @@ -7038,7 +7074,7 @@ dependencies = [ "schnellru", "secp256k1", "serde", - "serde_with", + "serde_with 3.11.0", "thiserror", "tokio", "tokio-stream", @@ -7538,7 +7574,7 @@ dependencies = [ "reth-trie", "revm", "serde", - "serde_with", + "serde_with 3.11.0", ] [[package]] @@ -7631,7 +7667,7 @@ dependencies = [ "reth-execution-types", "reth-primitives", "serde", - "serde_with", + "serde_with 3.11.0", ] [[package]] @@ -7744,7 +7780,7 @@ dependencies = [ "if-addrs", "reqwest", "reth-tracing", - "serde_with", + "serde_with 3.11.0", "thiserror", "tokio", "tracing", @@ -7862,7 +7898,7 @@ dependencies = [ "rand 0.8.5", "secp256k1", "serde_json", - "serde_with", + "serde_with 3.11.0", "thiserror", "tokio", "url", @@ -8474,7 +8510,7 @@ dependencies = [ "secp256k1", "serde", "serde_json", - "serde_with", + "serde_with 3.11.0", "test-fuzz", "zstd", ] @@ -8503,7 +8539,7 @@ dependencies = [ "roaring", "serde", "serde_json", - "serde_with", + "serde_with 3.11.0", "test-fuzz", ] @@ -9237,7 +9273,7 @@ dependencies = [ "revm", "serde", "serde_json", - "serde_with", + "serde_with 3.11.0", "tokio", "tracing", "triehash", @@ -9972,9 +10008,20 @@ dependencies = [ [[package]] name = "serde_with" -version = "3.10.0" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "678b5a069e50bf00ecd22d0cd8ddf7c236f68581b03db652061ed5eb13a312ff" +dependencies = [ + "base64 0.13.1", + "serde", + "serde_with_macros 1.5.2", +] + +[[package]] +name = "serde_with" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9720086b3357bcb44fce40117d769a4d068c70ecfa190850a980a71755f66fcc" +checksum = "8e28bdad6db2b8340e449f7108f020b3b092e8583a9e3fb82713e1d4e71fe817" dependencies = [ "base64 0.22.1", "chrono", @@ -9984,17 +10031,29 @@ dependencies = [ "serde", "serde_derive", "serde_json", - "serde_with_macros", + "serde_with_macros 3.11.0", "time", ] [[package]] name = "serde_with_macros" -version = "3.10.0" +version = "1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e182d6ec6f05393cc0e5ed1bf81ad6db3a8feedf8ee515ecdd369809bcce8082" +dependencies = [ + "darling 0.13.4", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "serde_with_macros" +version = "3.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f1abbfe725f27678f4663bcacb75a83e829fd464c25d78dd038a3a29e307cec" +checksum = "9d846214a9854ef724f3da161b426242d8de7c1fc7de2f89bb1efcb154dca79d" dependencies = [ - "darling", + "darling 0.20.10", "proc-macro2", "quote", "syn 2.0.79", @@ -10286,6 +10345,12 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9091b6114800a5f2141aee1d1b9d6ca3592ac062dc5decb3764ec5895a47b4eb" +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + [[package]] name = "strsim" version = "0.11.1" @@ -10435,15 +10500,18 @@ version = "1.1.0" dependencies = [ "alloy-eips 0.4.2", "alloy-primitives", + "alloy-rlp", "alloy-rpc-types 0.4.2", "alloy-rpc-types-engine 0.4.2", + "alloy-serde 0.4.2", "reth-chainspec", "reth-engine-primitives", "reth-ethereum-engine-primitives", "reth-payload-primitives", "reth-primitives", "reth-rpc-types-compat", - "serde_with", + "serde", + "serde_with 1.14.0", "sha2 0.10.8", "taiko-reth-primitives", ] @@ -10453,6 +10521,7 @@ name = "taiko-reth-primitives" version = "1.1.0" dependencies = [ "alloy-primitives", + "alloy-rlp", "reth-db-api", "serde", ] @@ -10511,7 +10580,7 @@ version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a7e6b4c7391a38f0f026972ec2200bcfd1ec45533aa266fdae5858d011afc500" dependencies = [ - "darling", + "darling 0.20.10", "heck", "itertools 0.13.0", "once_cell", diff --git a/Cargo.toml b/Cargo.toml index 3edaae098785..f849863040ff 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -148,6 +148,8 @@ members = [ "examples/txpool-tracing/", "testing/ef-tests/", "testing/testing-utils", + "crates/taiko/primitives", + "crates/taiko/engine-primitives", ] default-members = ["bin/reth"] exclude = ["book/sources"] diff --git a/crates/taiko/engine-primitives/Cargo.toml b/crates/taiko/engine-primitives/Cargo.toml index 1e01a6bdfbfd..122e279584bb 100644 --- a/crates/taiko/engine-primitives/Cargo.toml +++ b/crates/taiko/engine-primitives/Cargo.toml @@ -13,8 +13,6 @@ alloy-eips.workspace = true alloy-primitives.workspace = true alloy-rpc-types.workspace = true alloy-rpc-types-engine.workspace = true -serde_with.workspace = true -sha2.workspace = true # reth reth-payload-primitives.workspace = true @@ -26,6 +24,12 @@ reth-chainspec.workspace = true # taiko taiko-reth-primitives.workspace = true +serde.workspace = true +alloy-rlp.workspace = true +alloy-serde.workspace = true + +serde_with = { version = "1.11", features = ["base64"] } +sha2 = "0.10.8" [lints] workspace = true diff --git a/crates/taiko/engine-primitives/src/payload.rs b/crates/taiko/engine-primitives/src/payload.rs index f0b368b8befd..ce7e7ed64838 100644 --- a/crates/taiko/engine-primitives/src/payload.rs +++ b/crates/taiko/engine-primitives/src/payload.rs @@ -1,16 +1,22 @@ use alloy_eips::eip4844::BlobTransactionSidecar; use alloy_eips::eip4895::Withdrawal; use alloy_primitives::{Address, Bytes, B256}; -use alloy_primitives::private::alloy_rlp::{Encodable, RlpDecodable, RlpEncodable}; -use alloy_primitives::private::serde::{Deserialize, Serialize}; +use alloy_primitives::private::alloy_rlp::{Encodable}; use alloy_primitives::ruint::aliases::U256; +use alloy_rlp::{RlpDecodable, RlpEncodable}; use alloy_rpc_types::engine::{ExecutionPayloadEnvelopeV4, PayloadAttributes, PayloadId}; use alloy_rpc_types_engine::{ExecutionPayload, ExecutionPayloadEnvelopeV3, ExecutionPayloadV1, ExecutionPayloadV2}; -use serde_with::serde_as; +use serde::{Serialize, Deserialize}; +use serde_with::{serde_as, base64::Base64}; use reth_ethereum_engine_primitives::EthPayloadBuilderAttributes; use reth_payload_primitives::{BuiltPayload, EngineApiMessageVersion}; use reth_primitives::SealedBlock; -use reth_rpc_types_compat::engine::payload::{block_to_payload_v1, block_to_payload_v2, block_to_payload_v3, block_to_payload_v4}; +use reth_rpc_types_compat::engine::payload::{ + block_to_payload_v1, + block_to_payload_v2, + block_to_payload_v3, + block_to_payload_v4, +}; use taiko_reth_primitives::L1Origin; /// Taiko Payload Attributes diff --git a/crates/taiko/primitives/Cargo.toml b/crates/taiko/primitives/Cargo.toml index 834f7408c008..4904c1fc43cd 100644 --- a/crates/taiko/primitives/Cargo.toml +++ b/crates/taiko/primitives/Cargo.toml @@ -6,7 +6,6 @@ rust-version.workspace = true license.workspace = true homepage.workspace = true repository.workspace = true -exclude.workspace = true description = "Taiko primitive types" [dependencies] @@ -14,6 +13,7 @@ description = "Taiko primitive types" reth-db-api.workspace = true alloy-primitives.workspace = true serde.workspace = true +alloy-rlp.workspace = true [lints] workspace = true diff --git a/crates/taiko/primitives/src/l1_origin.rs b/crates/taiko/primitives/src/l1_origin.rs index b9012fe0645f..474eae51b227 100644 --- a/crates/taiko/primitives/src/l1_origin.rs +++ b/crates/taiko/primitives/src/l1_origin.rs @@ -1,4 +1,5 @@ use alloy_primitives::{B256, U256}; +use alloy_rlp::{RlpDecodable, RlpEncodable}; use serde::{Deserialize, Serialize}; use reth_db_api::DatabaseError; use reth_db_api::table::{Decode, Encode}; @@ -28,10 +29,12 @@ impl Decode for HeadL1OriginKey { } /// L1Origin represents a L1Origin of a L2 block. -#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)] +#[derive(Debug, Clone, PartialEq, PartialOrd, Eq, RlpDecodable, RlpEncodable, Serialize, Deserialize)] +#[rlp(rename_all = "camelCase")] #[serde(rename_all = "camelCase")] pub struct L1Origin { /// The block number of the l2 block + #[rlp(rename = "blockID")] #[serde(rename = "blockID")] pub block_id: U256, /// The hash of the l2 block diff --git a/crates/taiko/storage/src/l1_origin.rs b/crates/taiko/storage/src/l1_origin.rs deleted file mode 100644 index e69de29bb2d1..000000000000