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,19 @@ 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 <
228
+ Pool : TransactionPool ,
229
+ Client ,
230
+ EvmConfig ,
231
+ N : NodePrimitives ,
232
+ Txs = ( ) ,
233
+ > {
227
234
/// The type responsible for creating the evm.
228
235
pub evm_config : EvmConfig ,
229
236
/// The builder's signer key to use for an end of block tx
230
237
pub builder_signer : Option < Signer > ,
231
238
/// The transaction pool
232
- pub pool : Pool ,
239
+ pub pool : CustomPool < Pool > ,
233
240
/// Node client
234
241
pub client : Client ,
235
242
/// Settings for the builder, e.g. DA settings.
@@ -247,7 +254,7 @@ pub struct OpPayloadBuilderVanilla<Pool, Client, EvmConfig, N: NodePrimitives, T
247
254
pub supervisor_safety_level : SafetyLevel ,
248
255
}
249
256
250
- impl < Pool , Client , EvmConfig , N : NodePrimitives >
257
+ impl < Pool : TransactionPool , Client , EvmConfig , N : NodePrimitives >
251
258
OpPayloadBuilderVanilla < Pool , Client , EvmConfig , N >
252
259
{
253
260
/// `OpPayloadBuilder` constructor.
@@ -298,6 +305,7 @@ impl<Pool, Client, EvmConfig, N: NodePrimitives>
298
305
serde_json:: from_str ( level. as_str ( ) ) . expect ( "parsing supervisor_safety_level" )
299
306
} )
300
307
. unwrap_or ( SafetyLevel :: CrossUnsafe ) ;
308
+ let pool = CustomPool :: new ( pool. clone ( ) ) ;
301
309
Self {
302
310
pool,
303
311
client,
@@ -772,30 +780,30 @@ impl<Txs> OpBuilder<'_, Txs> {
772
780
pub trait OpPayloadTransactions < Transaction > : Clone + Send + Sync + Unpin + ' static {
773
781
/// Returns an iterator that yields the transaction in the order they should get included in the
774
782
/// new payload.
775
- fn best_transactions < Pool : TransactionPool < Transaction = Transaction > > (
783
+ fn best_transactions < Pool : CustomTransactionPool < Transaction = Transaction > > (
776
784
& self ,
777
785
pool : Pool ,
778
786
attr : BestTransactionsAttributes ,
779
787
) -> impl PayloadTransactions < Transaction = Transaction > ;
780
788
781
789
/// Removes invalid transactions from the tx pool
782
- fn remove_invalid < Pool : TransactionPool < Transaction = Transaction > > (
790
+ fn remove_invalid < Pool : CustomTransactionPool < Transaction = Transaction > > (
783
791
& self ,
784
792
pool : Pool ,
785
793
hashes : Vec < TxHash > ,
786
794
) ;
787
795
}
788
796
789
797
impl < T : PoolTransaction > OpPayloadTransactions < T > for ( ) {
790
- fn best_transactions < Pool : TransactionPool < Transaction = T > > (
798
+ fn best_transactions < Pool : CustomTransactionPool < Transaction = T > > (
791
799
& self ,
792
800
pool : Pool ,
793
801
attr : BestTransactionsAttributes ,
794
802
) -> impl PayloadTransactions < Transaction = T > {
795
803
BestPayloadTransactions :: new ( pool. best_transactions_with_attributes ( attr) )
796
804
}
797
805
798
- fn remove_invalid < Pool : TransactionPool < Transaction = T > > (
806
+ fn remove_invalid < Pool : CustomTransactionPool < Transaction = T > > (
799
807
& self ,
800
808
pool : Pool ,
801
809
hashes : Vec < TxHash > ,
0 commit comments