Skip to content

Commit

Permalink
[Consensus] enable consensus garbage collection for testnet (#21208)
Browse files Browse the repository at this point in the history
## Description 

Enables the Consensus garbage collection for testnet. `gc_depth` is set
to `60` , which with the current round rate of 12-15 rounds/sec it
should allow the network to include blocks in a window of `4-5 seconds`.

## Test plan 

CI

---

## 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.

- [x] Protocol: Enables consensus garbage collection for testnet
- [ ] Nodes (Validators and Full nodes): 
- [ ] gRPC:
- [ ] JSON-RPC: 
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:
  • Loading branch information
akichidis authored Feb 13, 2025
1 parent d2996dc commit d2ca0e1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions crates/sui-protocol-config/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -217,6 +217,7 @@ const MAX_PROTOCOL_VERSION: u64 = 74;
// Enable all gas costs for load_nitro_attestation.
// Enable zstd compression for consensus tonic network in mainnet.
// Enable the new commit rule for devnet.
// Enable consensus garbage collection for testnet.

#[derive(Copy, Clone, Debug, Hash, Serialize, Deserialize, PartialEq, Eq, PartialOrd, Ord)]
pub struct ProtocolVersion(u64);
Expand Down Expand Up @@ -3245,6 +3246,12 @@ impl ProtocolConfig {
if chain != Chain::Mainnet && chain != Chain::Testnet {
cfg.feature_flags.consensus_linearize_subdag_v2 = true;
}

if chain != Chain::Mainnet {
// Assuming a round rate of max 15/sec, then using a gc depth of 60 allow blocks within a window of ~4 seconds
// to be included before be considered garbage collected.
cfg.consensus_gc_depth = Some(60);
}
}
// Use this template when making changes:
//
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ max_soft_bundle_size: 5
bridge_should_try_to_finalize_committee: true
max_accumulated_txn_cost_per_object_in_mysticeti_commit: 37000000
max_accumulated_randomness_txn_cost_per_object_in_mysticeti_commit: 7400000
consensus_gc_depth: 60
gas_budget_based_txn_cost_cap_factor: 400000
gas_budget_based_txn_cost_absolute_cap_commit_count: 50
sip_45_consensus_amplification_threshold: 5
Expand Down

0 comments on commit d2ca0e1

Please sign in to comment.