Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
309 changes: 173 additions & 136 deletions Cargo.lock

Large diffs are not rendered by default.

54 changes: 27 additions & 27 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -170,39 +170,39 @@ foundry-linking = { path = "crates/linking" }
# solc & compilation utilities
foundry-block-explorers = { version = "0.7.3", default-features = false }
foundry-compilers = { version = "0.11.6", default-features = false }
foundry-fork-db = "0.4.0"
foundry-fork-db = "0.5.0"
solang-parser = "=0.3.3"

## revm
revm = { version = "14.0.3", default-features = false }
revm-primitives = { version = "10.0.0", default-features = false }
revm-inspectors = { version = "0.8.0", features = ["serde"] }
revm = { version = "16.0.0", default-features = false }
revm-primitives = { version = "12.0.0", default-features = false }
revm-inspectors = { version = "0.9.0", features = ["serde"] }

## ethers
ethers-contract-abigen = { version = "2.0.14", default-features = false }

## alloy
alloy-consensus = { version = "0.4.2", default-features = false }
alloy-contract = { version = "0.4.2", default-features = false }
alloy-eips = { version = "0.4.2", default-features = false }
alloy-genesis = { version = "0.4.2", default-features = false }
alloy-json-rpc = { version = "0.4.2", default-features = false }
alloy-network = { version = "0.4.2", default-features = false }
alloy-provider = { version = "0.4.2", default-features = false }
alloy-pubsub = { version = "0.4.2", default-features = false }
alloy-rpc-client = { version = "0.4.2", default-features = false }
alloy-rpc-types = { version = "0.4.2", default-features = true }
alloy-serde = { version = "0.4.2", default-features = false }
alloy-signer = { version = "0.4.2", default-features = false }
alloy-signer-aws = { version = "0.4.2", default-features = false }
alloy-signer-gcp = { version = "0.4.2", default-features = false }
alloy-signer-ledger = { version = "0.4.2", default-features = false }
alloy-signer-local = { version = "0.4.2", default-features = false }
alloy-signer-trezor = { version = "0.4.2", default-features = false }
alloy-transport = { version = "0.4.2", default-features = false }
alloy-transport-http = { version = "0.4.2", default-features = false }
alloy-transport-ipc = { version = "0.4.2", default-features = false }
alloy-transport-ws = { version = "0.4.2", default-features = false }
alloy-consensus = { version = "0.5.2", default-features = false }
alloy-contract = { version = "0.5.2", default-features = false }
alloy-eips = { version = "0.5.2", default-features = false }
alloy-genesis = { version = "0.5.2", default-features = false }
alloy-json-rpc = { version = "0.5.2", default-features = false }
alloy-network = { version = "0.5.2", default-features = false }
alloy-provider = { version = "0.5.2", default-features = false }
alloy-pubsub = { version = "0.5.2", default-features = false }
alloy-rpc-client = { version = "0.5.2", default-features = false }
alloy-rpc-types = { version = "0.5.2", default-features = true }
alloy-serde = { version = "0.5.2", default-features = false }
alloy-signer = { version = "0.5.2", default-features = false }
alloy-signer-aws = { version = "0.5.2", default-features = false }
alloy-signer-gcp = { version = "0.5.2", default-features = false }
alloy-signer-ledger = { version = "0.5.2", default-features = false }
alloy-signer-local = { version = "0.5.2", default-features = false }
alloy-signer-trezor = { version = "0.5.2", default-features = false }
alloy-transport = { version = "0.5.2", default-features = false }
alloy-transport-http = { version = "0.5.2", default-features = false }
alloy-transport-ipc = { version = "0.5.2", default-features = false }
alloy-transport-ws = { version = "0.5.2", default-features = false }

## alloy-core
alloy-dyn-abi = "0.8.5"
Expand All @@ -222,8 +222,8 @@ alloy-rlp = "0.3"
alloy-trie = "0.6.0"

## op-alloy
op-alloy-rpc-types = "0.3.3"
op-alloy-consensus = "0.3.3"
op-alloy-rpc-types = "0.5.0"
op-alloy-consensus = "0.5.0"

# macros
proc-macro2 = "1.0.82"
Expand Down
10 changes: 5 additions & 5 deletions crates/anvil/core/src/eth/block.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ impl Block {
parent_beacon_block_root: partial_header.parent_beacon_block_root,
nonce: partial_header.nonce,
base_fee_per_gas: partial_header.base_fee,
requests_root: None,
requests_hash: None,
},
transactions,
ommers,
Expand Down Expand Up @@ -160,7 +160,7 @@ mod tests {
excess_blob_gas: Default::default(),
parent_beacon_block_root: Default::default(),
base_fee_per_gas: None,
requests_root: None,
requests_hash: None,
};

let encoded = alloy_rlp::encode(&header);
Expand Down Expand Up @@ -201,7 +201,7 @@ mod tests {
parent_beacon_block_root: None,
nonce: B64::ZERO,
base_fee_per_gas: None,
requests_root: None,
requests_hash: None,
};

header.encode(&mut data);
Expand Down Expand Up @@ -234,7 +234,7 @@ mod tests {
excess_blob_gas: None,
parent_beacon_block_root: None,
base_fee_per_gas: None,
requests_root: None,
requests_hash: None,
};
let header = Header::decode(&mut data.as_slice()).unwrap();
assert_eq!(header, expected);
Expand Down Expand Up @@ -266,7 +266,7 @@ mod tests {
blob_gas_used: None,
excess_blob_gas: None,
parent_beacon_block_root: None,
requests_root: None,
requests_hash: None,
};
assert_eq!(header.hash_slow(), expected_hash);
}
Expand Down
2 changes: 0 additions & 2 deletions crates/anvil/core/src/eth/transaction/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1637,7 +1637,6 @@ pub fn convert_to_anvil_receipt(receipt: AnyTransactionReceipt) -> Option<Receip
to,
blob_gas_price,
blob_gas_used,
state_root,
inner: AnyReceiptEnvelope { inner: receipt_with_bloom, r#type },
authorization_list,
},
Expand All @@ -1656,7 +1655,6 @@ pub fn convert_to_anvil_receipt(receipt: AnyTransactionReceipt) -> Option<Receip
to,
blob_gas_price,
blob_gas_used,
state_root,
authorization_list,
inner: match r#type {
0x00 => TypedReceipt::Legacy(receipt_with_bloom),
Expand Down
5 changes: 2 additions & 3 deletions crates/anvil/src/eth/backend/mem/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1861,7 +1861,7 @@ impl Backend {
gas_limit,
gas_used,
timestamp,
requests_root,
requests_hash,
extra_data,
mix_hash,
nonce,
Expand Down Expand Up @@ -1896,7 +1896,7 @@ impl Backend {
blob_gas_used,
excess_blob_gas,
parent_beacon_block_root,
requests_root,
requests_hash,
},
size: Some(size),
transactions: alloy_rpc_types::BlockTransactions::Hashes(
Expand Down Expand Up @@ -2416,7 +2416,6 @@ impl Backend {
block_hash: Some(block_hash),
from: info.from,
to: info.to,
state_root: None,
blob_gas_price: Some(blob_gas_price),
blob_gas_used: blob_gas_used.map(|g| g as u128),
authorization_list: None,
Expand Down
2 changes: 1 addition & 1 deletion crates/anvil/src/hardfork.rs
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ impl From<EthereumHardfork> for SpecId {
EthereumHardfork::Cancun | EthereumHardfork::Latest => Self::CANCUN,
EthereumHardfork::Prague => Self::PRAGUE,
// TODO: switch to latest after activation
EthereumHardfork::PragueEOF => Self::PRAGUE_EOF,
EthereumHardfork::PragueEOF => Self::PRAGUE,
Comment thread
yash-atreya marked this conversation as resolved.
Outdated
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions crates/anvil/tests/it/eip7702.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::utils::http_provider;
use alloy_consensus::{transaction::TxEip7702, SignableTransaction};
use alloy_network::{ReceiptResponse, TransactionBuilder, TxSignerSync};
use alloy_primitives::{bytes, U256};
use alloy_primitives::bytes;
use alloy_provider::Provider;
use alloy_rpc_types::{Authorization, TransactionRequest};
use alloy_serde::WithOtherFields;
Expand Down Expand Up @@ -44,7 +44,7 @@ async fn can_send_eip7702_tx() {

let contract = receipt.contract_address.unwrap();
let authorization = Authorization {
chain_id: U256::from(31337u64),
chain_id: 31337u64,
address: contract,
nonce: provider.get_transaction_count(from).await.unwrap(),
};
Expand Down
8 changes: 4 additions & 4 deletions crates/anvil/tests/it/optimism.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ use alloy_rpc_types::TransactionRequest;
use alloy_serde::WithOtherFields;
use anvil::{spawn, EthereumHardfork, NodeConfig};
use anvil_core::eth::transaction::optimism::DepositTransaction;
use op_alloy_rpc_types::OptimismTransactionFields;
use op_alloy_rpc_types::OpTransactionFields;

#[tokio::test(flavor = "multi_thread")]
async fn test_deposits_not_supported_if_optimism_disabled() {
Expand All @@ -26,7 +26,7 @@ async fn test_deposits_not_supported_if_optimism_disabled() {
.with_value(U256::from(1234))
.with_gas_limit(21000);

let op_fields = OptimismTransactionFields {
let op_fields = OpTransactionFields {
source_hash: Some(b256!(
"0000000000000000000000000000000000000000000000000000000000000000"
)),
Expand Down Expand Up @@ -63,7 +63,7 @@ async fn test_send_value_deposit_transaction() {
let send_value = U256::from(1234);
let before_balance_to = provider.get_balance(to).await.unwrap();

let op_fields = OptimismTransactionFields {
let op_fields = OpTransactionFields {
source_hash: Some(b256!(
"0000000000000000000000000000000000000000000000000000000000000000"
)),
Expand Down Expand Up @@ -123,7 +123,7 @@ async fn test_send_value_raw_deposit_transaction() {
.with_max_fee_per_gas(20_000_000_000)
.with_max_priority_fee_per_gas(1_000_000_000);

let op_fields = OptimismTransactionFields {
let op_fields = OpTransactionFields {
source_hash: Some(b256!(
"0000000000000000000000000000000000000000000000000000000000000000"
)),
Expand Down
4 changes: 2 additions & 2 deletions crates/cast/bin/cmd/wallet/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use alloy_signer_local::{
coins_bip39::{English, Entropy, Mnemonic},
MnemonicBuilder, PrivateKeySigner,
};
use cast::revm::primitives::{Authorization, U256};
use cast::revm::primitives::Authorization;
use clap::Parser;
use eyre::{Context, Result};
use foundry_cli::{opts::RpcOpts, utils};
Expand Down Expand Up @@ -363,7 +363,7 @@ impl WalletSubcommands {
} else {
provider.get_chain_id().await?
};
let auth = Authorization { chain_id: U256::from(chain_id), address, nonce };
let auth = Authorization { chain_id, address, nonce };
let signature = wallet.sign_hash(&auth.signature_hash()).await?;
let auth = auth.into_signed(signature);
println!("{}", hex::encode_prefixed(alloy_rlp::encode(&auth)));
Expand Down
9 changes: 3 additions & 6 deletions crates/cast/bin/tx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ use alloy_json_abi::Function;
use alloy_network::{
AnyNetwork, TransactionBuilder, TransactionBuilder4844, TransactionBuilder7702,
};
use alloy_primitives::{hex, Address, Bytes, TxKind, U256};
use alloy_primitives::{hex, Address, Bytes, TxKind};
use alloy_provider::Provider;
use alloy_rpc_types::{AccessList, Authorization, TransactionInput, TransactionRequest};
use alloy_serde::WithOtherFields;
Expand Down Expand Up @@ -379,11 +379,8 @@ where

let auth = match auth {
CliAuthorizationList::Address(address) => {
let auth = Authorization {
chain_id: U256::from(self.chain.id()),
nonce: tx_nonce + 1,
address,
};
let auth =
Authorization { chain_id: self.chain.id(), nonce: tx_nonce + 1, address };

let Some(signer) = sender.as_signer() else {
eyre::bail!("No signer available to sign authorization");
Expand Down
6 changes: 3 additions & 3 deletions crates/cast/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ where
pub async fn send(
&self,
tx: WithOtherFields<TransactionRequest>,
) -> Result<PendingTransactionBuilder<'_, T, AnyNetwork>> {
) -> Result<PendingTransactionBuilder<T, AnyNetwork>> {
let res = self.provider.send_transaction(tx).await?;

Ok(res)
Expand All @@ -305,7 +305,7 @@ where
pub async fn publish(
&self,
mut raw_tx: String,
) -> Result<PendingTransactionBuilder<'_, T, AnyNetwork>> {
) -> Result<PendingTransactionBuilder<T, AnyNetwork>> {
raw_tx = match raw_tx.strip_prefix("0x") {
Some(s) => s.to_string(),
None => raw_tx,
Expand Down Expand Up @@ -783,7 +783,7 @@ where
if cast_async {
eyre::bail!("tx not found: {:?}", tx_hash)
} else {
PendingTransactionBuilder::new(self.provider.root(), tx_hash)
PendingTransactionBuilder::new(self.provider.root().clone(), tx_hash)
.with_required_confirmations(confs)
.with_timeout(timeout.map(Duration::from_secs))
.get_receipt()
Expand Down
2 changes: 1 addition & 1 deletion crates/cheatcodes/src/inspector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ pub trait CheatcodesExecutor {
evm.context.evm.inner.journaled_state.depth += 1;

// Handle EOF bytecode
let first_frame_or_result = if evm.handler.cfg.spec_id.is_enabled_in(SpecId::PRAGUE_EOF) &&
let first_frame_or_result = if evm.handler.cfg.spec_id.is_enabled_in(SpecId::PRAGUE) &&
inputs.scheme == CreateScheme::Create &&
inputs.init_code.starts_with(&EOF_MAGIC_BYTES)
{
Expand Down
1 change: 1 addition & 0 deletions crates/common/fmt/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ yansi.workspace = true

# ui
alloy-consensus.workspace = true
alloy-network.workspace = true
alloy-rpc-types = { workspace = true, features = ["eth"] }
alloy-serde.workspace = true
serde.workspace = true
Expand Down
4 changes: 2 additions & 2 deletions crates/common/fmt/src/ui.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
//! Helper trait and functions to format Ethereum types.

use alloy_consensus::{AnyReceiptEnvelope, Eip658Value, Receipt, ReceiptWithBloom, TxType};
use alloy_network::ReceiptResponse;
use alloy_primitives::{hex, Address, Bloom, Bytes, FixedBytes, Uint, B256, I256, U256, U64};
use alloy_rpc_types::{
AccessListItem, AnyNetworkBlock, AnyTransactionReceipt, Block, BlockTransactions, Log,
Expand Down Expand Up @@ -169,7 +170,6 @@ impl UIfmt for AnyTransactionReceipt {
to,
gas_used,
contract_address,
state_root,
effective_gas_price,
inner:
AnyReceiptEnvelope {
Expand Down Expand Up @@ -215,7 +215,7 @@ authorizationList {}",
gas_used.pretty(),
serde_json::to_string(&logs).unwrap(),
logs_bloom.pretty(),
state_root.pretty(),
self.state_root().pretty(),
status.pretty(),
transaction_hash.pretty(),
transaction_index.pretty(),
Expand Down
2 changes: 1 addition & 1 deletion crates/common/src/provider/runtime_transport.rs
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ impl RuntimeTransport {
/// Connects to a WS transport.
async fn connect_ws(&self) -> Result<InnerTransport, RuntimeTransportError> {
let auth = self.jwt.as_ref().and_then(|jwt| build_auth(jwt.clone()).ok());
let ws = WsConnect { url: self.url.to_string(), auth }
let ws = WsConnect { url: self.url.to_string(), auth, config: None }
.into_service()
.await
.map_err(|e| RuntimeTransportError::TransportError(e, self.url.to_string()))?;
Expand Down
6 changes: 3 additions & 3 deletions crates/common/src/transactions.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
use alloy_consensus::{Transaction, TxEnvelope};
use alloy_primitives::{Address, TxKind, U256};
use alloy_provider::{
network::{AnyNetwork, TransactionBuilder},
network::{AnyNetwork, ReceiptResponse, TransactionBuilder},
Provider,
};
use alloy_rpc_types::{AnyTransactionReceipt, BlockId, TransactionRequest};
Expand Down Expand Up @@ -122,7 +122,7 @@ pub fn get_pretty_tx_receipt_attr(
"gasUsed" | "gas_used" => Some(receipt.receipt.gas_used.to_string()),
"logs" => Some(receipt.receipt.inner.inner.inner.receipt.logs.as_slice().pretty()),
"logsBloom" | "logs_bloom" => Some(receipt.receipt.inner.inner.inner.logs_bloom.pretty()),
"root" | "stateRoot" | "state_root " => Some(receipt.receipt.state_root.pretty()),
"root" | "stateRoot" | "state_root " => Some(receipt.receipt.state_root().pretty()),
"status" | "statusCode" | "status_code" => {
Some(receipt.receipt.inner.inner.inner.receipt.status.pretty())
}
Expand Down Expand Up @@ -201,7 +201,7 @@ impl TransactionMaybeSigned {

pub fn to(&self) -> Option<TxKind> {
match self {
Self::Signed { tx, .. } => Some(tx.to()),
Self::Signed { tx, .. } => Some(tx.kind()),
Self::Unsigned(tx) => tx.to,
}
}
Expand Down
4 changes: 2 additions & 2 deletions crates/config/src/utils.rs
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,7 @@ impl FromStr for Numeric {
#[inline]
pub fn evm_spec_id(evm_version: &EvmVersion, alphanet: bool) -> SpecId {
if alphanet {
return SpecId::PRAGUE_EOF;
Comment thread
yash-atreya marked this conversation as resolved.
return SpecId::PRAGUE;
}
match evm_version {
EvmVersion::Homestead => SpecId::HOMESTEAD,
Expand All @@ -316,7 +316,7 @@ pub fn evm_spec_id(evm_version: &EvmVersion, alphanet: bool) -> SpecId {
EvmVersion::Paris => SpecId::MERGE,
EvmVersion::Shanghai => SpecId::SHANGHAI,
EvmVersion::Cancun => SpecId::CANCUN,
EvmVersion::Prague => SpecId::PRAGUE_EOF,
EvmVersion::Prague => SpecId::PRAGUE,
}
}

Expand Down
2 changes: 1 addition & 1 deletion crates/script/src/receipts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ pub async fn check_tx_status(
}

loop {
if let Ok(receipt) = PendingTransactionBuilder::new(provider, hash)
if let Ok(receipt) = PendingTransactionBuilder::new(provider.clone(), hash)
.with_timeout(Some(Duration::from_secs(timeout)))
.get_receipt()
.await
Expand Down