Skip to content

Commit

Permalink
[Consensus] increase min round delay in tests (#19644)
Browse files Browse the repository at this point in the history
## Description 

It seems the default delay can result in too many commits per sec.
Also turn another per-commit log into debug, since we have not seen
related issues recently.

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

- [ ] Protocol: 
- [ ] Nodes (Validators and Full nodes): 
- [ ] Indexer: 
- [ ] JSON-RPC: 
- [ ] GraphQL: 
- [ ] CLI: 
- [ ] Rust SDK:
- [ ] REST API:
  • Loading branch information
mwtian authored Oct 1, 2024
1 parent 6930fea commit 782461f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion consensus/config/src/parameters.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ pub struct Parameters {
#[serde(skip)]
pub db_path: PathBuf,

/// Time to wait for parent round leader before sealing a block.
/// Time to wait for parent round leader before sealing a block, from when parent round
/// has a quorum.
#[serde(default = "Parameters::default_leader_timeout")]
pub leader_timeout: Duration,

Expand Down Expand Up @@ -102,6 +103,9 @@ impl Parameters {
// leading to long reconfiguration delays. This is because simtest is single threaded,
// and spending too much time in consensus can lead to starvation elsewhere.
Duration::from_millis(400)
} else if cfg!(test) {
// Avoid excessive CPU, data and logs in tests.
Duration::from_millis(250)
} else {
Duration::from_millis(50)
}
Expand Down
2 changes: 1 addition & 1 deletion consensus/core/src/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -576,7 +576,7 @@ impl Core {
let Some(last_decided) = decided_leaders.last().cloned() else {
break;
};
tracing::info!("Decided {} leaders and {commits_until_update} commits can be made before next leader schedule change", decided_leaders.len());
tracing::debug!("Decided {} leaders and {commits_until_update} commits can be made before next leader schedule change", decided_leaders.len());

let mut sequenced_leaders = decided_leaders
.into_iter()
Expand Down

0 comments on commit 782461f

Please sign in to comment.