From ee1df5231a121b82abcdfcbff87d6bbf25b73036 Mon Sep 17 00:00:00 2001 From: Aditya Bisht Date: Wed, 29 Jan 2025 10:58:29 +0000 Subject: [PATCH 1/2] fix: op dev chain transaction --- Cargo.lock | 2 ++ crates/engine/local/Cargo.toml | 3 +++ crates/engine/local/src/payload.rs | 6 +++++- crates/optimism/chainspec/src/constants.rs | 10 ++++++++++ 4 files changed, 20 insertions(+), 1 deletion(-) diff --git a/Cargo.lock b/Cargo.lock index 09ac2d8a56da..6966651478c3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7089,6 +7089,7 @@ dependencies = [ name = "reth-engine-local" version = "1.1.5" dependencies = [ + "alloy-chains", "alloy-consensus", "alloy-primitives", "alloy-rpc-types-engine", @@ -7103,6 +7104,7 @@ dependencies = [ "reth-ethereum-engine-primitives", "reth-evm", "reth-node-types", + "reth-optimism-chainspec", "reth-payload-builder", "reth-payload-builder-primitives", "reth-payload-primitives", diff --git a/crates/engine/local/Cargo.toml b/crates/engine/local/Cargo.toml index d80be90e0cdc..02a7b138c75a 100644 --- a/crates/engine/local/Cargo.toml +++ b/crates/engine/local/Cargo.toml @@ -27,6 +27,7 @@ reth-transaction-pool.workspace = true reth-stages-api.workspace = true # alloy +alloy-chains.workspace = true alloy-consensus.workspace = true alloy-primitives.workspace = true alloy-rpc-types-engine.workspace = true @@ -41,6 +42,7 @@ eyre.workspace = true tracing.workspace = true op-alloy-rpc-types-engine = { workspace = true, optional = true } +reth-optimism-chainspec = { workspace = true, optional = true } [lints] workspace = true @@ -48,4 +50,5 @@ workspace = true [features] op = [ "dep:op-alloy-rpc-types-engine", + "dep:reth-optimism-chainspec", ] diff --git a/crates/engine/local/src/payload.rs b/crates/engine/local/src/payload.rs index 088a42fbf96b..ea6c63083a94 100644 --- a/crates/engine/local/src/payload.rs +++ b/crates/engine/local/src/payload.rs @@ -52,7 +52,11 @@ where fn build(&self, timestamp: u64) -> op_alloy_rpc_types_engine::OpPayloadAttributes { op_alloy_rpc_types_engine::OpPayloadAttributes { payload_attributes: self.build(timestamp), - transactions: None, + // Add dummy system transaction + transactions: Some(vec![ + reth_optimism_chainspec::constants::TX_SET_L1_BLOCK_OP_MAINNET_BLOCK_124665056 + .into(), + ]), no_tx_pool: None, gas_limit: None, eip_1559_params: None, diff --git a/crates/optimism/chainspec/src/constants.rs b/crates/optimism/chainspec/src/constants.rs index 439c2fed83c0..1ce31658b9e5 100644 --- a/crates/optimism/chainspec/src/constants.rs +++ b/crates/optimism/chainspec/src/constants.rs @@ -1,5 +1,7 @@ //! OP stack variation of chain spec constants. +use alloy_primitives::hex; + //------------------------------- BASE MAINNET -------------------------------// /// Max gas limit on Base: @@ -9,3 +11,11 @@ pub const BASE_MAINNET_MAX_GAS_LIMIT: u64 = 105_000_000; /// Max gas limit on Base Sepolia: pub const BASE_SEPOLIA_MAX_GAS_LIMIT: u64 = 45_000_000; + +//----------------------------------- DEV ------------------------------------// + +/// Dummy system transaction for dev mode +/// OP Mainnet transaction at index 0 in block 124665056. +/// +/// +pub const TX_SET_L1_BLOCK_OP_MAINNET_BLOCK_124665056: [u8; 251] = hex!("7ef8f8a0683079df94aa5b9cf86687d739a60a9b4f0835e520ec4d664e2e415dca17a6df94deaddeaddeaddeaddeaddeaddeaddeaddead00019442000000000000000000000000000000000000158080830f424080b8a4440a5e200000146b000f79c500000000000000040000000066d052e700000000013ad8a3000000000000000000000000000000000000000000000000000000003ef1278700000000000000000000000000000000000000000000000000000000000000012fdf87b89884a61e74b322bbcf60386f543bfae7827725efaaf0ab1de2294a590000000000000000000000006887246668a3b87f54deb3b94ba47a6f63f32985"); From 9448211338f611cf83ef80732ae6095f2bf60dbb Mon Sep 17 00:00:00 2001 From: Matthias Seitz Date: Thu, 30 Jan 2025 13:45:53 +0100 Subject: [PATCH 2/2] clippy --- Cargo.lock | 1 - crates/engine/local/Cargo.toml | 1 - 2 files changed, 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 70ec8cd40595..43251446d7b5 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -7088,7 +7088,6 @@ dependencies = [ name = "reth-engine-local" version = "1.1.5" dependencies = [ - "alloy-chains", "alloy-consensus", "alloy-primitives", "alloy-rpc-types-engine", diff --git a/crates/engine/local/Cargo.toml b/crates/engine/local/Cargo.toml index 02a7b138c75a..0e4e546eb929 100644 --- a/crates/engine/local/Cargo.toml +++ b/crates/engine/local/Cargo.toml @@ -27,7 +27,6 @@ reth-transaction-pool.workspace = true reth-stages-api.workspace = true # alloy -alloy-chains.workspace = true alloy-consensus.workspace = true alloy-primitives.workspace = true alloy-rpc-types-engine.workspace = true