Remove ethers-core from execution_layer (#8149)

#6022


  Use `alloy_rpc_types::Transaction` to replace the `ethers_core::Transaction` inside the execution block generator.


Co-Authored-By: Mac L <mjladson@pm.me>
This commit is contained in:
Mac L
2025-11-10 10:25:59 +04:00
committed by GitHub
parent 1bd4ac2113
commit 93b8f4686d
6 changed files with 460 additions and 42 deletions

View File

@@ -8,13 +8,13 @@ edition = { workspace = true }
alloy-consensus = { workspace = true }
alloy-primitives = { workspace = true }
alloy-rlp = { workspace = true }
alloy-rpc-types-eth = { workspace = true }
arc-swap = "1.6.0"
builder_client = { path = "../builder_client" }
bytes = { workspace = true }
eth2 = { workspace = true }
ethereum_serde_utils = { workspace = true }
ethereum_ssz = { workspace = true }
ethers-core = { workspace = true }
fixed_bytes = { workspace = true }
fork_choice = { workspace = true }
hash-db = "0.15.2"

View File

@@ -18,7 +18,6 @@ use engines::{Engine, EngineError};
pub use engines::{EngineState, ForkchoiceState};
use eth2::types::{BlobsBundle, FullPayloadContents};
use eth2::types::{ForkVersionedResponse, builder_bid::SignedBuilderBid};
use ethers_core::types::Transaction as EthersTransaction;
use fixed_bytes::UintExtended;
use fork_choice::ForkchoiceUpdateParameters;
use logging::crit;

View File

@@ -1,4 +1,3 @@
use crate::EthersTransaction;
use crate::engine_api::{
ExecutionBlock, PayloadAttributes, PayloadId, PayloadStatusV1, PayloadStatusV1Status,
json_structures::{
@@ -6,6 +5,8 @@ use crate::engine_api::{
},
};
use crate::engines::ForkchoiceState;
use alloy_consensus::TxEnvelope;
use alloy_rpc_types_eth::Transaction as AlloyTransaction;
use eth2::types::BlobsBundle;
use kzg::{Kzg, KzgCommitment, KzgProof};
use parking_lot::Mutex;
@@ -833,7 +834,7 @@ pub fn generate_blobs<E: EthSpec>(
pub fn static_valid_tx<E: EthSpec>() -> Result<Transaction<E::MaxBytesPerTransaction>, String> {
// This is a real transaction hex encoded, but we don't care about the contents of the transaction.
let transaction: EthersTransaction = serde_json::from_str(
let transaction: AlloyTransaction = serde_json::from_str(
r#"{
"blockHash":"0x1d59ff54b1eb26b013ce3cb5fc9dab3705b415a67127a003c3e61eb445bb8df2",
"blockNumber":"0x5daf3b",
@@ -852,7 +853,8 @@ pub fn static_valid_tx<E: EthSpec>() -> Result<Transaction<E::MaxBytesPerTransac
}"#,
)
.unwrap();
VariableList::new(transaction.rlp().to_vec())
VariableList::new(alloy_rlp::encode::<TxEnvelope>(transaction.into()).to_vec())
.map_err(|e| format!("Failed to convert transaction to SSZ: {:?}", e))
}