fix: correctly set txtype for eth_call (#14727)

This commit is contained in:
Arsenii Kulikov
2025-02-26 19:09:52 +04:00
committed by GitHub
parent 256351d4e3
commit f94f37eb43
2 changed files with 24 additions and 3 deletions

View File

@@ -1,5 +1,6 @@
use super::OpNodeCore;
use crate::{OpEthApi, OpEthApiError};
use alloy_consensus::TxType;
use alloy_primitives::{Bytes, TxKind, U256};
use alloy_rpc_types_eth::transaction::TransactionRequest;
use reth_evm::{ConfigureEvm, EvmEnv, SpecFor};
@@ -60,7 +61,17 @@ where
return Err(RpcInvalidTransactionError::BlobTransactionMissingBlobHashes.into_eth_err())
}
let tx_type = request.preferred_type() as u8;
let tx_type = if request.authorization_list.is_some() {
TxType::Eip7702
} else if request.sidecar.is_some() || request.max_fee_per_blob_gas.is_some() {
TxType::Eip4844
} else if request.max_fee_per_gas.is_some() || request.max_priority_fee_per_gas.is_some() {
TxType::Eip1559
} else if request.access_list.is_some() {
TxType::Eip2930
} else {
TxType::Legacy
} as u8;
let TransactionRequest {
from,

View File

@@ -1,7 +1,7 @@
//! Contains RPC handler implementations specific to endpoints that call/execute within evm.
use crate::EthApi;
use alloy_consensus::Header;
use alloy_consensus::{Header, TxType};
use alloy_primitives::{TxKind, U256};
use alloy_rpc_types::TransactionRequest;
use reth_evm::{ConfigureEvm, EvmEnv, SpecFor};
@@ -50,7 +50,17 @@ where
return Err(RpcInvalidTransactionError::BlobTransactionMissingBlobHashes.into_eth_err())
}
let tx_type = request.preferred_type() as u8;
let tx_type = if request.authorization_list.is_some() {
TxType::Eip7702
} else if request.sidecar.is_some() || request.max_fee_per_blob_gas.is_some() {
TxType::Eip4844
} else if request.max_fee_per_gas.is_some() || request.max_priority_fee_per_gas.is_some() {
TxType::Eip1559
} else if request.access_list.is_some() {
TxType::Eip2930
} else {
TxType::Legacy
} as u8;
let TransactionRequest {
from,