@@ -11,10 +11,13 @@ use alloy::{
1111 EthSendBundle ,
1212 } ,
1313} ;
14- use revm:: primitives:: { EVMError , ExecutionResult , SpecId } ;
14+ use revm:: {
15+ primitives:: { EVMError , ExecutionResult , SpecId } ,
16+ Database , DatabaseCommit ,
17+ } ;
1518
1619/// Possible errors that can occur while driving a bundle.
17- pub enum BundleError < Db : revm :: Database > {
20+ pub enum BundleError < Db : Database > {
1821 /// The block number of the bundle does not match the block number of the revm block configuration.
1922 BlockNumberMismatch ,
2023 /// The timestamp of the bundle is out of range.
@@ -38,7 +41,7 @@ pub enum BundleError<Db: revm::Database> {
3841 } ,
3942}
4043
41- impl < Db : revm :: Database > core:: fmt:: Display for BundleError < Db > {
44+ impl < Db : Database > core:: fmt:: Display for BundleError < Db > {
4245 fn fmt ( & self , f : & mut core:: fmt:: Formatter < ' _ > ) -> core:: fmt:: Result {
4346 match self {
4447 Self :: BlockNumberMismatch => {
@@ -58,25 +61,25 @@ impl<Db: revm::Database> core::fmt::Display for BundleError<Db> {
5861 }
5962}
6063
61- impl < Db : revm :: Database > From < alloy:: eips:: eip2718:: Eip2718Error > for BundleError < Db > {
64+ impl < Db : Database > From < alloy:: eips:: eip2718:: Eip2718Error > for BundleError < Db > {
6265 fn from ( err : alloy:: eips:: eip2718:: Eip2718Error ) -> Self {
6366 Self :: TransactionDecodingError ( err)
6467 }
6568}
6669
67- impl < Db : revm :: Database > From < alloy:: primitives:: SignatureError > for BundleError < Db > {
70+ impl < Db : Database > From < alloy:: primitives:: SignatureError > for BundleError < Db > {
6871 fn from ( err : alloy:: primitives:: SignatureError ) -> Self {
6972 Self :: TransactionSenderRecoveryError ( err)
7073 }
7174}
7275
73- impl < Db : revm :: Database > From < EVMError < Db :: Error > > for BundleError < Db > {
76+ impl < Db : Database > From < EVMError < Db :: Error > > for BundleError < Db > {
7477 fn from ( inner : EVMError < Db :: Error > ) -> Self {
7578 Self :: EVMError { inner }
7679 }
7780}
7881
79- impl < Db : revm :: Database > std:: error:: Error for BundleError < Db > {
82+ impl < Db : Database > std:: error:: Error for BundleError < Db > {
8083 fn source ( & self ) -> Option < & ( dyn std:: error:: Error + ' static ) > {
8184 match self {
8285 Self :: TransactionDecodingError ( err) => Some ( err) ,
@@ -86,7 +89,7 @@ impl<Db: revm::Database> std::error::Error for BundleError<Db> {
8689 }
8790}
8891
89- impl < Db : revm :: Database > core:: fmt:: Debug for BundleError < Db > {
92+ impl < Db : Database > core:: fmt:: Debug for BundleError < Db > {
9093 fn fmt ( & self , f : & mut core:: fmt:: Formatter < ' _ > ) -> core:: fmt:: Result {
9194 match self {
9295 Self :: TimestampOutOfRange => write ! ( f, "TimestampOutOfRange" ) ,
@@ -141,7 +144,7 @@ where
141144
142145impl < B , R > BundleProcessor < B , R > {
143146 /// Decode and validate the transactions in the bundle, performing EIP4844 gas checks.
144- pub fn decode_and_validate_txs < Db : revm :: Database > (
147+ pub fn decode_and_validate_txs < Db : Database + DatabaseCommit > (
145148 txs : & [ Bytes ] ,
146149 ) -> Result < Vec < TxEnvelope > , BundleError < Db > > {
147150 let txs = txs
@@ -175,7 +178,7 @@ impl BundleProcessor<EthCallBundle, EthCallBundleResponse> {
175178 }
176179
177180 /// Process a bundle transaction and accumulate the results into a [EthCallBundleTransactionResult].
178- pub fn process_call_bundle_tx < Db : revm :: Database > (
181+ pub fn process_call_bundle_tx < Db : Database + DatabaseCommit > (
179182 tx : & TxEnvelope ,
180183 pre_sim_coinbase_balance : U256 ,
181184 post_sim_coinbase_balance : U256 ,
@@ -257,9 +260,9 @@ impl BundleProcessor<EthCallBundle, EthCallBundleResponse> {
257260}
258261
259262impl < Ext > BundleDriver < Ext > for BundleProcessor < EthCallBundle , EthCallBundleResponse > {
260- type Error < Db : revm :: Database > = BundleError < Db > ;
263+ type Error < Db : Database + DatabaseCommit > = BundleError < Db > ;
261264
262- fn run_bundle < ' a , Db : revm :: Database + revm:: DatabaseCommit > (
265+ fn run_bundle < ' a , Db : Database + revm:: DatabaseCommit > (
263266 & mut self ,
264267 trevm : crate :: EvmNeedsTx < ' a , Ext , Db > ,
265268 ) -> DriveBundleResult < ' a , Ext , Db , Self > {
@@ -389,7 +392,7 @@ impl<Ext> BundleDriver<Ext> for BundleProcessor<EthCallBundle, EthCallBundleResp
389392 }
390393 }
391394
392- fn post_bundle < Db : revm :: Database + revm:: DatabaseCommit > (
395+ fn post_bundle < Db : Database + revm:: DatabaseCommit > (
393396 & mut self ,
394397 _trevm : & crate :: EvmNeedsTx < ' _ , Ext , Db > ,
395398 ) -> Result < ( ) , Self :: Error < Db > > {
@@ -398,9 +401,9 @@ impl<Ext> BundleDriver<Ext> for BundleProcessor<EthCallBundle, EthCallBundleResp
398401}
399402
400403impl < Ext > BundleDriver < Ext > for BundleProcessor < EthSendBundle , EthBundleHash > {
401- type Error < Db : revm :: Database > = BundleError < Db > ;
404+ type Error < Db : Database + DatabaseCommit > = BundleError < Db > ;
402405
403- fn run_bundle < ' a , Db : revm :: Database + revm:: DatabaseCommit > (
406+ fn run_bundle < ' a , Db : Database + revm:: DatabaseCommit > (
404407 & mut self ,
405408 trevm : crate :: EvmNeedsTx < ' a , Ext , Db > ,
406409 ) -> DriveBundleResult < ' a , Ext , Db , Self > {
@@ -476,7 +479,7 @@ impl<Ext> BundleDriver<Ext> for BundleProcessor<EthSendBundle, EthBundleHash> {
476479 }
477480 }
478481
479- fn post_bundle < Db : revm :: Database + revm:: DatabaseCommit > (
482+ fn post_bundle < Db : Database + revm:: DatabaseCommit > (
480483 & mut self ,
481484 _trevm : & crate :: EvmNeedsTx < ' _ , Ext , Db > ,
482485 ) -> Result < ( ) , Self :: Error < Db > > {
@@ -541,9 +544,9 @@ impl From<EthCallBundle> for BundleBlockFiller {
541544}
542545
543546impl < Ext > BundleDriver < Ext > for EthCallBundle {
544- type Error < Db : revm :: Database > = BundleError < Db > ;
547+ type Error < Db : Database + DatabaseCommit > = BundleError < Db > ;
545548
546- fn run_bundle < ' a , Db : revm :: Database + revm:: DatabaseCommit > (
549+ fn run_bundle < ' a , Db : Database + revm:: DatabaseCommit > (
547550 & mut self ,
548551 trevm : crate :: EvmNeedsTx < ' a , Ext , Db > ,
549552 ) -> DriveBundleResult < ' a , Ext , Db , Self > {
@@ -619,7 +622,7 @@ impl<Ext> BundleDriver<Ext> for EthCallBundle {
619622 }
620623 }
621624
622- fn post_bundle < Db : revm :: Database + revm:: DatabaseCommit > (
625+ fn post_bundle < Db : Database + revm:: DatabaseCommit > (
623626 & mut self ,
624627 _trevm : & crate :: EvmNeedsTx < ' _ , Ext , Db > ,
625628 ) -> Result < ( ) , Self :: Error < Db > > {
@@ -631,9 +634,9 @@ impl<Ext> BundleDriver<Ext> for EthCallBundle {
631634/// This allows us to drive a bundle of transactions and accumulate the resulting state in the EVM.
632635/// Allows to simply take an [EthSendBundle] and get the resulting EVM state.
633636impl < Ext > BundleDriver < Ext > for EthSendBundle {
634- type Error < Db : revm :: Database > = BundleError < Db > ;
637+ type Error < Db : Database + DatabaseCommit > = BundleError < Db > ;
635638
636- fn run_bundle < ' a , Db : revm :: Database + revm:: DatabaseCommit > (
639+ fn run_bundle < ' a , Db : Database + revm:: DatabaseCommit > (
637640 & mut self ,
638641 trevm : crate :: EvmNeedsTx < ' a , Ext , Db > ,
639642 ) -> DriveBundleResult < ' a , Ext , Db , Self > {
@@ -724,7 +727,7 @@ impl<Ext> BundleDriver<Ext> for EthSendBundle {
724727 Ok ( t)
725728 }
726729
727- fn post_bundle < Db : revm :: Database + revm:: DatabaseCommit > (
730+ fn post_bundle < Db : Database + revm:: DatabaseCommit > (
728731 & mut self ,
729732 _trevm : & crate :: EvmNeedsTx < ' _ , Ext , Db > ,
730733 ) -> Result < ( ) , Self :: Error < Db > > {
0 commit comments