fix(CCHAIN-1176): Change equivocation tests' logic so they aren't flaky on CI#1510
Open
sergio-mena wants to merge 2 commits intocirclefin:mainfrom
Open
fix(CCHAIN-1176): Change equivocation tests' logic so they aren't flaky on CI#1510sergio-mena wants to merge 2 commits intocirclefin:mainfrom
sergio-mena wants to merge 2 commits intocirclefin:mainfrom
Conversation
cason
reviewed
Feb 27, 2026
Contributor
cason
left a comment
There was a problem hiding this comment.
Thank you for this. Works like a charm locally, single height always. Lets see in CI.
| }; | ||
| let mut test = TestBuilder::<()>::new(); | ||
|
|
||
| // Node 1 |
Contributor
There was a problem hiding this comment.
Suggested change
| // Node 1 | |
| // Node 1 - Byzantine |
| .start() | ||
| .on_vote(|_v, _s| Ok(HandlerResult::SleepAndContinueTest(VOTE_DURATION))) | ||
| .success(); | ||
| // Node 2 (same validator key as node 1). |
Contributor
There was a problem hiding this comment.
Suggested change
| // Node 2 (same validator key as node 1). | |
| // Node 2 - Byzantine: same validator key as node 1 |
| test.add_node().start().success(); | ||
|
|
||
| // Node 3 -- checking proposal equivocation evidence | ||
| // Node 3 -- checking proposal equivocation evidence. |
Contributor
There was a problem hiding this comment.
Suggested change
| // Node 3 -- checking proposal equivocation evidence. | |
| // Node 3: correct, with >2/3 of the total voting power. | |
| // Checks for proposal equivocation. |
| /// * no single honest node has >2/3 of total VP, so needs to collect votes from others | ||
| #[tokio::test] | ||
| #[ignore] // Flaky test | ||
| pub async fn equivocation_two_vals_same_pk_vote() { |
Contributor
There was a problem hiding this comment.
Suggested change
| pub async fn equivocation_two_vals_same_pk_vote() { | |
| pub async fn equivocation_two_vals_same_key_vote() { |
| .start() | ||
| .on_vote(|_v, _s| Ok(HandlerResult::SleepAndContinueTest(VOTE_DURATION))) | ||
| .success(); | ||
| // Node 1 votes normally. |
Contributor
There was a problem hiding this comment.
Suggested change
| // Node 1 votes normally. | |
| // Node 1 - Byzantine |
| // Node 3 checks for proposal equivocation evidence. | ||
| #[tokio::test] | ||
| #[ignore] // Flaky test | ||
| pub async fn equivocation_two_vals_same_pk_proposal() { |
Contributor
There was a problem hiding this comment.
Suggested change
| pub async fn equivocation_two_vals_same_pk_proposal() { | |
| pub async fn equivocation_two_vals_same_key_proposal() { |
| test.add_node().start().success(); | ||
|
|
||
| // Node 2 (same validator key as node 1) | ||
| // Node 2 (same validator key as node 1) prevotes for random values. |
Contributor
There was a problem hiding this comment.
Suggested change
| // Node 2 (same validator key as node 1) prevotes for random values. | |
| // Node 2 - Byzantine: same validator key as node 1 and prevotes for random values. |
|
|
||
| // Node 3 -- checking vote equivocation evidence | ||
| // Nodes 3 to 6 (honest) | ||
| for _ in 0..4 { |
Contributor
There was a problem hiding this comment.
Suggested change
| for _ in 0..4 { | |
| for _ in 3..=6 { |
cason
approved these changes
Feb 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes: #1509
Story: https://circlepay.atlassian.net/browse/CCHAIN-1176
PR author checklist
Contribution eligibility
For all contributors
RELEASE_NOTES.mdif the change warrants itBREAKING_CHANGES.mdif the change warrants itFor external contributors