Skip to content

Commit

Permalink
fix congestion control simtest for enabled burst mode
Browse files Browse the repository at this point in the history
  • Loading branch information
aschran committed Jan 3, 2025
1 parent 50c085a commit 5da84ec
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions crates/sui-benchmark/tests/simtest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -476,7 +476,8 @@ mod test {
let max_deferral_rounds;
let cap_factor_denominator;
let absolute_cap_factor;
let allow_overage_factor;
let mut allow_overage_factor = 0;
let mut burst_limit_factor = 0;
let separate_randomness_budget;
{
let mut rng = thread_rng();
Expand All @@ -495,20 +496,23 @@ mod test {
rng.gen_range(1000..10000) // Large deferral round (testing liveness)
};
allow_overage_factor = if rng.gen_bool(0.5) {
0
} else {
rng.gen_range(1..100)
};
cap_factor_denominator = rng.gen_range(1..100);
absolute_cap_factor = rng.gen_range(2..50);
if allow_overage_factor > 2 && rng.gen_bool(0.5) {
burst_limit_factor = rng.gen_range(1..allow_overage_factor / 2);
}
separate_randomness_budget = rng.gen_bool(0.5);
}

info!(
"test_simulated_load_shared_object_congestion_control setup.
mode: {mode:?}, checkpoint_budget_factor: {checkpoint_budget_factor:?},
max_deferral_rounds: {max_deferral_rounds:?},
txn_count_limit: {txn_count_limit:?}, allow_overage_factor: {allow_overage_factor:?},
txn_count_limit: {txn_count_limit:?},
allow_overage_factor: {allow_overage_factor:?},
burst_limit_factor: {burst_limit_factor:?},
cap_factor_denominator: {cap_factor_denominator:?},
absolute_cap_factor: {absolute_cap_factor:?},
separate_randomness_budget: {separate_randomness_budget:?}",
Expand Down Expand Up @@ -544,6 +548,9 @@ mod test {
config.set_max_txn_cost_overage_per_object_in_commit_for_testing(
allow_overage_factor * total_gas_limit,
);
config.set_allowed_txn_cost_overage_burst_per_object_in_commit_for_testing(
burst_limit_factor * total_gas_limit,
);
if separate_randomness_budget {
config
.set_max_accumulated_randomness_txn_cost_per_object_in_mysticeti_commit_for_testing(
Expand Down

0 comments on commit 5da84ec

Please sign in to comment.