Skip to content

Commit

Permalink
Merge branch 'main' into emhane/ethapi-types
Browse files Browse the repository at this point in the history
  • Loading branch information
emhane committed Sep 18, 2024
2 parents 67d4ba8 + 94c15c0 commit a3c203b
Show file tree
Hide file tree
Showing 112 changed files with 1,610 additions and 932 deletions.
46 changes: 25 additions & 21 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -427,6 +427,7 @@ alloy-eips = { version = "0.3.5", default-features = false }
alloy-genesis = { version = "0.3.5", default-features = false }
alloy-json-rpc = { version = "0.3.5", default-features = false }
alloy-network = { version = "0.3.5", default-features = false }
alloy-network-primitives = { version = "0.3.5", default-features = false }
alloy-node-bindings = { version = "0.3.5", default-features = false }
alloy-provider = { version = "0.3.5", features = [
"reqwest",
Expand Down Expand Up @@ -454,7 +455,6 @@ alloy-transport-http = { version = "0.3.5", features = [
], default-features = false }
alloy-transport-ipc = { version = "0.3.5", default-features = false }
alloy-transport-ws = { version = "0.3.5", default-features = false }
alloy-network-primitives = { version = "0.3.5", default-features = false }

# op
op-alloy-rpc-types = "0.2.10"
Expand Down
1 change: 1 addition & 0 deletions book/cli/reth/node.md
Original file line number Diff line number Diff line change
Expand Up @@ -545,6 +545,7 @@ Debug:
Example: `witness,prestate`
[default: witness]
[possible values: witness, pre-state, opcode]
--debug.healthy-node-rpc-url <URL>
Expand Down
1 change: 1 addition & 0 deletions clippy.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
msrv = "1.81"
too-large-for-stack = 128
doc-valid-idents = ["P2P", "ExEx", "ExExes", "IPv4", "IPv6", "KiB", "MiB", "GiB", "TiB", "PiB", "EiB"]
3 changes: 3 additions & 0 deletions crates/blockchain-tree-api/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,8 @@ reth-execution-errors.workspace = true
reth-primitives.workspace = true
reth-storage-errors.workspace = true

# alloy
alloy-primitives.workspace = true

# misc
thiserror.workspace = true
3 changes: 2 additions & 1 deletion crates/blockchain-tree-api/src/error.rs
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
//! Error handling for the blockchain tree
use alloy_primitives::{BlockHash, BlockNumber};
use reth_consensus::ConsensusError;
use reth_execution_errors::{
BlockExecutionError, BlockValidationError, InternalBlockExecutionError,
};
use reth_primitives::{BlockHash, BlockNumber, SealedBlock};
use reth_primitives::SealedBlock;
pub use reth_storage_errors::provider::ProviderError;

/// Various error cases that can occur when a block violates tree assumptions.
Expand Down
6 changes: 2 additions & 4 deletions crates/blockchain-tree-api/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@

use self::error::CanonicalError;
use crate::error::InsertBlockError;
use reth_primitives::{
BlockHash, BlockNumHash, BlockNumber, Receipt, SealedBlock, SealedBlockWithSenders,
SealedHeader,
};
use alloy_primitives::{BlockHash, BlockNumber};
use reth_primitives::{BlockNumHash, Receipt, SealedBlock, SealedBlockWithSenders, SealedHeader};
use reth_storage_errors::provider::{ProviderError, ProviderResult};
use std::collections::BTreeMap;

Expand Down
10 changes: 5 additions & 5 deletions crates/blockchain-tree/src/blockchain_tree.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1378,7 +1378,7 @@ mod tests {
use alloy_primitives::{keccak256, Address, B256};
use assert_matches::assert_matches;
use linked_hash_set::LinkedHashSet;
use reth_chainspec::{ChainSpecBuilder, MAINNET};
use reth_chainspec::{ChainSpecBuilder, MAINNET, MIN_TRANSACTION_GAS};
use reth_consensus::test_utils::TestConsensus;
use reth_db::tables;
use reth_db_api::transaction::DbTxMut;
Expand Down Expand Up @@ -1558,13 +1558,13 @@ mod tests {
provider_rw.commit().unwrap();
}

let single_tx_cost = U256::from(EIP1559_INITIAL_BASE_FEE * 21_000);
let single_tx_cost = U256::from(EIP1559_INITIAL_BASE_FEE * MIN_TRANSACTION_GAS);
let mock_tx = |nonce: u64| -> TransactionSignedEcRecovered {
TransactionSigned::from_transaction_and_signature(
Transaction::Eip1559(TxEip1559 {
chain_id: chain_spec.chain.id(),
nonce,
gas_limit: 21_000,
gas_limit: MIN_TRANSACTION_GAS as u128,
to: Address::ZERO.into(),
max_fee_per_gas: EIP1559_INITIAL_BASE_FEE as u128,
..Default::default()
Expand All @@ -1587,7 +1587,7 @@ mod tests {
Receipt {
tx_type: tx.tx_type(),
success: true,
cumulative_gas_used: (idx as u64 + 1) * 21_000,
cumulative_gas_used: (idx as u64 + 1) * MIN_TRANSACTION_GAS,
..Default::default()
}
.with_bloom()
Expand All @@ -1602,7 +1602,7 @@ mod tests {
header: Header {
number,
parent_hash: parent.unwrap_or_default(),
gas_used: body.len() as u64 * 21_000,
gas_used: body.len() as u64 * MIN_TRANSACTION_GAS,
gas_limit: chain_spec.max_gas_limit,
mix_hash: B256::random(),
base_fee_per_gas: Some(EIP1559_INITIAL_BASE_FEE),
Expand Down
3 changes: 3 additions & 0 deletions crates/chain-state/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ reth-primitives.workspace = true
reth-storage-api.workspace = true
reth-trie.workspace = true

# alloy
alloy-primitives.workspace = true

# async
tokio = { workspace = true, features = ["sync", "macros", "rt-multi-thread"] }
tokio-stream = { workspace = true, features = ["sync"] }
Expand Down
3 changes: 2 additions & 1 deletion crates/chain-state/src/chain_info.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
use alloy_primitives::BlockNumber;
use parking_lot::RwLock;
use reth_chainspec::ChainInfo;
use reth_primitives::{BlockNumHash, BlockNumber, SealedHeader};
use reth_primitives::{BlockNumHash, SealedHeader};
use std::{
sync::{
atomic::{AtomicU64, Ordering},
Expand Down
10 changes: 5 additions & 5 deletions crates/chain-state/src/in_memory.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,14 @@ use crate::{
CanonStateNotification, CanonStateNotificationSender, CanonStateNotifications,
ChainInfoTracker, MemoryOverlayStateProvider,
};
use alloy_primitives::{Address, TxHash, B256};
use parking_lot::RwLock;
use reth_chainspec::ChainInfo;
use reth_execution_types::{Chain, ExecutionOutcome};
use reth_metrics::{metrics::Gauge, Metrics};
use reth_primitives::{
Address, BlockNumHash, Header, Receipt, Receipts, SealedBlock, SealedBlockWithSenders,
SealedHeader, TransactionMeta, TransactionSigned, TxHash, B256,
BlockNumHash, Header, Receipt, Receipts, SealedBlock, SealedBlockWithSenders, SealedHeader,
TransactionMeta, TransactionSigned,
};
use reth_storage_api::StateProviderBox;
use reth_trie::{updates::TrieUpdates, HashedPostState};
Expand Down Expand Up @@ -830,11 +831,10 @@ impl NewCanonicalChain {
mod tests {
use super::*;
use crate::test_utils::TestBlockBuilder;
use alloy_primitives::{BlockNumber, Bytes, StorageKey, StorageValue};
use rand::Rng;
use reth_errors::ProviderResult;
use reth_primitives::{
Account, BlockNumber, Bytecode, Bytes, Receipt, Requests, StorageKey, StorageValue,
};
use reth_primitives::{Account, Bytecode, Receipt, Requests};
use reth_storage_api::{
AccountReader, BlockHashReader, StateProofProvider, StateProvider, StateRootProvider,
StorageRootProvider,
Expand Down
5 changes: 2 additions & 3 deletions crates/chain-state/src/memory_overlay.rs
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
use super::ExecutedBlock;
use alloy_primitives::{keccak256, Address, BlockNumber, Bytes, StorageKey, StorageValue, B256};
use reth_errors::ProviderResult;
use reth_primitives::{
keccak256, Account, Address, BlockNumber, Bytecode, Bytes, StorageKey, StorageValue, B256,
};
use reth_primitives::{Account, Bytecode};
use reth_storage_api::{
AccountReader, BlockHashReader, StateProofProvider, StateProvider, StateProviderBox,
StateRootProvider, StorageRootProvider,
Expand Down
Loading

0 comments on commit a3c203b

Please sign in to comment.