Skip to content

Commit

Permalink
fix congestion control simtest for enabled burst mode (#20769)
Browse files Browse the repository at this point in the history
---

## Release notes

Check each box that your changes affect. If none of the boxes relate to
your changes, release notes aren't required.

For each box you select, include information after the relevant heading
that describes the impact of your changes that a user might notice and
any actions they must take to implement updates.

- [ ] Protocol: 
- [ ] Nodes (Validators and Full nodes): 
- [ ] gRPC:
- [ ] JSON-RPC: 
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:
  • Loading branch information
aschran authored Jan 3, 2025
1 parent 0ae930c commit e8f1315
Showing 1 changed file with 14 additions and 7 deletions.
21 changes: 14 additions & 7 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 @@ -494,21 +495,24 @@ mod test {
} else {
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)
};
if rng.gen_bool(0.5) {
allow_overage_factor = 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 > 1 && rng.gen_bool(0.5) {
burst_limit_factor = rng.gen_range(1..allow_overage_factor);
}
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 e8f1315

Please sign in to comment.