@@ -154,8 +154,12 @@ impl Default for Config {
154154 compute_unit_limit : 40000 ,
155155 compute_unit_price_micro_lamports : None ,
156156 dynamic_compute_unit_pricing_enabled : false ,
157- maximum_total_compute_fee_micro_lamports : 1_000_000_000_000 ,
158- maximum_slot_gap_for_dynamic_compute_unit_price : 25 ,
157+ // Maximum total compute unit fee paid for a single transaction (0.0001 SOL)
158+ maximum_total_compute_fee_micro_lamports : 100_000_000_000 ,
159+ // A publisher update is not included if it is 25 slots behind the current slot.
160+ // Due to the delay in the network (until a block gets confirmed) we add 5 slots
161+ // to make sure we do not overpay.
162+ maximum_slot_gap_for_dynamic_compute_unit_price : 30 ,
159163 }
160164 }
161165}
@@ -722,12 +726,18 @@ impl Exporter {
722726
723727 let result = result_rx. await ??;
724728
725- // Calculate the maximum slot difference between aggregate slot and
729+ // Calculate the maximum slot difference between the publisher latest slot and
726730 // current slot amongst all the accounts. Here, the aggregate slot is
727731 // used instead of the publishers latest update to avoid overpaying.
728732 let oldest_slot = result
729733 . values ( )
730- . map ( |account| account. last_slot )
734+ . flat_map ( |account| {
735+ account
736+ . comp
737+ . iter ( )
738+ . find ( |c| c. publisher == publish_keypair. pubkey ( ) )
739+ . map ( |c| c. latest . pub_slot )
740+ } )
731741 . min ( )
732742 . ok_or ( anyhow ! ( "No price accounts" ) ) ?;
733743
0 commit comments