Conversation
mattsse
left a comment
There was a problem hiding this comment.
this is pretty cool,
love that this now doesn't require any interface changes
crates/optimism/evm/src/lib.rs
Outdated
There was a problem hiding this comment.
this is okay because this type is a ZST anyway
ecfc143 to
8cbe3c0
Compare
Cargo.toml
Outdated
| alloy-chains = { version = "0.1.32", default-features = false } | ||
| alloy-dyn-abi = "0.8.15" | ||
| alloy-eip2124 = { version = "0.1.0", default-features = false } | ||
| alloy-evm = { path = "../evm/crates/evm" } |
There was a problem hiding this comment.
shoudl be able to use from git now
| /// Helper trait to bound [`revm::Database::Error`] with common requirements. | ||
| pub trait Database: revm::Database<Error: core::error::Error + Send + Sync + 'static> {} | ||
| impl<T> Database for T where T: revm::Database<Error: core::error::Error + Send + Sync + 'static> {} | ||
| pub use alloy_evm::{Database, Evm, EvmEnv, EvmError, InvalidTxError}; |
There was a problem hiding this comment.
wondering if it's actually more helpful to not re-export all of these so libraries update their deps to point to alloy directly instead
crates/evm/src/lib.rs
Outdated
| &self, | ||
| db: DB, | ||
| header: &Self::Header, | ||
| ) -> <Self::EvmFactory as EvmFactory<EvmEnv<Self::Spec>>>::Evm<'_, DB, ()> { |
There was a problem hiding this comment.
could be helpful to create a type alias as adapter for this and export it from crate root to improve devx with the trait, smthg like
pub type EvmTy<'a, T, DB> = <<T as ConfigureEvm>::EvmFactory<EvmEnv<T::Spec>>>::Evm<'a, DB, ()>;| use alloc::sync::Arc; | ||
| use alloy_consensus::{BlockHeader, Header}; | ||
| use alloy_eips::eip7840::BlobParams; | ||
| use alloy_op_evm::OpEvmFactory; |
There was a problem hiding this comment.
is the plan to move this to op-alloy?
| ExecutionResult::Halt { reason, gas_used } => { | ||
| let error = | ||
| Some(RpcInvalidTransactionError::halt(reason, tx_env.gas_limit()).to_string()); | ||
| Some(Self::Error::from_evm_halt(reason, tx_env.gas_limit()).to_string()); |
There was a problem hiding this comment.
nice application of this pattern, good eye
| ExecutionResult::Revert { .. } | ExecutionResult::Halt { .. } => { | ||
| // We know that transaction succeeded with a higher gas limit before, so any failure | ||
| // means that we need to increase it. |
There was a problem hiding this comment.
do we want to add some trace level logging here right away to differentiate the two in debugging? does the migration to alloy not change so much code the we can still consider the sigp audit of the reth code to apply to the code in alloy?
25eb1b0 to
7e97984
Compare
837ba71 to
43d42e8
Compare
43d42e8 to
270ef66
Compare
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de> Co-authored-by: rakita <rakita@users.noreply.github.com>
alloy-evm integrationalloy-evm and new revm integration
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de> Co-authored-by: rakita <rakita@users.noreply.github.com>
Integrates
Evmtrait moved to alloy-evm. CoreEvmconstruction logic is now implemented viaEvmFactoryandConfigureEvmimplementations are just required to hold one.