-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
feat: abstract over Evm::Error
#14085
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is great, this should open up a few more things once we've migrated to new revm
smol nits
EthExecutionStrategy<DB, EvmConfig>; | ||
type Strategy<DB: Database> = EthExecutionStrategy<DB, EvmConfig>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
so much butter indeed
+ SpawnBlocking, | ||
Self: LoadState< | ||
Evm: ConfigureEvm<Header = ProviderHeader<Self::Provider>, TxEnv = TxEnv>, | ||
Error: FromEvmError<Self::Evm>, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is great
Co-authored-by: Matthias Seitz <matthias.seitz@outlook.de>
Changes in this PR:
Evm::Error
is no longer bounded to a concrete type (wasEVMError<DB::Error>
before). Instead,EvmError
trait is introduced:reth/crates/evm/src/lib.rs
Lines 98 to 113 in b1dfab9
core::error::Error
bound onDatabase::Error
, so I've introduced a helperDatabase
trait which is now used everywhere:reth/crates/evm/src/lib.rs
Lines 129 to 131 in b1dfab9
This is not great and won't get solved with new revm because it doesn't have
Send + Sync + 'static
bounds. What we could do is just boundError = ProviderError
everywhere but this would also be a bit redundant.EthApi::Error
is now required to implementFrom<EthApi::Evm::EvmError<ProviderError>>
which basically means that it should be able to convert any Evm error as long as underlying database hasProviderError
error type which always holds for RPC.reth/crates/rpc/rpc-eth-types/src/error/api.rs
Lines 82 to 89 in 3b6d97e