@@ -257,7 +257,7 @@ impl Mempool {
257
257
tx_pool : TransactionPool :: new ( clock. clone ( ) ) ,
258
258
tx_queue : TransactionQueue :: default ( ) ,
259
259
accounts_with_gap : AccountsWithGap :: new ( ) ,
260
- state : MempoolState :: new ( config. committed_nonce_retention_block_count ) ,
260
+ state : MempoolState :: new ( config. static_config . committed_nonce_retention_block_count ) ,
261
261
clock,
262
262
}
263
263
}
@@ -379,7 +379,7 @@ impl Mempool {
379
379
}
380
380
381
381
fn insert_to_tx_queue ( & mut self , tx_reference : TransactionReference ) {
382
- self . tx_queue . insert ( tx_reference, self . config . validate_resource_bounds ) ;
382
+ self . tx_queue . insert ( tx_reference, self . config . static_config . validate_resource_bounds ) ;
383
383
}
384
384
385
385
fn add_tx_inner ( & mut self , args : AddTransactionArgs ) {
@@ -407,7 +407,7 @@ impl Mempool {
407
407
fn add_ready_declares ( & mut self ) {
408
408
let now = self . clock . now ( ) ;
409
409
while let Some ( ( submission_time, _args) ) = self . delayed_declares . front ( ) {
410
- if now - self . config . declare_delay < * submission_time {
410
+ if now - self . config . static_config . declare_delay < * submission_time {
411
411
break ;
412
412
}
413
413
let ( _submission_time, args) =
@@ -564,7 +564,7 @@ impl Mempool {
564
564
565
565
self . validate_no_delayed_declare_front_run ( incoming_tx_reference) ?;
566
566
567
- if !self . config . enable_fee_escalation {
567
+ if !self . config . static_config . enable_fee_escalation {
568
568
if self . tx_pool . get_by_address_and_nonce ( address, nonce) . is_some ( ) {
569
569
return Err ( MempoolError :: DuplicateNonce { address, nonce } ) ;
570
570
} ;
@@ -612,7 +612,7 @@ impl Mempool {
612
612
}
613
613
614
614
fn increased_enough ( & self , existing_value : u128 , incoming_value : u128 ) -> bool {
615
- let percentage = u128:: from ( self . config . fee_escalation_percentage ) ;
615
+ let percentage = u128:: from ( self . config . static_config . fee_escalation_percentage ) ;
616
616
617
617
// Note: To reduce precision loss, we first multiply by the percentage and then divide by
618
618
// 100. This could cause an overflow and an automatic rejection of the transaction, but the
@@ -630,8 +630,9 @@ impl Mempool {
630
630
}
631
631
632
632
fn remove_expired_txs ( & mut self ) -> AddressToNonce {
633
- let removed_txs =
634
- self . tx_pool . remove_txs_older_than ( self . config . transaction_ttl , & self . state . staged ) ;
633
+ let removed_txs = self
634
+ . tx_pool
635
+ . remove_txs_older_than ( self . config . dynamic_config . transaction_ttl , & self . state . staged ) ;
635
636
let queued_txs = self . tx_queue . remove_txs ( & removed_txs) ;
636
637
637
638
metric_count_expired_txs ( removed_txs. len ( ) ) ;
@@ -651,7 +652,7 @@ impl Mempool {
651
652
) -> ( Vec < TransactionReference > , AddressToNonce ) {
652
653
// Divide the chunk into transactions that are old and no longer valid and those that
653
654
// remain valid.
654
- let submission_cutoff_time = self . clock . now ( ) - self . config . transaction_ttl ;
655
+ let submission_cutoff_time = self . clock . now ( ) - self . config . dynamic_config . transaction_ttl ;
655
656
let ( old_txs, valid_txs) : ( Vec < _ > , Vec < _ > ) = txs. into_iter ( ) . partition ( |tx| {
656
657
let tx_submission_time = self
657
658
. tx_pool
@@ -695,7 +696,7 @@ impl Mempool {
695
696
696
697
// Returns true if the mempool will exceeds its capacity by adding the given transaction.
697
698
fn exceeds_capacity ( & self , tx : & InternalRpcTransaction ) -> bool {
698
- self . size_in_bytes ( ) + tx. total_bytes ( ) > self . config . capacity_in_bytes
699
+ self . size_in_bytes ( ) + tx. total_bytes ( ) > self . config . static_config . capacity_in_bytes
699
700
}
700
701
701
702
fn update_accounts_with_gap ( & mut self , address_to_nonce : AddressToNonce ) {
0 commit comments