Skip to content

Commit 66613c9

Browse files
authored
fix distribute to mempool txs filtering (#211)
## 📝 Summary Don't filter mempool txs form the joint contribution when redistibuting to them ## 💡 Motivation and Context <!--- (Optional) Why is this change required? What problem does it solve? Remove this section if not applicable. --> --- ## ✅ I have completed the following steps: * [ ] Run `make lint` * [ ] Run `make test` * [ ] Added tests (if applicable)
1 parent ad5117e commit 66613c9

File tree

1 file changed

+4
-2
lines changed
  • crates/rbuilder/src/backtest/redistribute

1 file changed

+4
-2
lines changed

crates/rbuilder/src/backtest/redistribute/mod.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ pub fn calc_redistributions<ConfigType: LiveBuilderConfig + Send + Sync>(
157157
&available_orders,
158158
&results_without_exclusion,
159159
exclusion_results,
160+
distribute_to_mempool_txs,
160161
)?;
161162

162163
let calculated_redistribution_result = apply_redistribution_formula(
@@ -591,6 +592,7 @@ fn calc_joint_exclusion_results<ConfigType: LiveBuilderConfig + Sync>(
591592
available_orders: &AvailableOrders,
592593
results_without_exclusion: &ResultsWithoutExclusion,
593594
mut exclusion_results: ExclusionResults,
595+
distribute_to_mempool_txs: bool,
594596
) -> eyre::Result<ExclusionResults> {
595597
// calculate identities that are possibly connected
596598
let mut joint_contribution_todo: Vec<(Address, Address)> = Vec::new();
@@ -610,7 +612,7 @@ fn calc_joint_exclusion_results<ConfigType: LiveBuilderConfig + Sync>(
610612
.iter()
611613
.map(|(o, _)| o),
612614
)
613-
.filter(|o| !matches!(o, OrderId::Tx(_)));
615+
.filter(|o| distribute_to_mempool_txs || !matches!(o, OrderId::Tx(_)));
614616
for new_failed_order in candidate_conflicting_bundles {
615617
// we only consider landed <-> landed order conflicts
616618
if !available_orders
@@ -670,7 +672,7 @@ fn calc_joint_exclusion_results<ConfigType: LiveBuilderConfig + Sync>(
670672
.identity_exclusion(address2)
671673
.block_value_delta;
672674
if bvd1 + bvd2 > block_value_delta {
673-
warn!(address1 = ?address1, address2 = ?address2, "Joint block value delta is smaller than sum of individual block value deltas");
675+
warn!(address1 = ?address1, address2 = ?address2, sum = format_ether(bvd1 + bvd2), joint=format_ether(block_value_delta), "Joint block value delta is smaller than sum of individual block value deltas");
674676
}
675677
}
676678

0 commit comments

Comments
 (0)