Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bump reth to v1.0.8 #769

Merged
merged 2 commits into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all 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
1,122 changes: 618 additions & 504 deletions Cargo.lock

Large diffs are not rendered by default.

11 changes: 7 additions & 4 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,18 @@ incremental = true
[workspace.dependencies]
# Eth deps
alloy-rlp = { version = "0.3.8", default-features = false }
ef-tests = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.0.7", default-features = false, features = [
ef-tests = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.0.8", default-features = false, features = [
"ef-tests",
] }
alloy-signer-local = { version = "0.3.6", default-features = false }
reth-primitives = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.0.7", default-features = true, features = [
alloy-signer-local = { version = "0.4.2", default-features = false }
alloy-primitives = { version = "0.8.4", default-features = false }
alloy-eips = { version = "0.4.2", default-features = false }
alloy-consensus = { version = "0.4.2", default-features = false }
reth-primitives = { git = "https://github.com/paradigmxyz/reth.git", tag = "v1.0.8", default-features = true, features = [
"std",
] }
revm-interpreter = { version = "10.0", default-features = false }
revm-primitives = { version = "9.0", default-features = false }
revm-primitives = { version = "10.0", default-features = false }

# Starknet deps
cairo-lang-casm = "2.8.0"
Expand Down
1 change: 1 addition & 0 deletions crates/build-utils/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ license.workspace = true
[dependencies]
# Others
alloy-rlp = { workspace = true }
alloy-primitives = { workspace = true }
eyre = { workspace = true }
lazy_static = { workspace = true }
rayon = { workspace = true }
Expand Down
2 changes: 1 addition & 1 deletion crates/build-utils/src/constants.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
use alloy_primitives::{address, Address};
use lazy_static::lazy_static;
use reth_primitives::alloy_primitives::{address, Address};
use std::collections::HashMap;

pub const ROOT: &str = "GeneralStateTests";
Expand Down
3 changes: 2 additions & 1 deletion crates/build-utils/src/content_reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,10 @@ use crate::{
constants::ADDRESSES_KEYS, path::PathWrapper,
utils::blockchain_tests_to_general_state_tests_path,
};
use alloy_primitives::{address, hex, Address};
use alloy_rlp::Decodable;
use eyre::eyre;
use reth_primitives::{address, hex, Address, Block};
use reth_primitives::Block;
use serde_json::Value;
use std::collections::BTreeMap;

Expand Down
2 changes: 1 addition & 1 deletion crates/build-utils/src/converter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ impl<'a> EfTests<'a> {
use ef_testing::test_utils::setup;
use ef_testing::traits::Case;
use ef_tests::models::{Block, Account, State};
use reth_primitives::{Address, B256};
use alloy_primitives::{Address, B256};
use std::collections::BTreeMap;
"
.to_string()
Expand Down
3 changes: 3 additions & 0 deletions crates/ef-testing/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ bytes = { workspace = true }
# Eth deps
alloy-rlp = { workspace = true }
alloy-signer-local = { workspace = true }
alloy-primitives = { workspace = true }
alloy-eips = { workspace = true }
alloy-consensus = { workspace = true }
ef-tests = { workspace = true }
reth-primitives = { workspace = true }
revm-interpreter = { workspace = true }
Expand Down
6 changes: 3 additions & 3 deletions crates/ef-testing/src/evm_sequencer/account/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ use crate::evm_sequencer::constants::storage_variables::{
};
use crate::evm_sequencer::utils::split_u256;
use crate::starknet_storage;
use alloy_primitives::keccak256;
use alloy_primitives::{Address, U256};
use blockifier::abi::{abi_utils::get_storage_var_address, sierra_types::next_storage_key};
use ef_tests::models::Account;
use reth_primitives::alloy_primitives::keccak256;
use reth_primitives::KECCAK_EMPTY;
use reth_primitives::{Address, U256};
use revm_interpreter::analysis::to_analysed;
use revm_primitives::Bytecode;
use starknet::core::utils::cairo_short_string_to_felt;
Expand Down Expand Up @@ -187,8 +187,8 @@ mod tests {
use crate::evm_sequencer::constants::storage_variables::ACCOUNT_BYTECODE;

use super::*;
use alloy_primitives::Bytes;
use blockifier::abi::abi_utils::get_storage_var_address;
use reth_primitives::Bytes;

#[test]
fn test_pack_byte_array_to_starkfelt_array() {
Expand Down
4 changes: 2 additions & 2 deletions crates/ef-testing/src/evm_sequencer/constants.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::collections::HashMap;

use alloy_primitives::{address, Address};
use lazy_static::lazy_static;
use reth_primitives::alloy_primitives::{address, Address};
use serde::de::DeserializeOwned;
use starknet::core::types::contract::CompiledClass;
use starknet::signers::VerifyingKey;
Expand Down Expand Up @@ -149,8 +149,8 @@ pub mod storage_variables {
pub mod tests {
use std::str::FromStr;

use alloy_primitives::{Address, B256};
use lazy_static::lazy_static;
use reth_primitives::{Address, B256};

lazy_static! {
pub static ref PRIVATE_KEY: B256 =
Expand Down
16 changes: 10 additions & 6 deletions crates/ef-testing/src/evm_sequencer/evm_state/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@ use crate::{
},
starknet_storage,
};
use alloy_primitives::Address;
use alloy_primitives::Bytes;
use alloy_primitives::U256;
use blockifier::{
abi::{
abi_utils::{get_fee_token_var_address, get_storage_var_address},
Expand All @@ -29,7 +32,7 @@ use blockifier::{
objects::{TransactionExecutionInfo, TransactionExecutionResult},
},
};
use reth_primitives::{Address, Bytes, TransactionSigned, U256};
use reth_primitives::TransactionSigned;
use sequencer::{execution::Execution as _, transaction::BroadcastedTransactionWrapper};
use starknet::core::types::BroadcastedTransaction;
use starknet_api::state::StorageKey;
Expand Down Expand Up @@ -351,10 +354,11 @@ mod tests {
},
models::result::extract_output_and_log_execution_result,
};
use alloy_consensus::TxEip1559;
use alloy_eips::eip2930::AccessList;
use alloy_primitives::B256;
use ef_tests::models::Account;
use reth_primitives::{
sign_message, AccessList, Signature, TransactionSigned, TxEip1559, B256,
};
use reth_primitives::{sign_message, Signature, TransactionSigned};

#[test]
fn test_execute_simple_contract() {
Expand All @@ -377,14 +381,14 @@ mod tests {

let mut transaction = TransactionSigned {
hash: B256::default(),
signature: Signature::default(),
signature: Signature::from_rs_and_parity(U256::ZERO, U256::ZERO, false).unwrap(),
transaction: reth_primitives::Transaction::Eip1559(TxEip1559 {
chain_id: CHAIN_ID,
nonce: 0,
gas_limit: 1_000_000,
max_fee_per_gas: 0,
max_priority_fee_per_gas: 0,
to: reth_primitives::TxKind::Call(*TEST_CONTRACT_ADDRESS),
to: alloy_primitives::TxKind::Call(*TEST_CONTRACT_ADDRESS),
value: U256::ZERO,
access_list: AccessList::default(),
input: Bytes::default(),
Expand Down
2 changes: 1 addition & 1 deletion crates/ef-testing/src/evm_sequencer/sequencer/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ use crate::evm_sequencer::{
types::contract_class::CasmContractClassWrapper,
utils::compute_starknet_address,
};
use alloy_primitives::Address;
use blockifier::blockifier::block::{BlockInfo, GasPrices};
use blockifier::context::ChainInfo;
use blockifier::context::{BlockContext, FeeTokenAddresses};
Expand All @@ -28,7 +29,6 @@ use blockifier::{
};
use cairo_lang_starknet_classes::casm_contract_class::CasmContractClass;
use cairo_vm::types::errors::program_errors::ProgramError;
use reth_primitives::Address;
use sequencer::{sequencer::Sequencer, state::State};
use starknet::core::types::contract::{legacy::LegacyContractClass, CompiledClass};
use starknet_api::{
Expand Down
15 changes: 9 additions & 6 deletions crates/ef-testing/src/evm_sequencer/utils.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
use super::constants::KAKAROT_ADDRESS;
use crate::evm_sequencer::constants::RELAYER_ADDRESS;
use alloy_primitives::{Address, Bytes, U256};
use bytes::BytesMut;
use reth_primitives::{Address, Bytes, TransactionSigned, TxType, U256};
use reth_primitives::{TransactionSigned, TxType};
use starknet::core::{
types::{BroadcastedInvokeTransaction, BroadcastedInvokeTransactionV1, Felt},
utils::get_contract_address,
Expand Down Expand Up @@ -64,12 +65,14 @@ pub fn to_broadcasted_starknet_transaction(
};

let signature = transaction.signature();
let [r_low, r_high] = split_u256(signature.r);
let [s_low, s_high] = split_u256(signature.s);
let [r_low, r_high] = split_u256(signature.r());
let [s_low, s_high] = split_u256(signature.s());
let v = match transaction.transaction.tx_type() {
TxType::Legacy => signature.legacy_parity(transaction.chain_id()).to_u64(),
_ => signature.odd_y_parity as u64,
};
TxType::Legacy => signature.with_chain_id(transaction.chain_id().unwrap_or_default()),
_ => *signature,
}
.v()
.to_u64();

#[allow(unused_mut)]
let mut signature: Vec<Felt> = vec![
Expand Down
5 changes: 3 additions & 2 deletions crates/ef-testing/src/models/case.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ use ef_tests::models::Block;
use ef_tests::models::State;
use std::collections::BTreeMap;

use reth_primitives::{sign_message, Address, SealedBlock, B256, U256};
use alloy_primitives::{Address, B256, U256};
use reth_primitives::{sign_message, SealedBlock};

#[derive(Debug)]
pub struct BlockchainTestCase {
Expand Down Expand Up @@ -76,7 +77,7 @@ impl BlockchainTestCase {
let mut output = EVMOutput::default();

// Iterate over all transactions in the block
for tx in block.body.iter() {
for tx in block.body.transactions.iter() {
// Encode body as transaction
let mut tx_signed = tx.clone();
tx_signed.transaction.set_chain_id(CHAIN_ID);
Expand Down
2 changes: 1 addition & 1 deletion crates/ef-testing/src/models/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ pub mod result;

use std::str::FromStr;

use reth_primitives::{Address, Bytes, B256, U256, U64};
use alloy_primitives::{Address, Bytes, B256, U256, U64};
use serde::{self, de, Deserialize, Deserializer};

#[derive(Debug, PartialEq, Eq, Deserialize)]
Expand Down
2 changes: 1 addition & 1 deletion crates/ef-testing/src/utils/mod.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use std::collections::BTreeMap;

use alloy_primitives::{Address, Bytes, U256};
use ef_tests::models::{Account, State};
use reth_primitives::{Address, Bytes, U256};

pub(crate) fn update_post_state(
mut post_state: BTreeMap<Address, Account>,
Expand Down
Loading