@@ -5,11 +5,11 @@ use eyre::Result;
5
5
use std:: sync:: Arc ;
6
6
use tokio:: { select, sync:: mpsc:: UnboundedReceiver , task:: JoinSet } ;
7
7
use trevm:: {
8
- db:: { cow :: CacheOnWrite , sync:: { ConcurrentState , ConcurrentStateInfo } } , helpers:: Ctx , revm:: {
8
+ db:: sync:: { ConcurrentState , ConcurrentStateInfo } , helpers:: Ctx , revm:: {
9
9
context:: {
10
10
result:: { EVMError , ExecutionResult , ResultAndState } , CfgEnv
11
11
} , primitives:: address, state:: Account , Database , DatabaseCommit , DatabaseRef , Inspector
12
- } , BlockDriver , Cfg , DbConnect , EvmFactory , NoopBlock , TrevmBuilder , TrevmBuilderError , Tx
12
+ } , Cfg , DbConnect , EvmFactory , NoopBlock , TrevmBuilder , TrevmBuilderError , Tx
13
13
} ;
14
14
15
15
/// Tracks the EVM state, score, and result of an EVM execution.
@@ -210,74 +210,6 @@ where
210
210
}
211
211
}
212
212
213
- pub trait BlockExtractor < Insp , Db >
214
- where
215
- Db : Database + DatabaseCommit ,
216
- Insp : Inspector < Ctx < Db > > ,
217
- {
218
- /// BlockDriver runs the transactions over the provided trevm instance.
219
- type Driver : BlockDriver < Insp , Error < Db > : core:: error:: Error > ;
220
-
221
- /// Instantiate an configure a new [`trevm`] instance.
222
- fn trevm ( & self , db : Db ) -> trevm:: EvmNeedsBlock < Db , Insp > ;
223
-
224
- /// Extracts transactions from the source.
225
- ///
226
- /// Extraction is infallible. Worst case it should return a no-op driver.
227
- fn extract ( & mut self , bytes : & [ u8 ] ) -> Self :: Driver ;
228
- }
229
-
230
- impl < Insp > BlockDriver < Insp > for InProgressBlock {
231
- type Block = NoopBlock ;
232
-
233
- type Error < Db : Database + DatabaseCommit > = Error < Db > ;
234
-
235
- fn block ( & self ) -> & Self :: Block {
236
- & NoopBlock
237
- }
238
-
239
- /// Loops through the transactions in the block and runs them, accepting the state at the end
240
- /// if it was successful and returning and erroring out otherwise.
241
- fn run_txns < Db : Database + DatabaseCommit > (
242
- & mut self ,
243
- mut trevm : trevm:: EvmNeedsTx < Db , Insp > ,
244
- ) -> trevm:: RunTxResult < Db , Insp , Self >
245
- where
246
- Insp : Inspector < Ctx < Db > > ,
247
- {
248
- for tx in self . transactions ( ) . iter ( ) {
249
- if tx. recover_signer ( ) . is_ok ( ) {
250
- let sender = tx. recover_signer ( ) . unwrap ( ) ;
251
- tracing:: info!( sender = ?sender, tx_hash = ?tx. tx_hash( ) , "simulating transaction" ) ;
252
-
253
- let t = match trevm. run_tx ( tx) {
254
- Ok ( t) => t,
255
- Err ( e) => {
256
- if e. is_transaction_error ( ) {
257
- return Ok ( e. discard_error ( ) ) ;
258
- } else {
259
- return Err ( e. err_into ( ) ) ;
260
- }
261
- }
262
- } ;
263
-
264
- ( _, trevm) = t. accept ( ) ;
265
- }
266
- }
267
- Ok ( trevm)
268
- }
269
-
270
- fn post_block < Db : Database + DatabaseCommit > (
271
- & mut self ,
272
- _trevm : & trevm:: EvmNeedsBlock < Db , Insp > ,
273
- ) -> Result < ( ) , Self :: Error < Db > >
274
- where
275
- Insp : Inspector < Ctx < Db > > ,
276
- {
277
- Ok ( ( ) )
278
- }
279
- }
280
-
281
213
/// Defines the CfgEnv for Pecorino Network
282
214
#[ derive( Debug , Clone , Copy ) ]
283
215
pub struct PecorinoCfg ;
0 commit comments