Describe the feature you would like
Right now the EvmFactory trait in the alloy-evm crate has an associated type called Evm that has a generic DB: alloy_evm::Database.
|
type Evm<DB: Database, I: Inspector<Self::Context<DB>>>: Evm< |
This makes it impossible in the concrete implementation to use a trait that is stricter than the alloy_evm::Database trait because of how Rust compiler works with generic defined on associated types (instead of the generic being defined in the trait itself - something like pub trait EvmFactory<DB: Database>.
Do you think it could make sense to change the trait such that it lets implementers use a stricter (meaning it's at least Database, but it may have additional requirements such as thread safety Send + Sync or clonable Clone) trait on the DB.
I'm down to help here if you give me some guidance and find the proposal appealing.
Additional context
No response
Describe the feature you would like
Right now the
EvmFactorytrait in thealloy-evmcrate has an associated type calledEvmthat has a genericDB: alloy_evm::Database.evm/crates/evm/src/evm.rs
Line 197 in 224bf74
This makes it impossible in the concrete implementation to use a trait that is stricter than the
alloy_evm::Databasetrait because of how Rust compiler works with generic defined on associated types (instead of the generic being defined in the trait itself - something likepub trait EvmFactory<DB: Database>.Do you think it could make sense to change the trait such that it lets implementers use a stricter (meaning it's at least
Database, but it may have additional requirements such as thread safetySend + Syncor clonableClone) trait on the DB.I'm down to help here if you give me some guidance and find the proposal appealing.
Additional context
No response