Skip to content

Commit

Permalink
chore: automatic cargo update + manual alloy-* and revm-* update (#1498)
Browse files Browse the repository at this point in the history
  • Loading branch information
morph-dev authored Oct 9, 2024
1 parent 1130d49 commit ae394cd
Show file tree
Hide file tree
Showing 9 changed files with 309 additions and 387 deletions.
629 changes: 275 additions & 354 deletions Cargo.lock

Large diffs are not rendered by default.

16 changes: 10 additions & 6 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,11 @@ categories = ["cryptography::cryptocurrencies"]
description = "A Rust implementation of the Ethereum Portal Network"

[dependencies]
alloy-eips.workspace = true
alloy-primitives.workspace = true
alloy = { version = "=0.3.6", features = ["full"]}
alloy-provider = { version = "0.4.2", features = ["ipc", "ws"]}
alloy-pubsub = { version = "0.4.2" }
alloy-rpc-types.workspace = true
anyhow.workspace = true
clap.workspace = true
dirs = "5.0.1"
Expand Down Expand Up @@ -77,10 +80,11 @@ members = [
]

[workspace.dependencies]
alloy-consensus = "0.3.6"
alloy-primitives = "0.8.3"
alloy-consensus = "0.4.2"
alloy-eips = "0.4.2"
alloy-primitives = { version ="0.8.7" , features = ["map-hashbrown"] }
alloy-rlp = "0.3.8"
alloy-rpc-types = "0.3.6"
alloy-rpc-types = "0.4.2"
anyhow = "1.0.68"
async-trait = "0.1.68"
bytes = "1.3.0"
Expand Down Expand Up @@ -111,8 +115,8 @@ r2d2_sqlite = "0.24.0"
rand = "0.8.5"
reqwest = { version = "0.12.7", features = ["native-tls-vendored", "json"] }
reth-ipc = { tag = "v1.0.7", git = "https://github.com/paradigmxyz/reth.git"}
revm = { version = "14.0.2", default-features = false, features = ["std", "secp256k1", "serde-json", "c-kzg"] }
revm-primitives = { version = "9.0.2", default-features = false, features = ["std", "serde"] }
revm = { version = "14.0.3", default-features = false, features = ["std", "secp256k1", "serde-json", "c-kzg"] }
revm-primitives = { version = "10.0.0", default-features = false, features = ["std", "serde"] }
rpc = { path = "rpc"}
rstest = "0.18.2"
rusqlite = { version = "0.31.0", features = ["bundled"] }
Expand Down
2 changes: 1 addition & 1 deletion src/bin/poll_latest.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use alloy::providers::{Provider, ProviderBuilder, WsConnect};
use alloy_primitives::B256;
use alloy_provider::{Provider, ProviderBuilder, WsConnect};
use anyhow::{anyhow, Result};
use clap::Parser;
use ethportal_api::{
Expand Down
6 changes: 2 additions & 4 deletions src/bin/sample_range.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@ use std::{
sync::{Arc, Mutex},
};

use alloy::{
eips::BlockNumberOrTag,
providers::{Provider, ProviderBuilder},
};
use alloy_eips::BlockNumberOrTag;
use alloy_primitives::B256;
use alloy_provider::{Provider, ProviderBuilder};
use anyhow::Result;
use clap::Parser;
use futures::StreamExt;
Expand Down
12 changes: 5 additions & 7 deletions tests/rpc_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,9 @@
use std::fs;
use std::net::{IpAddr, Ipv4Addr};

use alloy::{
providers::{IpcConnect, Provider, ProviderBuilder, RootProvider},
pubsub::PubSubFrontend,
rpc::types::{BlockTransactions, BlockTransactionsKind},
};
use alloy_provider::{IpcConnect, Provider, ProviderBuilder, RootProvider};
use alloy_pubsub::PubSubFrontend;
use alloy_rpc_types::{BlockTransactions, BlockTransactionsKind};
use ethportal_api::ContentValue;
use jsonrpsee::async_client::Client;
use serde_yaml::Value;
Expand Down Expand Up @@ -163,8 +161,8 @@ async fn test_eth_get_block_by_hash() {
assert_eq!(block.header.receipts_root, receipts_root);
assert_eq!(block.header.extra_data, extra_data);
assert_eq!(block.header.mix_hash, mix_hash);
assert_eq!(block.header.gas_used, gas_used.to());
assert_eq!(block.header.gas_limit, gas_limit.to());
assert_eq!(block.header.gas_used, gas_used.to::<u64>());
assert_eq!(block.header.gas_limit, gas_limit.to::<u64>());
assert_eq!(block.header.difficulty, difficulty);
assert_eq!(block.header.timestamp, timestamp);
assert_eq!(block.size, None);
Expand Down
2 changes: 1 addition & 1 deletion trin-evm/src/tx_env_modifier.rs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ impl TxEnvModifier for TransactionRequest {
tx_env.gas_priority_fee = self.max_priority_fee_per_gas.map(U256::from);
tx_env.max_fee_per_blob_gas = self.max_fee_per_blob_gas.map(U256::from);
if let Some(gas) = self.gas {
tx_env.gas_limit = gas as u64;
tx_env.gas_limit = gas;
}
if let Some(value) = self.value {
tx_env.value = value;
Expand Down
7 changes: 3 additions & 4 deletions trin-execution/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@ authors = ["https://github.com/ethereum/trin/graphs/contributors"]

[dependencies]
alloy-consensus.workspace = true
alloy-eips = "0.3.6"
alloy-eips.workspace = true
alloy-primitives.workspace = true
alloy-rlp.workspace = true
alloy-rpc-types.workspace = true
alloy-rpc-types-engine = "0.3.6"
alloy-rpc-types = { workspace = true, features = ["engine"]}
anyhow.workspace = true
clap.workspace = true
ethportal-api.workspace = true
Expand All @@ -31,7 +30,7 @@ prometheus_exporter.workspace = true
rayon = "1.10.0"
reqwest.workspace = true
revm.workspace = true
revm-inspectors = "0.7.4"
revm-inspectors = "0.8.1"
revm-primitives.workspace = true
rocksdb = "0.22.0"
serde = { workspace = true, features = ["rc"] }
Expand Down
14 changes: 8 additions & 6 deletions trin-execution/src/engine/rpc.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
use alloy_rlp::Bytes;
use alloy_rpc_types::{Block, BlockId, Filter, Log, SyncStatus, TransactionRequest};
use alloy_rpc_types_engine::{
ExecutionPayloadBodiesV1, ExecutionPayloadBodiesV2, ExecutionPayloadInputV2,
ExecutionPayloadV1, ExecutionPayloadV2, ExecutionPayloadV3, ExecutionPayloadV4,
ForkchoiceState, ForkchoiceUpdated, PayloadAttributes, PayloadId, PayloadStatus,
TransitionConfiguration,
use alloy_rpc_types::{
engine::{
ExecutionPayloadBodiesV1, ExecutionPayloadBodiesV2, ExecutionPayloadInputV2,
ExecutionPayloadV1, ExecutionPayloadV2, ExecutionPayloadV3, ExecutionPayloadV4,
ForkchoiceState, ForkchoiceUpdated, PayloadAttributes, PayloadId, PayloadStatus,
TransitionConfiguration,
},
Block, BlockId, Filter, Log, SyncStatus, TransactionRequest,
};
use jsonrpsee::{core::RpcResult, proc_macros::rpc};
use revm_primitives::{Address, B256, U256};
Expand Down
8 changes: 4 additions & 4 deletions trin-execution/src/storage/evm_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ use crate::{
storage::error::EVMError,
};
use alloy_consensus::EMPTY_ROOT_HASH;
use alloy_primitives::{Address, B256, U256};
use alloy_primitives::{keccak256, map::FbHashMap, Address, B256, U256};
use alloy_rlp::Decodable;
use eth_trie::{EthTrie, RootWithTrieDiff, Trie};
use ethportal_api::types::state_trie::account_state::AccountState;
Expand All @@ -19,7 +19,7 @@ use revm::{
db::{states::PlainStorageChangeset, BundleState, OriginalValuesKnown},
Database, DatabaseRef,
};
use revm_primitives::{keccak256, AccountInfo, Bytecode, HashMap, KECCAK_EMPTY};
use revm_primitives::{AccountInfo, Bytecode, KECCAK_EMPTY};
use rocksdb::DB as RocksDB;
use tracing::info;

Expand All @@ -38,7 +38,7 @@ pub struct EvmDB {
/// State config
pub config: StateConfig,
/// Storage cache for the accounts used optionally for gossiping, keyed by address hash.
pub storage_cache: Arc<Mutex<HashMap<B256, HashSet<B256>>>>,
pub storage_cache: Arc<Mutex<FbHashMap<32, HashSet<B256>>>>,
/// The underlying database.
pub db: Arc<RocksDB>,
/// To get proofs and to verify trie state.
Expand All @@ -65,7 +65,7 @@ impl EvmDB {
},
));

let storage_cache = Arc::new(Mutex::new(HashMap::new()));
let storage_cache = Arc::new(Mutex::new(FbHashMap::default()));
Ok(Self {
config,
storage_cache,
Expand Down

0 comments on commit ae394cd

Please sign in to comment.