Skip to content

test(redis): stop assuming equal-stake winner - #321

Merged
0xCardiE merged 1 commit into
masterfrom
fix/flaky-equal-stake-winner
Sep 3, 2026
Merged

test(redis): stop assuming equal-stake winner#321
0xCardiE merged 1 commit into
masterfrom
fix/flaky-equal-stake-winner

Conversation

@0xCardiE

@0xCardiE 0xCardiE commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Equal-stake redistribution winner is a prevrandao lottery. The tests hardcoded node_5 as winner, which flakes on CI when node_1 is selected (isWinner(overlay_1_n_25) expected false).
  • After both truth-tellers reveal, assert exactly one of the two overlays is the winner and drive claim/payout/WinnerSelected checks off the actual winner.

Fixes the failure on https://github.com/ethersphere/storage-incentives/actions/runs/33755478805.

Test plan

  • yarn test --grep "two commits with equal stakes"
  • CI mocha suite on this PR
  • Confirm if both reveal, should select correct winner no longer fails when node_1 wins the lottery

Equal-stake reveal lottery is prevrandao; CI sometimes
picks node_1. Assert exactly one winner and pay whoever won.
@0xCardiE
0xCardiE merged commit 3b4086a into master Sep 3, 2026
7 checks passed
@0xCardiE
0xCardiE deleted the fix/flaky-equal-stake-winner branch September 3, 2026 14:15
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.

1 participant