@@ -72,7 +72,7 @@ struct BlockVerifierRouter<S, V>
7272where
7373 S : Service < zs:: Request , Response = zs:: Response , Error = BoxError > + Send + Clone + ' static ,
7474 S :: Future : Send + ' static ,
75- V : Service < transaction:: Request , Response = transaction:: Response , Error = BoxError >
75+ V : Service < transaction:: BlockRequest , Response = transaction:: BlockResponse , Error = BoxError >
7676 + Send
7777 + Clone
7878 + ' static ,
@@ -157,7 +157,7 @@ impl<S, V> Service<Request> for BlockVerifierRouter<S, V>
157157where
158158 S : Service < zs:: Request , Response = zs:: Response , Error = BoxError > + Send + Clone + ' static ,
159159 S :: Future : Send + ' static ,
160- V : Service < transaction:: Request , Response = transaction:: Response , Error = BoxError >
160+ V : Service < transaction:: BlockRequest , Response = transaction:: BlockResponse , Error = BoxError >
161161 + Send
162162 + Clone
163163 + ' static ,
@@ -219,7 +219,7 @@ where
219219
220220/// Initialize block and transaction verification services.
221221///
222- /// Returns a block verifier, transaction verifier,
222+ /// Returns a block verifier, mempool transaction verifier,
223223/// a [`BackgroundTaskHandles`] with the state checkpoint verify task,
224224/// and the maximum configured checkpoint verification height.
225225///
@@ -251,8 +251,8 @@ pub async fn init<S, Mempool>(
251251) -> (
252252 Buffer < BoxService < Request , block:: Hash , RouterError > , Request > ,
253253 Buffer <
254- BoxService < transaction:: Request , transaction:: Response , TransactionError > ,
255- transaction:: Request ,
254+ BoxService < transaction:: MempoolRequest , transaction:: MempoolResponse , TransactionError > ,
255+ transaction:: MempoolRequest ,
256256 > ,
257257 BackgroundTaskHandles ,
258258 Height ,
@@ -351,8 +351,13 @@ where
351351
352352 // transaction verification
353353
354- let transaction = transaction:: Verifier :: new ( network, state_service. clone ( ) , mempool) ;
355- let transaction = Buffer :: new ( BoxService :: new ( transaction) , VERIFIER_BUFFER_BOUND ) ;
354+ let block_transaction = transaction:: BlockTxVerifier :: new ( network, state_service. clone ( ) ) ;
355+ let block_transaction = Buffer :: new ( BoxService :: new ( block_transaction) , VERIFIER_BUFFER_BOUND ) ;
356+
357+ let mempool_transaction =
358+ transaction:: MempoolTxVerifier :: new ( network, state_service. clone ( ) , mempool) ;
359+ let mempool_transaction =
360+ Buffer :: new ( BoxService :: new ( mempool_transaction) , VERIFIER_BUFFER_BOUND ) ;
356361
357362 // block verification
358363 let ( list, max_checkpoint_height) = init_checkpoint_list ( config, network) ;
@@ -374,7 +379,8 @@ where
374379 "initializing block verifier router"
375380 ) ;
376381
377- let block = SemanticBlockVerifier :: new ( network, state_service. clone ( ) , transaction. clone ( ) ) ;
382+ let block =
383+ SemanticBlockVerifier :: new ( network, state_service. clone ( ) , block_transaction. clone ( ) ) ;
378384 let checkpoint = CheckpointVerifier :: from_checkpoint_list ( list, network, tip, state_service) ;
379385 let router = BlockVerifierRouter {
380386 checkpoint,
@@ -388,7 +394,12 @@ where
388394 state_checkpoint_verify_handle,
389395 } ;
390396
391- ( router, transaction, task_handles, max_checkpoint_height)
397+ (
398+ router,
399+ mempool_transaction,
400+ task_handles,
401+ max_checkpoint_height,
402+ )
392403}
393404
394405/// Parses the checkpoint list for `network` and `config`.
@@ -427,8 +438,8 @@ pub async fn init_test<S>(
427438) -> (
428439 Buffer < BoxService < Request , block:: Hash , RouterError > , Request > ,
429440 Buffer <
430- BoxService < transaction:: Request , transaction:: Response , TransactionError > ,
431- transaction:: Request ,
441+ BoxService < transaction:: MempoolRequest , transaction:: MempoolResponse , TransactionError > ,
442+ transaction:: MempoolRequest ,
432443 > ,
433444 BackgroundTaskHandles ,
434445 Height ,
0 commit comments