@@ -154,8 +154,12 @@ impl Default for Config {
154
154
compute_unit_limit : 40000 ,
155
155
compute_unit_price_micro_lamports : None ,
156
156
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 ,
159
163
}
160
164
}
161
165
}
@@ -722,12 +726,18 @@ impl Exporter {
722
726
723
727
let result = result_rx. await ??;
724
728
725
- // Calculate the maximum slot difference between aggregate slot and
729
+ // Calculate the maximum slot difference between the publisher latest slot and
726
730
// current slot amongst all the accounts. Here, the aggregate slot is
727
731
// used instead of the publishers latest update to avoid overpaying.
728
732
let oldest_slot = result
729
733
. 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
+ } )
731
741
. min ( )
732
742
. ok_or ( anyhow ! ( "No price accounts" ) ) ?;
733
743
0 commit comments