@@ -177,6 +177,7 @@ func testChallengesOnce(t *testing.T, a *require.Assertions) (retry bool) {
177
177
// Watch the first half grace period for proposals from challenged nodes, since they won't have to heartbeat.
178
178
lucky := util .MakeSet [basics.Address ]()
179
179
fixture .WithEveryBlock (challengeRound , challengeRound + grace / 2 , func (block bookkeeping.Block ) {
180
+ t .Logf ("1st half Block %d, proposed by %s\n " , block .Round (), block .Proposer ())
180
181
if eligible2 .Contains (block .Proposer ()) {
181
182
lucky .Add (block .Proposer ())
182
183
}
@@ -186,10 +187,7 @@ func testChallengesOnce(t *testing.T, a *require.Assertions) (retry bool) {
186
187
// In the second half of the grace period, Node 2 should heartbeat for its eligible accounts
187
188
beated := util .MakeSet [basics.Address ]()
188
189
fixture .WithEveryBlock (challengeRound + grace / 2 + 1 , challengeRound + grace , func (block bookkeeping.Block ) {
189
- t .Logf ("2nd half Block %d\n " , block .Round ())
190
- if eligible2 .Contains (block .Proposer ()) {
191
- lucky .Add (block .Proposer ())
192
- }
190
+ t .Logf ("2nd half Block %d, proposed by %s\n " , block .Round (), block .Proposer ())
193
191
for i , txn := range block .Payset {
194
192
hb := txn .Txn .HeartbeatTxnFields
195
193
t .Logf ("Heartbeat txn %v in position %d round %d\n " , hb , i , block .Round ())
@@ -199,6 +197,9 @@ func testChallengesOnce(t *testing.T, a *require.Assertions) (retry bool) {
199
197
beated .Add (hb .HbAddress )
200
198
a .NotContains (lucky , hb .HbAddress , "unneeded %s" , hb .HbAddress ) // we should not see a heartbeat from an account that proposed
201
199
}
200
+ if eligible2 .Contains (block .Proposer ()) {
201
+ lucky .Add (block .Proposer ())
202
+ }
202
203
a .Empty (block .AbsentParticipationAccounts ) // nobody suspended during grace
203
204
})
204
205
a .Equal (eligible2 , util .Union (beated , lucky ))
0 commit comments