Skip to content

Commit

Permalink
Enable burst mode for congestion control at 10x per-commit rate (#20755)
Browse files Browse the repository at this point in the history
  • Loading branch information
aschran authored Jan 2, 2025
1 parent 02ce40e commit abeabc7
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 3 deletions.
2 changes: 2 additions & 0 deletions crates/sui-core/src/unit_tests/authority_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5736,6 +5736,7 @@ async fn test_consensus_handler_per_object_congestion_control(
}
protocol_config.set_max_deferral_rounds_for_congestion_control_for_testing(1000); // Set to a large number so that we don't hit this limit.
protocol_config.set_max_txn_cost_overage_per_object_in_commit_for_testing(0);
protocol_config.set_allowed_txn_cost_overage_burst_per_object_in_commit_for_testing(0);
let authority = TestAuthorityBuilder::new()
.with_reference_gas_price(1000)
.with_protocol_config(protocol_config)
Expand Down Expand Up @@ -5965,6 +5966,7 @@ async fn test_consensus_handler_congestion_control_transaction_cancellation() {
.set_max_accumulated_txn_cost_per_object_in_mysticeti_commit_for_testing(100_000_000);
protocol_config.set_max_deferral_rounds_for_congestion_control_for_testing(2);
protocol_config.set_max_txn_cost_overage_per_object_in_commit_for_testing(0);
protocol_config.set_allowed_txn_cost_overage_burst_per_object_in_commit_for_testing(0);
let authority = TestAuthorityBuilder::new()
.with_reference_gas_price(1000)
.with_protocol_config(protocol_config)
Expand Down
3 changes: 3 additions & 0 deletions crates/sui-protocol-config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3093,6 +3093,9 @@ impl ProtocolConfig {
}
71 => {
cfg.sip_45_consensus_amplification_threshold = Some(5);

// Enable bursts for congestion control. (10x the per-commit budget)
cfg.allowed_txn_cost_overage_burst_per_object_in_commit = Some(185_000_000);
}
// Use this template when making changes:
//
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
source: crates/sui-protocol-config/src/lib.rs
expression: "ProtocolConfig::get_for_version(cur, *chain_id)"
snapshot_kind: text
---
version: 71
feature_flags:
Expand Down Expand Up @@ -332,6 +331,7 @@ consensus_voting_rounds: 40
max_accumulated_txn_cost_per_object_in_narwhal_commit: 40
max_deferral_rounds_for_congestion_control: 10
max_txn_cost_overage_per_object_in_commit: 18446744073709551615
allowed_txn_cost_overage_burst_per_object_in_commit: 185000000
min_checkpoint_interval_ms: 200
checkpoint_summary_version_specific_data: 1
max_soft_bundle_size: 5
Expand All @@ -341,3 +341,4 @@ max_accumulated_randomness_txn_cost_per_object_in_mysticeti_commit: 3700000
gas_budget_based_txn_cost_cap_factor: 400000
gas_budget_based_txn_cost_absolute_cap_commit_count: 50
sip_45_consensus_amplification_threshold: 5

Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
source: crates/sui-protocol-config/src/lib.rs
expression: "ProtocolConfig::get_for_version(cur, *chain_id)"
snapshot_kind: text
---
version: 71
feature_flags:
Expand Down Expand Up @@ -335,6 +334,7 @@ consensus_voting_rounds: 40
max_accumulated_txn_cost_per_object_in_narwhal_commit: 40
max_deferral_rounds_for_congestion_control: 10
max_txn_cost_overage_per_object_in_commit: 18446744073709551615
allowed_txn_cost_overage_burst_per_object_in_commit: 185000000
min_checkpoint_interval_ms: 200
checkpoint_summary_version_specific_data: 1
max_soft_bundle_size: 5
Expand All @@ -344,3 +344,4 @@ max_accumulated_randomness_txn_cost_per_object_in_mysticeti_commit: 3700000
gas_budget_based_txn_cost_cap_factor: 400000
gas_budget_based_txn_cost_absolute_cap_commit_count: 50
sip_45_consensus_amplification_threshold: 5

Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
---
source: crates/sui-protocol-config/src/lib.rs
expression: "ProtocolConfig::get_for_version(cur, *chain_id)"
snapshot_kind: text
---
version: 71
feature_flags:
Expand Down Expand Up @@ -344,6 +343,7 @@ consensus_voting_rounds: 40
max_accumulated_txn_cost_per_object_in_narwhal_commit: 40
max_deferral_rounds_for_congestion_control: 10
max_txn_cost_overage_per_object_in_commit: 18446744073709551615
allowed_txn_cost_overage_burst_per_object_in_commit: 185000000
min_checkpoint_interval_ms: 200
checkpoint_summary_version_specific_data: 1
max_soft_bundle_size: 5
Expand All @@ -353,3 +353,4 @@ max_accumulated_randomness_txn_cost_per_object_in_mysticeti_commit: 3700000
gas_budget_based_txn_cost_cap_factor: 400000
gas_budget_based_txn_cost_absolute_cap_commit_count: 50
sip_45_consensus_amplification_threshold: 5

0 comments on commit abeabc7

Please sign in to comment.