Skip to content

Commit

Permalink
bump alloy 0.8.0, alloy-core=0.8.14, reth rev = "328d493", revm-inspe… (
Browse files Browse the repository at this point in the history
#138)

* bump alloy 0.8.0, alloy-core=0.8.14, reth rev = "328d493", revm-inspectors=0.13.0, revm=18.0.0

* taplo fix

* tests

---------

Co-authored-by: dexloom <[email protected]>
  • Loading branch information
dexloom and dexloom authored Dec 12, 2024
1 parent fb50c0b commit a0d3737
Show file tree
Hide file tree
Showing 18 changed files with 708 additions and 685 deletions.
1,074 changes: 595 additions & 479 deletions Cargo.lock

Large diffs are not rendered by default.

100 changes: 50 additions & 50 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -197,11 +197,11 @@ wiremock = "0.6.2"

# revm
revm = { version = "18.0.0", features = ["blst", "optional_balance_check", "secp256k1", "std"], default-features = false }
revm-inspectors = "0.11.0"
revm-inspectors = "0.13.0"
revm-primitives = { version = "14.0.0", features = ["std"], default-features = false }

# alloy
alloy = { version = "0.6.4", features = [
alloy = { version = "0.8.0", features = [
"consensus",
"full",
"json-rpc",
Expand All @@ -214,34 +214,34 @@ alloy = { version = "0.6.4", features = [
"rpc-types-trace",
"serde",
], default-features = false }
alloy-consensus = "0.6.4"
alloy-contract = "0.6.4"
alloy-eips = "0.6.4"
alloy-json-rpc = "0.6.4"
alloy-network = "0.6.4"
alloy-node-bindings = "0.6.4"
alloy-provider = { version = "0.6.4", features = ["anvil-api", "anvil-node", "debug-api", "ipc", "pubsub", "reqwest", "ws"] }
alloy-pubsub = "0.6.4"
alloy-rpc-client = { version = "0.6.4", features = ["ipc", "pubsub", "reqwest", "ws"] }
alloy-rpc-types = "0.6.4"
alloy-rpc-types-anvil = "0.6.4"
alloy-rpc-types-beacon = "0.6.4"
alloy-rpc-types-engine = "0.6.4"
alloy-rpc-types-eth = "0.6.4"
alloy-rpc-types-trace = "0.6.4"
alloy-serde = "0.6.4"
alloy-signer = "0.6.4"
alloy-signer-local = "0.6.4"
alloy-transport = "0.6.4"
alloy-transport-http = "0.6.4"
alloy-transport-ipc = "0.6.4"
alloy-transport-ws = "0.6.4"
alloy-consensus = "0.8.0"
alloy-contract = "0.8.0"
alloy-eips = "0.8.0"
alloy-json-rpc = "0.8.0"
alloy-network = "0.8.0"
alloy-node-bindings = "0.8.0"
alloy-provider = { version = "0.8.0", features = ["anvil-api", "anvil-node", "debug-api", "ipc", "pubsub", "reqwest", "ws"] }
alloy-pubsub = "0.8.0"
alloy-rpc-client = { version = "0.8.0", features = ["ipc", "pubsub", "reqwest", "ws"] }
alloy-rpc-types = "0.8.0"
alloy-rpc-types-anvil = "0.8.0"
alloy-rpc-types-beacon = "0.8.0"
alloy-rpc-types-engine = "0.8.0"
alloy-rpc-types-eth = "0.8.0"
alloy-rpc-types-trace = "0.8.0"
alloy-serde = "0.8.0"
alloy-signer = "0.8.0"
alloy-signer-local = "0.8.0"
alloy-transport = "0.8.0"
alloy-transport-http = "0.8.0"
alloy-transport-ipc = "0.8.0"
alloy-transport-ws = "0.8.0"

#alloy-core
alloy-dyn-abi = { version = "0.8.12", features = ["json", "std"] }
alloy-primitives = { version = "0.8.12", features = ["map-fxhash", "rand"], default-features = false }
alloy-sol-macro = { version = "0.8.12", features = ["json"] }
alloy-sol-types = { version = "0.8.12", features = ["json"] }
alloy-primitives = { version = "0.8.14", features = ["map-fxhash", "rand"], default-features = false }
alloy-sol-macro = { version = "0.8.14", features = ["json"] }
alloy-sol-types = { version = "0.8.14", features = ["json"] }

#alloy-related
alloy-chains = "0.1.47"
Expand All @@ -250,29 +250,29 @@ alloy-trie = "0.7.4"


# reth
reth = { git = "https://github.com/paradigmxyz/reth", rev = "5056a08", features = ["asm-keccak"] }
reth-chainspec = { git = "https://github.com/paradigmxyz/reth", rev = "5056a08" }
reth-codecs = { git = "https://github.com/paradigmxyz/reth", rev = "5056a08" }
reth-codecs-derive = { git = "https://github.com/paradigmxyz/reth", rev = "5056a08" }
reth-db = { git = "https://github.com/paradigmxyz/reth", rev = "5056a08" }
reth-ethereum-forks = { git = "https://github.com/paradigmxyz/reth", rev = "5056a08" }
reth-execution-types = { git = "https://github.com/paradigmxyz/reth", rev = "5056a08" }
reth-exex = { git = "https://github.com/paradigmxyz/reth", rev = "5056a08", features = ["serde"] }
reth-exex-test-utils = { git = "https://github.com/paradigmxyz/reth", rev = "5056a08" }
reth-node-api = { git = "https://github.com/paradigmxyz/reth", rev = "5056a08" }
reth-node-builder = { git = "https://github.com/paradigmxyz/reth", rev = "5056a08" }
reth-node-core = { git = "https://github.com/paradigmxyz/reth", rev = "5056a08", features = ["asm-keccak"] }
reth-node-ethereum = { git = "https://github.com/paradigmxyz/reth", rev = "5056a08" }
reth-node-types = { git = "https://github.com/paradigmxyz/reth", rev = "5056a08" }
reth-primitives = { git = "https://github.com/paradigmxyz/reth", rev = "5056a08", features = ["asm-keccak"] }
reth-provider = { git = "https://github.com/paradigmxyz/reth", rev = "5056a08" }
reth-revm = { git = "https://github.com/paradigmxyz/reth", rev = "5056a08" }
reth-rpc = { git = "https://github.com/paradigmxyz/reth", rev = "5056a08" }
reth-rpc-types-compat = { git = "https://github.com/paradigmxyz/reth", rev = "5056a08" }
reth-storage-api = { git = "https://github.com/paradigmxyz/reth", rev = "5056a08" }
reth-testing-utils = { git = "https://github.com/paradigmxyz/reth", rev = "5056a08" }
reth-tracing = { git = "https://github.com/paradigmxyz/reth", rev = "5056a08" }
reth-transaction-pool = { git = "https://github.com/paradigmxyz/reth", rev = "5056a08" }
reth = { git = "https://github.com/paradigmxyz/reth", rev = "328d493", features = ["asm-keccak"] }
reth-chainspec = { git = "https://github.com/paradigmxyz/reth", rev = "328d493" }
reth-codecs = { git = "https://github.com/paradigmxyz/reth", rev = "328d493" }
reth-codecs-derive = { git = "https://github.com/paradigmxyz/reth", rev = "328d493" }
reth-db = { git = "https://github.com/paradigmxyz/reth", rev = "328d493" }
reth-ethereum-forks = { git = "https://github.com/paradigmxyz/reth", rev = "328d493" }
reth-execution-types = { git = "https://github.com/paradigmxyz/reth", rev = "328d493" }
reth-exex = { git = "https://github.com/paradigmxyz/reth", rev = "328d493", features = ["serde"] }
reth-exex-test-utils = { git = "https://github.com/paradigmxyz/reth", rev = "328d493" }
reth-node-api = { git = "https://github.com/paradigmxyz/reth", rev = "328d493" }
reth-node-builder = { git = "https://github.com/paradigmxyz/reth", rev = "328d493" }
reth-node-core = { git = "https://github.com/paradigmxyz/reth", rev = "328d493", features = ["asm-keccak"] }
reth-node-ethereum = { git = "https://github.com/paradigmxyz/reth", rev = "328d493" }
reth-node-types = { git = "https://github.com/paradigmxyz/reth", rev = "328d493" }
reth-primitives = { git = "https://github.com/paradigmxyz/reth", rev = "328d493", features = ["asm-keccak"] }
reth-provider = { git = "https://github.com/paradigmxyz/reth", rev = "328d493" }
reth-revm = { git = "https://github.com/paradigmxyz/reth", rev = "328d493" }
reth-rpc = { git = "https://github.com/paradigmxyz/reth", rev = "328d493" }
reth-rpc-types-compat = { git = "https://github.com/paradigmxyz/reth", rev = "328d493" }
reth-storage-api = { git = "https://github.com/paradigmxyz/reth", rev = "328d493" }
reth-testing-utils = { git = "https://github.com/paradigmxyz/reth", rev = "328d493" }
reth-tracing = { git = "https://github.com/paradigmxyz/reth", rev = "328d493" }
reth-transaction-pool = { git = "https://github.com/paradigmxyz/reth", rev = "328d493" }

[profile.test]
debug = 1
Expand Down
17 changes: 9 additions & 8 deletions bin/exex_grpc_node/src/main.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
use reth::primitives::TransactionSigned;
use reth::transaction_pool::TransactionPool;
use reth::api::NodeTypes;
use reth::primitives::{EthPrimitives, TransactionSigned};
use reth::transaction_pool::{EthPooledTransaction, TransactionPool};
use reth_exex::{ExExContext, ExExEvent, ExExNotification};
use reth_node_api::FullNodeComponents;
use reth_node_ethereum::EthereumNode;
Expand Down Expand Up @@ -204,10 +205,10 @@ impl RemoteExEx for ExExService {
}
}

async fn exex<Node: FullNodeComponents>(
mut ctx: ExExContext<Node>,
notifications: broadcast::Sender<ExExNotification>,
) -> eyre::Result<()> {
async fn exex<Node>(mut ctx: ExExContext<Node>, notifications: broadcast::Sender<ExExNotification>) -> eyre::Result<()>
where
Node: FullNodeComponents<Types: NodeTypes<Primitives = EthPrimitives>>,
{
info!("ExEx worker started");

while let Some(notification) = ctx.notifications.try_next().await? {
Expand All @@ -226,13 +227,13 @@ async fn exex<Node: FullNodeComponents>(

pub async fn mempool_worker<Pool>(mempool: Pool, notifications: broadcast::Sender<TransactionSigned>) -> eyre::Result<()>
where
Pool: TransactionPool + Clone + 'static,
Pool: TransactionPool<Transaction = EthPooledTransaction> + Clone + 'static,
{
info!("Mempool worker started");
let mut tx_listener = mempool.new_transactions_listener();

while let Some(tx_notification) = tx_listener.recv().await {
let _ = notifications.send(tx_notification.transaction.to_recovered_transaction().into());
let _ = notifications.send(tx_notification.transaction.to_consensus().into());
}
info!("Mempool worker finished");

Expand Down
2 changes: 2 additions & 0 deletions bin/loom_anvil/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,8 @@ use std::process::exit;
use std::sync::Arc;
use std::time::Duration;

use alloy_rpc_types_eth::TransactionTrait;

use alloy_provider::network::TransactionResponse;

use crate::flashbots_mock::mount_flashbots_mock;
Expand Down
9 changes: 7 additions & 2 deletions bin/loom_exex/src/loom_runtime.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,23 @@ use loom::storage::db::init_db_pool;
use loom::strategy::backrun::{BackrunConfig, BackrunConfigSection};
use loom::types::entities::strategy_config::load_from_file;
use loom::types::entities::{BlockHistoryState, PoolClass};
use reth::api::NodeTypes;
use reth::revm::{Database, DatabaseCommit, DatabaseRef};
use reth_exex::ExExContext;
use reth_node_api::FullNodeComponents;
use reth_primitives::EthPrimitives;
use std::env;
use std::future::Future;
use tracing::info;

pub async fn init<Node: FullNodeComponents>(
pub async fn init<Node>(
ctx: ExExContext<Node>,
bc: Blockchain,
config: NodeBlockActorConfig,
) -> eyre::Result<impl Future<Output = eyre::Result<()>>> {
) -> eyre::Result<impl Future<Output = eyre::Result<()>>>
where
Node: FullNodeComponents<Types: NodeTypes<Primitives = EthPrimitives>>,
{
Ok(loom_exex(ctx, bc, config.clone()))
}

Expand Down
1 change: 1 addition & 0 deletions crates/defi/health-monitor/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ tokio.workspace = true
tracing.workspace = true

#alloy
alloy-consensus.workspace = true
alloy-eips.workspace = true
alloy-network.workspace = true
alloy-primitives.workspace = true
Expand Down
1 change: 1 addition & 0 deletions crates/defi/health-monitor/src/stuffing_tx_monitor.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
use alloy_consensus::transaction::Transaction;
use alloy_network::{Ethereum, TransactionResponse};
use alloy_primitives::{Address, TxHash, U256};
use alloy_provider::Provider;
Expand Down
2 changes: 1 addition & 1 deletion crates/evm/utils/src/reth_types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -92,5 +92,5 @@ pub fn decode_into_transaction(rlp_tx: &Bytes) -> Result<Transaction> {
let mut raw_tx = raw_tx.as_slice();
let transaction_recovered: TransactionSignedEcRecovered = TransactionSignedEcRecovered::decode(&mut raw_tx)?;

Ok(reth_rpc_types_compat::transaction::from_recovered::<EthTxBuilder>(transaction_recovered, &EthTxBuilder)?)
Ok(reth_rpc_types_compat::transaction::from_recovered(transaction_recovered, &EthTxBuilder::default())?)
}
4 changes: 2 additions & 2 deletions crates/node/db-access/src/reth_worker.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ use alloy_eips::{BlockHashOrNumber, BlockNumHash};
use alloy_network::Ethereum;
use alloy_primitives::{Address, BlockHash, B256};
use alloy_provider::Provider;
use alloy_rpc_types::{Block, BlockTransactions, Log, Transaction};
use alloy_rpc_types::{Block, BlockTransactions, Log};
use alloy_rpc_types_trace::geth::AccountState;
use alloy_transport::Transport;
use chrono::Utc;
Expand Down Expand Up @@ -104,7 +104,7 @@ where
debug!("block_with_senders_reth : txs {}", block_with_senders_reth.body.transactions.len());

//convert RETH->RPCx
let block_with_senders_rpc = reth_rpc_types_compat::block::from_block_with_tx_hashes::<Transaction>(block_with_senders_reth, block_header.total_difficulty.unwrap_or_default(), Some(block_header.hash));
let block_with_senders_rpc = reth_rpc_types_compat::block::from_block_with_tx_hashes(block_with_senders_reth, block_header.total_difficulty.unwrap_or_default(), Some(block_header.hash));

let txs = BlockTransactions::Full(block_with_senders_rpc.transactions.clone().into_transactions().collect());
// remove OtherFields
Expand Down
48 changes: 0 additions & 48 deletions crates/node/debug-provider/src/anvilprovider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -171,52 +171,4 @@ mod test {

Ok(())
}

#[derive(Clone)]
struct DynPrv<T> {
pub provider: Arc<Box<dyn Provider<T>>>,
}

impl<T> Deref for DynPrv<T>
where
T: Transport + Clone,
{
type Target = Arc<Box<dyn Provider<T> + 'static>>;

fn deref(&self) -> &Self::Target {
&self.provider
}
}

struct DynProvider {
inner: DynPrv<BoxTransport>,
}

impl From<DynPrv<Http<Client>>> for DynProvider {
fn from(value: DynPrv<Http<Client>>) -> Self {
let provider = DynPrv { provider: Arc::new(Box::new(ProviderBuilder::new().on_provider(value.root().clone().boxed()))) };
Self { inner: provider }
}
}

impl Provider for DynProvider {
fn root(&self) -> &RootProvider<BoxTransport, Ethereum> {
self.inner.root()
}
}

#[tokio::test]
async fn test_dyn_provider() -> Result<()> {
let provider = ProviderBuilder::new().with_recommended_fillers().on_anvil();

let dyn_prv = Arc::new(Box::new(provider) as Box<dyn Provider<_>>);

let dyn_prv = DynPrv { provider: dyn_prv.clone() };

let dyn_prv = DynProvider::from(dyn_prv);

let _ = dyn_prv.anvil_drop_all_transactions().await;

Ok(())
}
}
68 changes: 0 additions & 68 deletions crates/node/debug-provider/src/dynprovider.rs

This file was deleted.

1 change: 0 additions & 1 deletion crates/node/debug-provider/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,4 @@ mod anvilprovider;
mod archiveprovider;
mod cachefolder;
mod debugprovider;
mod dynprovider;
mod httpcached;
2 changes: 1 addition & 1 deletion crates/node/exex/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ alloy-eips.workspace = true
alloy-network.workspace = true
alloy-primitives.workspace = true
alloy-rpc-types.workspace = true
alloy-rpc-types-eth.workspace = true

#reth
reth-exex.workspace = true
reth-node-api.workspace = true
reth-primitives.workspace = true
reth-provider.workspace = true
reth-rpc.workspace = true
reth-rpc-types-compat.workspace = true
Expand Down
Loading

0 comments on commit a0d3737

Please sign in to comment.