Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Consensus] introduce consensus only simtests #20683

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

akichidis
Copy link
Contributor

@akichidis akichidis commented Dec 18, 2024

Description

PR is introducing the framework to enable us run Consensus-only simtests. Looking on the existing sui-swarm it would be a bit challenging to reuse as APIs are different and especially when we need to access consensus specific components.

The PR is using similar patterns that have been used in sui-swarm but I am expecting to refine this as we go. This might be a good start for now. A simple simtest method has been added for the time being test_committee_start_simple . Eventually we want to replace the tests on authority_node and add a few more cases. Motivation to do this has been the Garbage Collection work when investigating some edge cases where reproducibility was important to confirm the issues.

Example to run this simtest with additional logging, a high regional variance in latency, and outputting the result in output.txt

SUI_SIM_CONFIG=regional_high_variance RUST_LOG=info,consensus_core=debug cargo simtest test_committee_start  --nocapture > output.txt 2>&1

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:

@akichidis akichidis requested a review from a team as a code owner December 18, 2024 20:28
Copy link

vercel bot commented Dec 18, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

3 Skipped Deployments
Name Status Preview Comments Updated (UTC)
multisig-toolkit ⬜️ Ignored (Inspect) Dec 18, 2024 8:28pm
sui-kiosk ⬜️ Ignored (Inspect) Dec 18, 2024 8:28pm
sui-typescript-docs ⬜️ Ignored (Inspect) Dec 18, 2024 8:28pm

@akichidis akichidis temporarily deployed to sui-typescript-aws-kms-test-env December 18, 2024 20:28 — with GitHub Actions Inactive
@akichidis akichidis requested a review from mystenmark December 18, 2024 20:28
Copy link
Member

@mwtian mwtian left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great work!

sui-macros.workspace = true
sui-protocol-config.workspace = true
sui-simulator.workspace = true
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be in [target.'cfg(msim)'.dependencies], and potentially other additional dependencies.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Or maybe it is better to have a consensus-simulator crate?

@@ -0,0 +1,11 @@
// Copyright (c) Mysten Labs, Inc.
// SPDX-License-Identifier: Apache-2.0
pub mod node;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why pub?

};

#[derive(Clone)]
#[allow(unused)]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why unused?

use std::sync::Arc;
use tracing::info;

pub(crate) struct AuthorityNodeContainer {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is it necessary to create this struct when not using simtest target?

@mwtian mwtian requested a review from arun-koshy December 19, 2024 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants