@@ -28,6 +28,8 @@ public class TendermintReplica extends LeaderBasedProtocolReplica {
28
28
// Sequence: the current sequence within the height, where multiple sequences might be needed to finalize a block
29
29
private long sequence ;
30
30
31
+ private long totalSequences ;
32
+
31
33
// Step: the current step within the sequence (PROPOSE, PREVOTE, PRECOMMIT)
32
34
private Step step ;
33
35
@@ -68,6 +70,7 @@ public TendermintReplica(String nodeId, SortedSet<String> nodeIds, Scenario scen
68
70
super (nodeId , scenario , new TotalOrderCommitLog ());
69
71
this .height = 0 ;
70
72
this .sequence = 0 ;
73
+ this .totalSequences = 0 ;
71
74
this .step = Step .PROPOSE ;
72
75
this .lockedValue = null ;
73
76
this .lockedSequence = -1 ;
@@ -293,6 +296,7 @@ private void executeProposalPrecommitRule(Block block) {
293
296
//53: reset lockedRoundp, lockedV aluep, validRoundp and validV aluep to initial values and empty message log
294
297
//54: StartRound(0)
295
298
commitOperation (block );
299
+ this .totalSequences += this .sequence + 1 ;
296
300
ReplyMessage replyMessage = new ReplyMessage (
297
301
this .height ,
298
302
block .getRequestMessage ().getTimestamp (),
@@ -315,7 +319,7 @@ protected void broadcastProposal(long height, long sequence, Block proposal, lon
315
319
if (hasBroadcasted .contains (Pair .of (height , sequence ))) {
316
320
return ;
317
321
}
318
- ProposalMessage proposalMessage = new ProposalMessage (getId (), height , sequence , validSequence , proposal );
322
+ ProposalMessage proposalMessage = new ProposalMessage (getId (), height , sequence , totalSequences , validSequence , proposal );
319
323
broadcastMessageIncludingSelf (proposalMessage );
320
324
hasBroadcasted .add (Pair .of (height , sequence ));
321
325
@@ -488,7 +492,7 @@ private void broadcastGossipPrevote(PrevoteMessage prevoteMessage) {
488
492
489
493
private void broadcastPrevote (long height , long sequence , Block block ) {
490
494
// messageLog.sentPrevote();
491
- PrevoteMessage prevoteMessage = new PrevoteMessage (height , sequence , this .getId (), block );
495
+ PrevoteMessage prevoteMessage = new PrevoteMessage (height , sequence , totalSequences , this .getId (), block );
492
496
broadcastMessageIncludingSelf (prevoteMessage );
493
497
}
494
498
@@ -609,7 +613,7 @@ private void broadcastGossipPrecommit(PrecommitMessage precommitMessage) {
609
613
}
610
614
611
615
protected void broadcastPrecommit (long height , long sequence , Block block ) {
612
- PrecommitMessage precommitMessage = new PrecommitMessage (height , sequence , this .getId (), block );
616
+ PrecommitMessage precommitMessage = new PrecommitMessage (height , sequence , totalSequences , this .getId (), block );
613
617
broadcastMessageIncludingSelf (precommitMessage );
614
618
}
615
619
0 commit comments