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 10 commits into
base: main
Choose a base branch
from
4,017 changes: 1,927 additions & 2,090 deletions Cargo.lock

Large diffs are not rendered by default.

121 changes: 70 additions & 51 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -109,69 +109,88 @@ 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.11.1", features = [
"std",
"rpc-client-ws",
"network",
"signers",
"signer-local",
"providers",
"rpc-types",
] }
alloy-consensus = { version = "0.11.1", default-features = false }
alloy-eips = { version = "0.11.1", default-features = false }
alloy-genesis = { version = "0.11.1", default-features = false }
alloy-network = { version = "0.11.1", default-features = false }
alloy-primitives = { version = "0.8.20", default-features = false, features = [
"map-foldhash",
] }
alloy-rlp = { version = "0.3.10", default-features = false }
alloy-rlp-derive = "0.3.10"
alloy-rpc-types = { version = "0.11.1", features = [
"eth",
], default-features = false }
alloy-rpc-types-eth = { version = "0.9.2", default-features = false, features = [
alloy-rpc-types-eth = { version = "0.11.1", default-features = false, features = [
"serde",
] }
alloy-serde = { version = "0.11.1", default-features = false }
alloy-sol-types = "0.8.20"
# reth has its version 0.7, but cargo decides to use the wrong patch version here
# so specifying the exact one here.
alloy-trie = { version = "0.7.9", 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 = "19.5.0", features = ["std"], default-features = false }
revm-primitives = { version = "15.2.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.2.0" }
reth-basic-payload-builder = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.2.0" }
reth-chain-state = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.2.0" }
reth-chainspec = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.2.0" }
reth-cli = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.2.0" }
reth-cli-commands = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.2.0" }
reth-cli-util = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.2.0" }
reth-db = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.2.0" }
reth-engine-local = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.2.0" }
reth-engine-primitives = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.2.0" }
reth-errors = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.2.0" }
reth-ethereum-forks = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.2.0" }
reth-ethereum-payload-builder = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.2.0" }
reth-ethereum-primitives = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.2.0" }
reth-evm = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.2.0" }
reth-evm-ethereum = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.2.0" }
reth-exex = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.2.0" }
reth-ipc = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.2.0" }
reth-network-api = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.2.0" }
reth-node-api = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.2.0" }
reth-node-builder = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.2.0" }
reth-node-ethereum = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.2.0" }
reth-payload-builder = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.2.0" }
reth-payload-validator = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.2.0" }
reth-primitives = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.2.0", 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.2.0", default-features = false }
reth-provider = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.2.0" }
reth-revm = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.2.0" }
reth-rpc = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.2.0" }
reth-rpc-api = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.2.0" }
reth-rpc-eth-api = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.2.0" }
reth-rpc-eth-types = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.2.0", default-features = false }
reth-rpc-layer = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.2.0" }
reth-rpc-server-types = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.2.0" }
reth-rpc-types-compat = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.2.0" }
reth-tasks = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.2.0" }
reth-transaction-pool = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.2.0" }
reth-trie = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.2.0" }
reth-trie-common = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.2.0", default-features = false }
reth-trie-db = { git = "https://github.com/paradigmxyz/reth.git", rev = "v1.2.0" }

anyhow = "1.0.86"
arbitrary = { version = "1.3.2", features = ["derive"] }
Expand Down
10 changes: 1 addition & 9 deletions bin/strata-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
2 changes: 1 addition & 1 deletion bin/strata-cli/src/cmd/drain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
.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;

Check warning on line 108 in bin/strata-cli/src/cmd/drain.rs

View check run for this annotation

Codecov / codecov/patch

bin/strata-cli/src/cmd/drain.rs#L108

Added line #L108 was not covered by tests

let total_fee = gas_estimate * gas_price;
let max_send_amount = balance.saturating_sub(U256::from(total_fee));
Expand Down
6 changes: 1 addition & 5 deletions bin/strata-cli/src/strata.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 StrataWallet(Provider);
Expand All @@ -52,7 +49,6 @@ impl StrataWallet {
let wallet = seed.get_strata_wallet();

let provider = ProviderBuilder::new()
.with_recommended_fillers()
.wallet(wallet)
.on_http(l2_http_endpoint.parse().map_err(|_| L2EndpointParseError)?);
Ok(Self(provider))
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,13 +1,16 @@
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 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 @@

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,

Check warning on line 111 in crates/evmexec/src/http_client.rs

View check run for this annotation

Codecov / codecov/patch

crates/evmexec/src/http_client.rs#L108-L111

Added lines #L108 - L111 were not covered by tests
>>::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()))

Check warning on line 115 in crates/evmexec/src/http_client.rs

View check run for this annotation

Codecov / codecov/patch

crates/evmexec/src/http_client.rs#L115

Added line #L115 was not covered by tests
}
}
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
7 changes: 3 additions & 4 deletions crates/proof-impl/evm-ee-stf/src/primitives.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ use std::collections::HashMap;

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

/// A list of transactions to process.
#[serde_as(as = "Vec<serde_bincode_compat_tx::TransactionSigned>")]
// #[serde_as(as = "Vec<serde_bincode_compat::TransactionSigned>")]
// https://github.com/paradigmxyz/reth/issues/15751
pub transactions: Vec<TransactionSigned>,

/// A list of withdrawals to process.
Expand Down
15 changes: 9 additions & 6 deletions crates/proof-impl/evm-ee-stf/src/processor.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@
// limitations under the License.
use std::{mem, mem::take};

use alloy_consensus::constants::{GWEI_TO_WEI, MAXIMUM_EXTRA_DATA_SIZE};
use alloy_consensus::{
constants::{GWEI_TO_WEI, MAXIMUM_EXTRA_DATA_SIZE},
TxReceipt,
};
use alloy_eips::{eip1559::BaseFeeParams, eip2718::Encodable2718};
use alloy_primitives::map::DefaultHashBuilder;
use alloy_rlp::BufMut;
Expand Down Expand Up @@ -206,12 +209,12 @@ where

// Validate tx gas.
let block_available_gas = U256::from(self.input.gas_limit) - cumulative_gas_used;
if block_available_gas < U256::from(tx.transaction.gas_limit()) {
if block_available_gas < U256::from(tx.gas_limit()) {
panic!("Error at transaction {}: gas exceeds block limit", tx_no);
}

// Setup EVM from tx.
fill_eth_tx_env(&mut evm.context.env_mut().tx, &tx.transaction, tx_from);
fill_eth_tx_env(&mut evm.context.env_mut().tx, tx.transaction(), tx_from);
// Execute transaction.
let res = evm
.transact()
Expand All @@ -227,15 +230,15 @@ where

// Create receipt.
let receipt = Receipt {
tx_type: tx.transaction.tx_type(),
tx_type: tx.tx_type(),
success: res.result.is_success(),
cumulative_gas_used: cumulative_gas_used.try_into().unwrap(),
logs: res.result.logs().to_vec(),
};

executed_txs.push(tx.clone());
// Update logs bloom.
logs_bloom.accrue_bloom(&receipt.bloom_slow());
logs_bloom.accrue_bloom(&receipt.bloom());
receipts.push(receipt);

// Commit state changes.
Expand All @@ -259,7 +262,7 @@ where
.into_iter()
.collect::<Vec<TransactionSigned>>();
h.transactions_root = ordered_trie_root_with_encoder(&txs_signed, |tx, buf| {
tx.eip2718_encode(&tx.signature, buf);
tx.encode_2718(buf);
});
h.receipts_root = ordered_trie_root_with_encoder(&receipts, |receipt, buf| {
receipt.with_bloom_ref().encode_2718(buf);
Expand Down
10 changes: 5 additions & 5 deletions crates/proof-impl/evm-ee-stf/test_data/witness_params.json
Original file line number Diff line number Diff line change
Expand Up @@ -212,14 +212,14 @@
},
"transaction": {
"Eip1559": {
"chain_id": 12345,
"chainId": 12345,
"nonce": 0,
"gas_limit": 21694,
"max_fee_per_gas": 1041616314,
"max_priority_fee_per_gas": 1000000000,
"gas": 21694,
"maxFeePerGas": 1041616314,
"maxPriorityFeePerGas": 1000000000,
"to": "0x5400000000000000000000000000000000000001",
"value": "0x8ac7230489e80000",
"access_list": [],
"accessList": [],
"input": "0x04be27fa8b1f5278faf82cab8da23e8761f8f9bd5d5ebebbb37e0e12a70d92dd16"
}
}
Expand Down
10 changes: 5 additions & 5 deletions crates/reth/db/test_data/witness_params.json
Original file line number Diff line number Diff line change
Expand Up @@ -212,14 +212,14 @@
},
"transaction": {
"Eip1559": {
"chain_id": 12345,
"chainId": 12345,
"nonce": 0,
"gas_limit": 21694,
"max_fee_per_gas": 1041616314,
"max_priority_fee_per_gas": 1000000000,
"gas": 21694,
"maxFeePerGas": 1041616314,
"maxPriorityFeePerGas": 1000000000,
"to": "0x5400000000000000000000000000000000000001",
"value": "0x8ac7230489e80000",
"access_list": [],
"accessList": [],
"input": "0x04be27fa8b1f5278faf82cab8da23e8761f8f9bd5d5ebebbb37e0e12a70d92dd16"
}
}
Expand Down
1 change: 1 addition & 0 deletions crates/reth/exex/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ reth-evm.workspace = true
reth-exex.workspace = true
reth-node-api.workspace = true
reth-primitives.workspace = true
reth-primitives-traits.workspace = true
reth-provider.workspace = true
reth-revm.workspace = true
reth-rpc-types-compat.workspace = true
Expand Down
Loading
Loading