Skip to content

Commit

Permalink
chore: lower timeouts for triple, presig and sig generation (#771)
Browse files Browse the repository at this point in the history
* Lower concurrent introduction to 2

* Lower triple, presig and sig timeouts

* Fix config test
  • Loading branch information
ChaoticTempest authored Jul 30, 2024
1 parent ef5064b commit eb200b6
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
16 changes: 9 additions & 7 deletions chain-signatures/contract/src/config/impls.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,12 @@ use super::{
Config, DynamicValue, PresignatureConfig, ProtocolConfig, SignatureConfig, TripleConfig,
};

/// This is maximum expected participants we aim to support right now. This can be different
/// in the future as we scale the network further.
const MAX_EXPECTED_PARTICIPANTS: u32 = 32;

// The network multiplier is used to calculate the maximum amount of protocols in totality
// that should be in the network.
/// The network multiplier is used to calculate the maximum amount of protocols in totality
/// that should be in the network.
const NETWORK_MULTIPLIER: u32 = 128;

impl Config {
Expand All @@ -27,8 +29,8 @@ impl Default for ProtocolConfig {
Self {
message_timeout: min_to_ms(5),
garbage_timeout: hours_to_ms(2),
max_concurrent_introduction: 4,
max_concurrent_generation: 4 * MAX_EXPECTED_PARTICIPANTS,
max_concurrent_introduction: 2,
max_concurrent_generation: 2 * MAX_EXPECTED_PARTICIPANTS,
triple: TripleConfig::default(),
presignature: PresignatureConfig::default(),
signature: Default::default(),
Expand All @@ -43,7 +45,7 @@ impl Default for TripleConfig {
Self {
min_triples: 1024,
max_triples: 1024 * MAX_EXPECTED_PARTICIPANTS * NETWORK_MULTIPLIER,
generation_timeout: min_to_ms(20),
generation_timeout: min_to_ms(10),

other: Default::default(),
}
Expand All @@ -55,7 +57,7 @@ impl Default for PresignatureConfig {
Self {
min_presignatures: 512,
max_presignatures: 512 * MAX_EXPECTED_PARTICIPANTS * NETWORK_MULTIPLIER,
generation_timeout: secs_to_ms(60),
generation_timeout: secs_to_ms(45),

other: Default::default(),
}
Expand All @@ -65,7 +67,7 @@ impl Default for PresignatureConfig {
impl Default for SignatureConfig {
fn default() -> Self {
Self {
generation_timeout: secs_to_ms(60),
generation_timeout: secs_to_ms(45),

other: Default::default(),
}
Expand Down
2 changes: 1 addition & 1 deletion chain-signatures/contract/tests/updates.rs
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ async fn test_propose_update_config() {
// have each participant propose a new update:
let new_config = Config {
protocol: ProtocolConfig {
max_concurrent_introduction: 2,
max_concurrent_generation: 10000,
..ProtocolConfig::default()
},
..Config::default()
Expand Down

0 comments on commit eb200b6

Please sign in to comment.