Bump evm-inspectors and alloy (#8006)

This commit is contained in:
Thomas Coratger
2024-04-30 23:07:41 +02:00
committed by GitHub
parent d532217afb
commit 8e65cb3aa5
18 changed files with 78 additions and 98 deletions

View File

@ -1285,8 +1285,8 @@ mod tests {
revm_primitives::AccountInfo,
stage::StageCheckpoint,
Account, Address, ChainSpecBuilder, Genesis, GenesisAccount, Header, Signature,
Transaction, TransactionSigned, TransactionSignedEcRecovered, TxEip1559, TxKind,
Withdrawals, B256, MAINNET,
Transaction, TransactionSigned, TransactionSignedEcRecovered, TxEip1559, Withdrawals, B256,
MAINNET,
};
use reth_provider::{
test_utils::{
@ -1465,7 +1465,7 @@ mod tests {
chain_id: chain_spec.chain.id(),
nonce,
gas_limit: 21_000,
to: TxKind::Call(Address::ZERO),
to: Address::ZERO.into(),
max_fee_per_gas: EIP1559_INITIAL_BASE_FEE as u128,
..Default::default()
}),

View File

@ -202,7 +202,7 @@ mod tests {
use reth_primitives::{
hex_literal::hex, proofs, Account, Address, BlockBody, BlockHash, BlockHashOrNumber,
BlockNumber, Bytes, ChainSpecBuilder, Signature, Transaction, TransactionSigned, TxEip4844,
TxKind, Withdrawal, Withdrawals, U256,
Withdrawal, Withdrawals, U256,
};
use reth_provider::AccountReader;
use std::ops::RangeBounds;
@ -313,7 +313,7 @@ mod tests {
max_priority_fee_per_gas: 0x28f000fff,
max_fee_per_blob_gas: 0x7,
gas_limit: 10,
to: TxKind::Call(Address::default()),
to: Address::default().into(),
value: U256::from(3_u64),
input: Bytes::from(vec![1, 2]),
access_list: Default::default(),

View File

@ -1,7 +1,7 @@
//! Connection tests
use alloy_node_bindings::Geth;
use alloy_provider::{admin::AdminApi, ProviderBuilder};
use alloy_provider::{ext::AdminApi, ProviderBuilder};
use futures::StreamExt;
use reth_discv4::Discv4Config;
use reth_eth_wire::DisconnectReason;
@ -320,9 +320,8 @@ async fn test_incoming_node_id_blacklist() {
let geth = Geth::new().data_dir(temp_dir).disable_discovery().authrpc_port(0).spawn();
let geth_endpoint = SocketAddr::new([127, 0, 0, 1].into(), geth.port());
let provider = ProviderBuilder::new()
.on_http(format!("http://{geth_endpoint}").parse().unwrap())
.unwrap();
let provider =
ProviderBuilder::new().on_http(format!("http://{geth_endpoint}").parse().unwrap());
// get the peer id we should be expecting
let enr = provider.node_info().await.unwrap().enr;
@ -375,9 +374,8 @@ async fn test_incoming_connect_with_single_geth() {
let temp_dir = tempfile::tempdir().unwrap().into_path();
let geth = Geth::new().data_dir(temp_dir).disable_discovery().authrpc_port(0).spawn();
let geth_endpoint = SocketAddr::new([127, 0, 0, 1].into(), geth.port());
let provider = ProviderBuilder::new()
.on_http(format!("http://{geth_endpoint}").parse().unwrap())
.unwrap();
let provider =
ProviderBuilder::new().on_http(format!("http://{geth_endpoint}").parse().unwrap());
// get the peer id we should be expecting
let enr = provider.node_info().await.unwrap().enr;
@ -438,9 +436,8 @@ async fn test_outgoing_connect_with_single_geth() {
let geth_socket = SocketAddr::new([127, 0, 0, 1].into(), geth_p2p_port);
let geth_endpoint = SocketAddr::new([127, 0, 0, 1].into(), geth.port()).to_string();
let provider = ProviderBuilder::new()
.on_http(format!("http://{geth_endpoint}").parse().unwrap())
.unwrap();
let provider =
ProviderBuilder::new().on_http(format!("http://{geth_endpoint}").parse().unwrap());
// get the peer id we should be expecting
let enr = provider.node_info().await.unwrap().enr;
@ -485,9 +482,8 @@ async fn test_geth_disconnect() {
let geth_socket = SocketAddr::new([127, 0, 0, 1].into(), geth_p2p_port);
let geth_endpoint = SocketAddr::new([127, 0, 0, 1].into(), geth.port()).to_string();
let provider = ProviderBuilder::new()
.on_http(format!("http://{geth_endpoint}").parse().unwrap())
.unwrap();
let provider =
ProviderBuilder::new().on_http(format!("http://{geth_endpoint}").parse().unwrap());
// get the peer id we should be expecting
let enr = provider.node_info().await.unwrap().enr;

View File

@ -539,7 +539,7 @@ mod tests {
use super::*;
use reth_primitives::{
b256, Account, Address, Block, ChainSpecBuilder, Signature, StorageKey, StorageValue,
Transaction, TransactionSigned, TxEip1559, TxKind, BASE_MAINNET,
Transaction, TransactionSigned, TxEip1559, BASE_MAINNET,
};
use reth_revm::{
database::StateProviderDatabase, test_utils::StateProviderTest, L1_BLOCK_CONTRACT,
@ -609,7 +609,7 @@ mod tests {
chain_id: chain_spec.chain.id(),
nonce: 0,
gas_limit: 21_000,
to: TxKind::Call(addr),
to: addr.into(),
..Default::default()
}),
Signature::default(),
@ -618,7 +618,7 @@ mod tests {
let tx_deposit = TransactionSigned::from_transaction_and_signature(
Transaction::Deposit(reth_primitives::TxDeposit {
from: addr,
to: TxKind::Call(addr),
to: addr.into(),
gas_limit: 21_000,
..Default::default()
}),
@ -689,7 +689,7 @@ mod tests {
chain_id: chain_spec.chain.id(),
nonce: 0,
gas_limit: 21_000,
to: TxKind::Call(addr),
to: addr.into(),
..Default::default()
}),
Signature::default(),
@ -698,7 +698,7 @@ mod tests {
let tx_deposit = TransactionSigned::from_transaction_and_signature(
Transaction::Deposit(reth_primitives::TxDeposit {
from: addr,
to: TxKind::Call(addr),
to: addr.into(),
gas_limit: 21_000,
..Default::default()
}),

View File

@ -243,7 +243,7 @@ mod tests {
chain_id: 1,
nonce: 0x42,
gas_limit: 44386,
to: TxKind::Call( hex!("6069a6c32cf691f5982febae4faf8a6f3ab2f0f6").into()),
to: TxKind::Call(hex!("6069a6c32cf691f5982febae4faf8a6f3ab2f0f6").into()),
value: U256::ZERO,
input: hex!("a22cb4650000000000000000000000005eee75727d804a2b13038928d36f8b188945a57a0000000000000000000000000000000000000000000000000000000000000000").into(),
max_fee_per_gas: 0x4a817c800,

View File

@ -225,7 +225,7 @@ mod tests {
nonce: 0,
gas_price: 1,
gas_limit: 2,
to: TxKind::Call(Address::default()),
to: Address::default().into(),
value: U256::from(3),
input: Bytes::from(vec![1, 2]),
access_list: Default::default(),

View File

@ -190,7 +190,7 @@ mod tests {
nonce: 0x18,
gas_price: 0xfa56ea00,
gas_limit: 119902,
to: TxKind::Call( hex!("06012c8cf97bead5deae237070f9587f8e7a266d").into()),
to: TxKind::Call(hex!("06012c8cf97bead5deae237070f9587f8e7a266d").into()),
value: U256::from(0x1c6bf526340000u64),
input: hex!("f7d8c88300000000000000000000000000000000000000000000000000000000000cee6100000000000000000000000000000000000000000000000000000000000ac3e1").into(),
});

View File

@ -1866,9 +1866,7 @@ mod tests {
nonce: 2,
gas_price: 1000000000,
gas_limit: 100000,
to: TxKind::Call(
Address::from_str("d3e8763675e4c425df46cc3b5c0f6cbdac396046").unwrap(),
),
to: Address::from_str("d3e8763675e4c425df46cc3b5c0f6cbdac396046").unwrap().into(),
value: U256::from(1000000000000000u64),
input: Bytes::default(),
});
@ -1888,9 +1886,7 @@ mod tests {
nonce: 1u64,
gas_price: 1000000000,
gas_limit: 100000u64,
to: TxKind::Call(Address::from_slice(
&hex!("d3e8763675e4c425df46cc3b5c0f6cbdac396046")[..],
)),
to: Address::from_slice(&hex!("d3e8763675e4c425df46cc3b5c0f6cbdac396046")[..]).into(),
value: U256::from(693361000000000u64),
input: Default::default(),
});
@ -1909,9 +1905,7 @@ mod tests {
nonce: 3,
gas_price: 2000000000,
gas_limit: 10000000,
to: TxKind::Call(Address::from_slice(
&hex!("d3e8763675e4c425df46cc3b5c0f6cbdac396046")[..],
)),
to: Address::from_slice(&hex!("d3e8763675e4c425df46cc3b5c0f6cbdac396046")[..]).into(),
value: U256::from(1000000000000000u64),
input: Bytes::default(),
});
@ -1931,9 +1925,7 @@ mod tests {
max_priority_fee_per_gas: 1500000000,
max_fee_per_gas: 1500000013,
gas_limit: 21000,
to: TxKind::Call(Address::from_slice(
&hex!("61815774383099e24810ab832a5b2a5425c154d5")[..],
)),
to: Address::from_slice(&hex!("61815774383099e24810ab832a5b2a5425c154d5")[..]).into(),
value: U256::from(3000000000000000000u64),
input: Default::default(),
access_list: Default::default(),
@ -1953,9 +1945,7 @@ mod tests {
nonce: 15,
gas_price: 2200000000,
gas_limit: 34811,
to: TxKind::Call(Address::from_slice(
&hex!("cf7f9e66af820a19257a2108375b180b0ec49167")[..],
)),
to: Address::from_slice(&hex!("cf7f9e66af820a19257a2108375b180b0ec49167")[..]).into(),
value: U256::from(1234),
input: Bytes::default(),
});
@ -2242,9 +2232,7 @@ mod tests {
nonce: 2,
gas_price: 1000000000,
gas_limit: 100000,
to: TxKind::Call(
Address::from_str("d3e8763675e4c425df46cc3b5c0f6cbdac396046").unwrap(),
),
to: Address::from_str("d3e8763675e4c425df46cc3b5c0f6cbdac396046").unwrap().into(),
value: U256::from(1000000000000000u64),
input: Bytes::from(input),
});
@ -2291,9 +2279,7 @@ mod tests {
nonce: 2,
gas_price: 1000000000,
gas_limit: 100000,
to: TxKind::Call(
Address::from_str("d3e8763675e4c425df46cc3b5c0f6cbdac396046").unwrap(),
),
to: Address::from_str("d3e8763675e4c425df46cc3b5c0f6cbdac396046").unwrap().into(),
value: U256::from(1000000000000000u64),
input: Bytes::from(vec![3u8; 64]),
});

View File

@ -206,7 +206,7 @@ mod tests {
};
use reth_primitives::{
b256, Account, Address, Block, ChainSpecBuilder, Header, Signature, StorageKey,
StorageValue, Transaction, TransactionSigned, TxEip1559, TxKind, BASE_MAINNET,
StorageValue, Transaction, TransactionSigned, TxEip1559, BASE_MAINNET,
};
use revm::L1_BLOCK_CONTRACT;
use std::{collections::HashMap, str::FromStr, sync::Arc};
@ -278,7 +278,7 @@ mod tests {
chain_id: chain_spec.chain.id(),
nonce: 0,
gas_limit: 21_000,
to: TxKind::Call(addr),
to: addr.into(),
..Default::default()
}),
Signature::default(),
@ -287,7 +287,7 @@ mod tests {
let tx_deposit = TransactionSigned::from_transaction_and_signature(
Transaction::Deposit(reth_primitives::TxDeposit {
from: addr,
to: TxKind::Call(addr),
to: addr.into(),
gas_limit: 21_000,
..Default::default()
}),
@ -352,7 +352,7 @@ mod tests {
chain_id: chain_spec.chain.id(),
nonce: 0,
gas_limit: 21_000,
to: TxKind::Call(addr),
to: addr.into(),
..Default::default()
}),
Signature::default(),
@ -361,7 +361,7 @@ mod tests {
let tx_deposit = TransactionSigned::from_transaction_and_signature(
Transaction::Deposit(reth_primitives::TxDeposit {
from: addr,
to: TxKind::Call(addr),
to: addr.into(),
gas_limit: 21_000,
..Default::default()
}),

View File

@ -466,7 +466,7 @@ mod tests {
bytes,
constants::{BEACON_ROOTS_ADDRESS, EIP1559_INITIAL_BASE_FEE, SYSTEM_ADDRESS},
keccak256, Account, Bytes, ChainSpecBuilder, ForkCondition, Signature, Transaction,
TxEip1559, TxKind, MAINNET,
TxEip1559, MAINNET,
};
use revm::{Database, TransitionState};
use std::collections::HashMap;
@ -855,7 +855,7 @@ mod tests {
chain_id,
nonce: 1,
gas_limit: 21_000,
to: TxKind::Call(Address::ZERO),
to: Address::ZERO.into(),
max_fee_per_gas: EIP1559_INITIAL_BASE_FEE as u128,
..Default::default()
}),

View File

@ -1,9 +1,7 @@
//! Compatibility functions for rpc `Transaction` type.
use alloy_rpc_types::request::{TransactionInput, TransactionRequest};
use reth_primitives::{
BlockNumber, TransactionSignedEcRecovered, TxKind as PrimitiveTransactionKind, TxType, B256,
};
use reth_primitives::{BlockNumber, TransactionSignedEcRecovered, TxKind, TxType, B256};
use reth_rpc_types::Transaction;
use signature::from_primitive_signature;
pub use typed::*;
@ -45,8 +43,8 @@ fn fill(
let signed_tx = tx.into_signed();
let to = match signed_tx.kind() {
PrimitiveTransactionKind::Create => None,
PrimitiveTransactionKind::Call(to) => Some(*to),
TxKind::Create => None,
TxKind::Call(to) => Some(*to),
};
#[allow(unreachable_patterns)]

View File

@ -443,6 +443,7 @@ where
Ok(AccessListWithGasUsed { access_list, gas_used })
}
/// Executes the requests again after an out of gas error to check if the error is gas related
/// or not
#[inline]

View File

@ -429,8 +429,6 @@ where
#[cfg(test)]
mod tests {
use jsonrpsee::types::error::INVALID_PARAMS_CODE;
use crate::{
eth::{
cache::EthStateCache, gas_oracle::GasPriceOracle, FeeHistoryCache,
@ -438,6 +436,7 @@ mod tests {
},
EthApi,
};
use jsonrpsee::types::error::INVALID_PARAMS_CODE;
use reth_evm_ethereum::EthEvmConfig;
use reth_interfaces::test_utils::{generators, generators::Rng};
use reth_network_api::noop::NoopNetwork;

View File

@ -21,7 +21,7 @@ impl Compact for TxKind {
0 => (TxKind::Create, buf),
1 => {
let (addr, buf) = Address::from_compact(buf, buf.len());
(TxKind::Call(addr), buf)
(addr.into(), buf)
}
_ => {
unreachable!("Junk data in database: unknown TransactionKind variant",)

View File

@ -306,7 +306,7 @@ impl TransactionBuilder {
/// Sets the recipient or contract address for the transaction, mutable reference version.
pub fn set_to(&mut self, to: Address) -> &mut Self {
self.to = TxKind::Call(to);
self.to = to.into();
self
}

View File

@ -213,7 +213,7 @@ impl MockTransaction {
nonce: 0,
gas_price: 0,
gas_limit: 0,
to: TxKind::Call(Address::random()),
to: Address::random().into(),
value: Default::default(),
input: Default::default(),
size: Default::default(),
@ -229,7 +229,7 @@ impl MockTransaction {
max_fee_per_gas: MIN_PROTOCOL_BASE_FEE as u128,
max_priority_fee_per_gas: MIN_PROTOCOL_BASE_FEE as u128,
gas_limit: 0,
to: TxKind::Call(Address::random()),
to: Address::random().into(),
value: Default::default(),
input: Bytes::new(),
accesslist: Default::default(),
@ -247,7 +247,7 @@ impl MockTransaction {
max_priority_fee_per_gas: MIN_PROTOCOL_BASE_FEE as u128,
max_fee_per_blob_gas: DATA_GAS_PER_BLOB as u128,
gas_limit: 0,
to: TxKind::Call(Address::random()),
to: Address::random().into(),
value: Default::default(),
input: Bytes::new(),
accesslist: Default::default(),
@ -272,7 +272,7 @@ impl MockTransaction {
hash: B256::random(),
sender: Address::random(),
nonce: 0,
to: TxKind::Call(Address::random()),
to: Address::random().into(),
gas_limit: 0,
input: Bytes::new(),
value: Default::default(),