1
+ use crate :: txpool_trait:: { CustomPool , CustomTransactionPool } ;
1
2
use crate :: {
2
3
generator:: { BlockCell , BlockPayloadJobGenerator , BuildArguments , PayloadBuilder } ,
3
4
metrics:: OpRBuilderMetrics ,
@@ -194,7 +195,7 @@ where
194
195
impl < Pool , Client , EvmConfig , N , Txs > reth_basic_payload_builder:: PayloadBuilder
195
196
for OpPayloadBuilderVanilla < Pool , Client , EvmConfig , N , Txs >
196
197
where
197
- Pool : Clone + Send + Sync ,
198
+ Pool : TransactionPool + Clone + Send + Sync ,
198
199
Client : Clone + Send + Sync ,
199
200
EvmConfig : Clone + Send + Sync ,
200
201
N : NodePrimitives ,
@@ -223,13 +224,13 @@ where
223
224
224
225
/// Optimism's payload builder
225
226
#[ derive( Debug , Clone ) ]
226
- pub struct OpPayloadBuilderVanilla < Pool , Client , EvmConfig , N : NodePrimitives , Txs = ( ) > {
227
+ pub struct OpPayloadBuilderVanilla < Pool : TransactionPool , Client , EvmConfig , N : NodePrimitives , Txs = ( ) > {
227
228
/// The type responsible for creating the evm.
228
229
pub evm_config : EvmConfig ,
229
230
/// The builder's signer key to use for an end of block tx
230
231
pub builder_signer : Option < Signer > ,
231
232
/// The transaction pool
232
- pub pool : Pool ,
233
+ pub pool : CustomPool < Pool > ,
233
234
/// Node client
234
235
pub client : Client ,
235
236
/// Settings for the builder, e.g. DA settings.
@@ -247,7 +248,7 @@ pub struct OpPayloadBuilderVanilla<Pool, Client, EvmConfig, N: NodePrimitives, T
247
248
pub supervisor_safety_level : SafetyLevel ,
248
249
}
249
250
250
- impl < Pool , Client , EvmConfig , N : NodePrimitives >
251
+ impl < Pool : TransactionPool , Client , EvmConfig , N : NodePrimitives >
251
252
OpPayloadBuilderVanilla < Pool , Client , EvmConfig , N >
252
253
{
253
254
/// `OpPayloadBuilder` constructor.
@@ -298,6 +299,7 @@ impl<Pool, Client, EvmConfig, N: NodePrimitives>
298
299
serde_json:: from_str ( level. as_str ( ) ) . expect ( "parsing supervisor_safety_level" )
299
300
} )
300
301
. unwrap_or ( SafetyLevel :: CrossUnsafe ) ;
302
+ let pool = CustomPool :: new ( pool. clone ( ) ) ;
301
303
Self {
302
304
pool,
303
305
client,
@@ -772,30 +774,30 @@ impl<Txs> OpBuilder<'_, Txs> {
772
774
pub trait OpPayloadTransactions < Transaction > : Clone + Send + Sync + Unpin + ' static {
773
775
/// Returns an iterator that yields the transaction in the order they should get included in the
774
776
/// new payload.
775
- fn best_transactions < Pool : TransactionPool < Transaction = Transaction > > (
777
+ fn best_transactions < Pool : CustomTransactionPool < Transaction = Transaction > > (
776
778
& self ,
777
779
pool : Pool ,
778
780
attr : BestTransactionsAttributes ,
779
781
) -> impl PayloadTransactions < Transaction = Transaction > ;
780
782
781
783
/// Removes invalid transactions from the tx pool
782
- fn remove_invalid < Pool : TransactionPool < Transaction = Transaction > > (
784
+ fn remove_invalid < Pool : CustomTransactionPool < Transaction = Transaction > > (
783
785
& self ,
784
786
pool : Pool ,
785
787
hashes : Vec < TxHash > ,
786
788
) ;
787
789
}
788
790
789
791
impl < T : PoolTransaction > OpPayloadTransactions < T > for ( ) {
790
- fn best_transactions < Pool : TransactionPool < Transaction = T > > (
792
+ fn best_transactions < Pool : CustomTransactionPool < Transaction = T > > (
791
793
& self ,
792
794
pool : Pool ,
793
795
attr : BestTransactionsAttributes ,
794
796
) -> impl PayloadTransactions < Transaction = T > {
795
797
BestPayloadTransactions :: new ( pool. best_transactions_with_attributes ( attr) )
796
798
}
797
799
798
- fn remove_invalid < Pool : TransactionPool < Transaction = T > > (
800
+ fn remove_invalid < Pool : CustomTransactionPool < Transaction = T > > (
799
801
& self ,
800
802
pool : Pool ,
801
803
hashes : Vec < TxHash > ,
0 commit comments