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

Testing: Don't fail for heartbeat in same block as proposal #6229

Merged
merged 1 commit into from
Jan 15, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 5 additions & 4 deletions test/e2e-go/features/incentives/challenge_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ func testChallengesOnce(t *testing.T, a *require.Assertions) (retry bool) {
// Watch the first half grace period for proposals from challenged nodes, since they won't have to heartbeat.
lucky := util.MakeSet[basics.Address]()
fixture.WithEveryBlock(challengeRound, challengeRound+grace/2, func(block bookkeeping.Block) {
t.Logf("1st half Block %d, proposed by %s\n", block.Round(), block.Proposer())
if eligible2.Contains(block.Proposer()) {
lucky.Add(block.Proposer())
}
Expand All @@ -186,10 +187,7 @@ func testChallengesOnce(t *testing.T, a *require.Assertions) (retry bool) {
// In the second half of the grace period, Node 2 should heartbeat for its eligible accounts
beated := util.MakeSet[basics.Address]()
fixture.WithEveryBlock(challengeRound+grace/2+1, challengeRound+grace, func(block bookkeeping.Block) {
t.Logf("2nd half Block %d\n", block.Round())
if eligible2.Contains(block.Proposer()) {
lucky.Add(block.Proposer())
}
t.Logf("2nd half Block %d, proposed by %s\n", block.Round(), block.Proposer())
for i, txn := range block.Payset {
hb := txn.Txn.HeartbeatTxnFields
t.Logf("Heartbeat txn %v in position %d round %d\n", hb, i, block.Round())
Expand All @@ -199,6 +197,9 @@ func testChallengesOnce(t *testing.T, a *require.Assertions) (retry bool) {
beated.Add(hb.HbAddress)
a.NotContains(lucky, hb.HbAddress, "unneeded %s", hb.HbAddress) // we should not see a heartbeat from an account that proposed
}
if eligible2.Contains(block.Proposer()) {
lucky.Add(block.Proposer())
}
a.Empty(block.AbsentParticipationAccounts) // nobody suspended during grace
})
a.Equal(eligible2, util.Union(beated, lucky))
Expand Down
Loading