Skip to content

Commit

Permalink
added logic to only stored aligned votes
Browse files Browse the repository at this point in the history
  • Loading branch information
0xluk committed Mar 7, 2024
1 parent a3b52e5 commit 49bb1a6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions validator/quorum/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ func Validate(ctx context.Context, quorumVotes types.QuorumVotes, computors type
return nil, errors.New("not enough quorum votes")
}

log.Printf("Proceed to validate total quorum votes: %d\n", len(quorumVotes))
log.Printf("Proceed to filter aligned votes: %d\n", len(quorumVotes))
alignedVotes, err := getAlignedVotes(quorumVotes)
if err != nil {
return nil, errors.Wrap(err, "quorum votes are not the same between quorum computors")
return nil, errors.Wrap(err, "getting aligned votes")
}

if len(alignedVotes) < types.MinimumQuorumVotes {
Expand Down
4 changes: 2 additions & 2 deletions validator/validator.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,12 +97,12 @@ func (v *Validator) ValidateTick(ctx context.Context, tickNumber uint64) error {
log.Printf("Validated %d transactions\n", len(validTxs))

// proceed to storing tick information
err = quorum.Store(ctx, v.store, tickNumber, quorumVotes)
err = quorum.Store(ctx, v.store, tickNumber, alignedVotes)
if err != nil {
return errors.Wrap(err, "storing quorum votes")
}

log.Printf("Stored %d quorum votes\n", len(quorumVotes))
log.Printf("Stored %d quorum votes\n", len(alignedVotes))

err = tick.Store(ctx, v.store, tickNumber, tickData)
if err != nil {
Expand Down

0 comments on commit 49bb1a6

Please sign in to comment.