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

fix(reth-evm-ethereum): no_std test compilation errors #10602

Closed
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
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ reth-ethereum-forks = { path = "crates/ethereum-forks" }
reth-ethereum-payload-builder = { path = "crates/ethereum/payload" }
reth-etl = { path = "crates/etl" }
reth-evm = { path = "crates/evm" }
reth-evm-ethereum = { path = "crates/ethereum/evm" }
reth-evm-ethereum = { path = "crates/ethereum/evm", default-features = false }
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

given that, we don't enable the std feature anywhere in the project. @mattsse we should propagate this change to all crates that use reth-evm-ethereum as a dependency, so they enable the std feature of it, right?

Copy link
Contributor Author

@martinezjorge martinezjorge Aug 29, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The following dependencies in reth-evm-ethereum have c-kzg as default features:

  1. reth-primitives
  2. reth-revm

As far as I can tell, it seems that these are the main culprits; although, the rabbit hole may go deeper. Going off of #9430, would the move be to go from c-kzg -> kzg-rs in the reth-primitives and reth-revm?

reth-evm-optimism = { path = "crates/optimism/evm" }
reth-execution-errors = { path = "crates/evm/execution-errors" }
reth-execution-types = { path = "crates/evm/execution-types" }
Expand Down
2 changes: 1 addition & 1 deletion crates/ethereum/evm/src/eip6110.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ use reth_primitives::{Receipt, Request};
use revm_primitives::Log;

#[cfg(not(feature = "std"))]
use alloc::{string::ToString, vec::Vec};
use alloc::{string::ToString, vec, vec::Vec};

sol! {
#[allow(missing_docs)]
Expand Down
5 changes: 3 additions & 2 deletions crates/ethereum/evm/src/execute.rs
Original file line number Diff line number Diff line change
Expand Up @@ -465,6 +465,8 @@ where
#[cfg(test)]
mod tests {
use super::*;
#[cfg(not(feature = "std"))]
use alloc::{boxed::Box, string::ToString, vec};
use alloy_eips::{
eip2935::{HISTORY_STORAGE_ADDRESS, HISTORY_STORAGE_CODE},
eip4788::{BEACON_ROOTS_ADDRESS, BEACON_ROOTS_CODE, SYSTEM_ADDRESS},
Expand All @@ -479,9 +481,8 @@ mod tests {
database::StateProviderDatabase, test_utils::StateProviderTest, TransitionState,
};
use reth_testing_utils::generators::{self, sign_tx_with_key_pair};
use revm_primitives::{b256, fixed_bytes, Bytes, BLOCKHASH_SERVE_WINDOW};
use revm_primitives::{b256, fixed_bytes, Bytes, HashMap, BLOCKHASH_SERVE_WINDOW};
use secp256k1::{Keypair, Secp256k1};
use std::collections::HashMap;

fn create_state_provider_with_beacon_root_contract() -> StateProviderTest {
let mut db = StateProviderTest::default();
Expand Down
5 changes: 2 additions & 3 deletions crates/ethereum/evm/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ use reth_primitives::{transaction::FillTxEnv, Address, Header, TransactionSigned
use revm_primitives::{AnalysisKind, Bytes, CfgEnvWithHandlerCfg, Env, TxEnv, TxKind};

#[cfg(not(feature = "std"))]
use alloc::vec::Vec;
use alloc::{boxed::Box, vec::Vec};

mod config;
pub use config::{revm_spec, revm_spec_by_timestamp_after_merge};
Expand Down Expand Up @@ -126,8 +126,7 @@ mod tests {
inspectors::NoOpInspector,
JournaledState,
};
use revm_primitives::{CfgEnvWithHandlerCfg, EnvWithHandlerCfg, HandlerCfg};
use std::collections::HashSet;
use revm_primitives::{CfgEnvWithHandlerCfg, EnvWithHandlerCfg, HandlerCfg, HashSet};

#[test]
fn test_fill_cfg_and_block_env() {
Expand Down
Loading