Skip to content

Str-1184: bump reth to 1.2.0 #773

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

Draft
wants to merge 12 commits into
base: main
Choose a base branch
from
Draft
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
5,269 changes: 2,677 additions & 2,592 deletions Cargo.lock

Large diffs are not rendered by default.

119 changes: 68 additions & 51 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -109,69 +109,86 @@ zkaleido-sp1-groth16-verifier = { git = "https://github.com/alpenlabs/zkaleido",

# IMPORTANT: ensure alloy-* and revm packages are of the same version as inside reth dependency
# reth dependencies:
alloy-consensus = { version = "0.9.2", default-features = false }
alloy-eips = { version = "0.9.2", default-features = false }
alloy-genesis = { version = "0.9.2", default-features = false }
alloy-network = { version = "0.9.2", default-features = false }
alloy-primitives = { version = "0.8.19", default-features = false }
alloy-rlp = { version = "0.3.11", default-features = false }
alloy-rlp-derive = "0.3.11"
alloy-rpc-types = { version = "0.9.2", features = [
alloy = { version = "0.14.0", features = [
"std",
"rpc-client-ws",
"network",
"signers",
"signer-local",
"providers",
"rpc-types",
] }
alloy-consensus = { version = "0.14.0", default-features = false }
alloy-eips = { version = "0.14.0", default-features = false }
alloy-genesis = { version = "0.14.0", default-features = false }
alloy-network = { version = "0.14.0", default-features = false }
alloy-primitives = { version = "1.0.0", default-features = false, features = [
"map-foldhash",
] }
alloy-rlp = { version = "0.3.10", default-features = false, features = ["core-net"] }
alloy-rlp-derive = "0.3.10"
alloy-rpc-types = { version = "0.14.0", features = [
"eth",
], default-features = false }
alloy-rpc-types-eth = { version = "0.9.2", default-features = false, features = [
alloy-rpc-types-eth = { version = "0.14.0", default-features = false, features = [
"serde",
] }
alloy-serde = { version = "0.14.0", default-features = false }
alloy-sol-types = "1.0.0"
alloy-trie = { version = "0.8.1", default-features = false, features = [
"arbitrary",
"serde",
] }
alloy-serde = { version = "0.9.2", default-features = false }
alloy-sol-types = "0.8.19"
alloy-trie = { version = "0.7", default-features = false }
revm = { version = "19.2.0", features = ["std"], default-features = false }
revm-primitives = { version = "15.1.0", features = [
revm = { version = "22.0.1", features = ["std"], default-features = false }
revm-primitives = { version = "18.0.0", features = [
"std",
"serde",
], default-features = false }

# reth itself:
reth = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.1.5" }
reth-basic-payload-builder = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.1.5" }
reth-chain-state = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.1.5" }
reth-chainspec = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.1.5" }
reth-cli = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.1.5" }
reth-cli-commands = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.1.5" }
reth-cli-util = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.1.5" }
reth-db = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.1.5" }
reth-errors = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.1.5" }
reth-ethereum-forks = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.1.5" }
reth-ethereum-payload-builder = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.1.5" }
reth-evm = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.1.5" }
reth-evm-ethereum = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.1.5" }
reth-exex = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.1.5" }
reth-ipc = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.1.5" }
reth-network-api = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.1.5" }
reth-node-api = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.1.5" }
reth-node-builder = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.1.5" }
reth-node-ethereum = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.1.5" }
reth-payload-builder = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.1.5" }
reth-payload-validator = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.1.5" }
reth-primitives = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.1.5", default-features = false, features = [
reth = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.3.10" }
reth-basic-payload-builder = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.3.10" }
reth-chain-state = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.3.10" }
reth-chainspec = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.3.10" }
reth-cli = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.3.10" }
reth-cli-commands = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.3.10" }
reth-cli-util = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.3.10" }
reth-db = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.3.10" }
reth-engine-local = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.3.10" }
reth-engine-primitives = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.3.10" }
reth-errors = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.3.10" }
reth-ethereum-forks = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.3.10" }
reth-ethereum-payload-builder = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.3.10" }
reth-ethereum-primitives = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.3.10" }
reth-evm = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.3.10" }
reth-evm-ethereum = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.3.10" }
reth-exex = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.3.10" }
reth-ipc = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.3.10" }
reth-network-api = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.3.10" }
reth-node-api = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.3.10" }
reth-node-builder = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.3.10" }
reth-node-ethereum = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.3.10" }
reth-payload-builder = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.3.10" }
reth-payload-validator = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.3.10" }
reth-primitives = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.3.10", default-features = false, features = [
"std",
"serde-bincode-compat",
] }
reth-primitives-traits = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.1.5", default-features = false }
reth-provider = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.1.5" }
reth-revm = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.1.5" }
reth-rpc = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.1.5" }
reth-rpc-api = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.1.5" }
reth-rpc-eth-api = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.1.5" }
reth-rpc-eth-types = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.1.5", default-features = false }
reth-rpc-layer = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.1.5" }
reth-rpc-server-types = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.1.5" }
reth-rpc-types-compat = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.1.5" }
reth-tasks = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.1.5" }
reth-transaction-pool = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.1.5" }
reth-trie = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.1.5" }
reth-trie-common = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.1.5" }
reth-trie-db = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.1.5" }
reth-primitives-traits = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.3.10", default-features = false }
reth-provider = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.3.10" }
reth-revm = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.3.10" }
reth-rpc = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.3.10" }
reth-rpc-api = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.3.10" }
reth-rpc-eth-api = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.3.10" }
reth-rpc-eth-types = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.3.10", default-features = false }
reth-rpc-layer = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.3.10" }
reth-rpc-server-types = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.3.10" }
reth-rpc-types-compat = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.3.10" }
reth-tasks = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.3.10" }
reth-transaction-pool = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.3.10" }
reth-trie = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.3.10" }
reth-trie-common = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.3.10", default-features = false }
reth-trie-db = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.3.10" }

anyhow = "1.0.86"
arbitrary = { version = "1.3.2", features = ["derive"] }
Expand Down
10 changes: 1 addition & 9 deletions bin/alpen-cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,7 @@ path = "src/main.rs"
strata-primitives.workspace = true

aes-gcm-siv = "0.11.1"
alloy = { version = "0.3.5", features = [
"std",
"rpc-client-ws",
"network",
"signers",
"signer-local",
"providers",
"rpc-types",
] }
alloy.workspace = true
argh.workspace = true
argon2 = "0.5.3"
async-trait.workspace = true
Expand Down
6 changes: 1 addition & 5 deletions bin/alpen-cli/src/alpen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ use alloy::{
},
Identity, ProviderBuilder, RootProvider,
},
transports::http::{Client, Http},
};

use crate::seed::Seed;
Expand All @@ -23,9 +22,7 @@ type Provider = FillProvider<
>,
WalletFiller<EthereumWallet>,
>,
RootProvider<Http<Client>>,
Http<Client>,
Ethereum,
RootProvider<Ethereum>,
>;

pub struct AlpenWallet(Provider);
Expand All @@ -52,7 +49,6 @@ impl AlpenWallet {
let wallet = seed.get_alpen_wallet();

let provider = ProviderBuilder::new()
.with_recommended_fillers()
.wallet(wallet)
.on_http(l2_http_endpoint.parse().map_err(|_| L2EndpointParseError)?);
Ok(Self(provider))
Expand Down
2 changes: 1 addition & 1 deletion bin/alpen-cli/src/cmd/drain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ pub async fn drain(
.value(U256::from(1));

let gas_price = l2w.get_gas_price().await.unwrap();
let gas_estimate = l2w.estimate_gas(&estimate_tx).await.unwrap();
let gas_estimate = l2w.estimate_gas(estimate_tx).await.unwrap() as u128;

let total_fee = gas_estimate * gas_price;
let max_send_amount = balance.saturating_sub(U256::from(total_fee));
Expand Down
24 changes: 12 additions & 12 deletions crates/evmexec/src/http_client.rs
Original file line number Diff line number Diff line change
@@ -1,16 +1,19 @@
use std::sync::Arc;

use alloy_rpc_types::engine::{
ExecutionPayloadBodiesV1, ExecutionPayloadInputV2, ForkchoiceState, ForkchoiceUpdated,
JwtSecret, PayloadId,
use alloy_rpc_types::{
engine::{
ExecutionPayloadBodiesV1, ExecutionPayloadInputV2, ForkchoiceState, ForkchoiceUpdated,
JwtSecret, PayloadId,
},
eth::{Block as RpcBlock, Header, Transaction},
};
use alpen_reth_node::{
StrataEngineTypes, StrataExecutionPayloadEnvelopeV2, StrataPayloadAttributes,
};
use jsonrpsee::http_client::{transport::HttpBackend, HttpClient, HttpClientBuilder};
#[cfg(test)]
use mockall::automock;
use reth_primitives::{Block, SealedBlock, TransactionSigned};
use reth_primitives::{Block, Receipt};
use reth_rpc_api::{EngineApiClient, EthApiClient};
use reth_rpc_layer::{AuthClientLayer, AuthClientService};
use revm_primitives::alloy_primitives::BlockHash;
Expand Down Expand Up @@ -102,16 +105,13 @@ impl EngineRpc for EngineRpcClient {

async fn block_by_hash(&self, block_hash: BlockHash) -> RpcResult<Option<Block>> {
let block = <HttpClient<AuthClientService<HttpBackend>> as EthApiClient<
alloy_network::AnyRpcTransaction,
alloy_network::AnyRpcBlock,
alloy_network::AnyTransactionReceipt,
alloy_network::AnyRpcBlock,
Transaction,
RpcBlock<reth_primitives::TransactionSigned>,
Receipt,
Header,
>>::block_by_hash(&self.client, block_hash, true)
.await?;

Ok(block.map(|b| {
let sealed_block: SealedBlock = b.try_into().unwrap();
Block::<TransactionSigned>::from(sealed_block)
}))
Ok(block.map(|b| b.into_consensus()))
}
}
3 changes: 3 additions & 0 deletions crates/proof-impl/evm-ee-stf/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ k256 = { version = "0.13.4", features = [
"std",
"ecdsa",
], default-features = false }
reth-ethereum-primitives = { workspace = true, features = [
"serde-bincode-compat",
] }
reth-primitives = { workspace = true, features = ["serde-bincode-compat"] }
reth-primitives-traits.workspace = true
revm.workspace = true
Expand Down
20 changes: 12 additions & 8 deletions crates/proof-impl/evm-ee-stf/src/db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ use std::collections::hash_map::Entry;
use alloy_primitives::map::{DefaultHashBuilder, HashMap};
use anyhow::{anyhow, Result};
use revm::{
db::{AccountState, DbAccount, InMemoryDB},
primitives::{AccountInfo, Bytecode},
bytecode::Bytecode,
database::{AccountState, Cache, DbAccount, InMemoryDB},
state::AccountInfo,
};
use revm_primitives::alloy_primitives::{Address, Bytes, B256, U256};

Expand Down Expand Up @@ -142,21 +143,24 @@ impl InMemoryDBHelper for InMemoryDB {

// Return the DB.
Ok(InMemoryDB {
accounts,
block_hashes,
cache: Cache {
accounts,
block_hashes,
..Default::default()
},
..Default::default()
})
}

fn get_account_info(&self, address: Address) -> Result<Option<AccountInfo>> {
match self.accounts.get(&address) {
match self.cache.accounts.get(&address) {
Some(db_account) => Ok(db_account.info()),
None => Err(anyhow!("Account not found.")),
}
}

fn get_storage_slot(&self, address: Address, index: U256) -> Result<U256> {
match self.accounts.get(&address) {
match self.cache.accounts.get(&address) {
Some(account) => match account.storage.get(&index) {
Some(value) => Ok(*value),
None => match account.account_state {
Expand All @@ -171,14 +175,14 @@ impl InMemoryDBHelper for InMemoryDB {

fn storage_keys(&self) -> HashMap<Address, Vec<U256>> {
let mut out = HashMap::with_hasher(alloy_primitives::map::DefaultHashBuilder::default());
for (address, account) in &self.accounts {
for (address, account) in &self.cache.accounts {
out.insert(*address, account.storage.keys().cloned().collect());
}
out
}

fn insert_block_hash(&mut self, block_number: U256, block_hash: B256) {
match self.block_hashes.entry(block_number) {
match self.cache.block_hashes.entry(block_number) {
Entry::Occupied(entry) => assert_eq!(&block_hash, entry.get()),
Entry::Vacant(entry) => {
entry.insert(block_hash);
Expand Down
4 changes: 2 additions & 2 deletions crates/proof-impl/evm-ee-stf/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ use db::InMemoryDBHelper;
use mpt::keccak;
pub use primitives::{EvmBlockStfInput, EvmBlockStfOutput};
use processor::{EvmConfig, EvmProcessor};
use revm::{primitives::SpecId, InMemoryDB};
use revm::{database::InMemoryDB, primitives::hardfork::SpecId};
use revm_primitives::alloy_primitives::B256;
use utils::generate_exec_update;
use zkaleido::ZkVmEnv;
Expand Down Expand Up @@ -112,7 +112,7 @@ pub fn process_block_transaction_outer(zkvm: &impl ZkVmEnv) {

#[cfg(test)]
mod tests {
use revm::primitives::SpecId;
use revm::primitives::hardfork::SpecId;
use serde::{Deserialize, Serialize};

use super::*;
Expand Down
13 changes: 7 additions & 6 deletions crates/proof-impl/evm-ee-stf/src/primitives.rs
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
use std::collections::HashMap;

use alloy_consensus::{serde_bincode_compat as serde_bincode_compat_header, Header};
use alloy_consensus::{
serde_bincode_compat::{self as serde_bincode_compat_header},
transaction::serde_bincode_compat as serde_bincode_compat_tx,
EthereumTxEnvelope, Header, TxEip4844,
};
use alloy_eips::eip4895::Withdrawal;
use alpen_reth_primitives::WithdrawalIntent;
use reth_primitives::{
transaction::serde_bincode_compat as serde_bincode_compat_tx, TransactionSigned,
};
use revm_primitives::alloy_primitives::{Address, Bytes, FixedBytes, B256};
use serde::{Deserialize, Serialize};
use serde_with::serde_as;
Expand Down Expand Up @@ -75,8 +76,8 @@ pub struct EvmBlockStfInput {
pub ancestor_headers: Vec<Header>,

/// A list of transactions to process.
#[serde_as(as = "Vec<serde_bincode_compat_tx::TransactionSigned>")]
pub transactions: Vec<TransactionSigned>,
#[serde_as(as = "Vec<serde_bincode_compat_tx::EthereumTxEnvelope<'_>>")]
pub transactions: Vec<EthereumTxEnvelope<TxEip4844>>,

/// A list of withdrawals to process.
pub withdrawals: Vec<Withdrawal>,
Expand Down
Loading