Skip to content

Commit

Permalink
go/worker/common: Display additional information in the liveness status
Browse files Browse the repository at this point in the history
  • Loading branch information
peternose committed Oct 20, 2023
1 parent 7bc5542 commit 3d71e90
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 2 deletions.
Empty file added .changelog/5402.trivial.md
Empty file.
4 changes: 2 additions & 2 deletions go/roothash/api/liveness.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,14 @@ type LivenessStatistics struct {
LiveRounds []uint64 `json:"good_rounds"`

// FinalizedProposals is a list that records the number of finalized rounds when a node
// acted as a proposer.
// acted as a proposer with the highest rank.
//
// The list is ordered according to the committee arrangement (i.e., the counter at index i
// holds the value for the node at index i in the committee).
FinalizedProposals []uint64 `json:"finalized_proposals"`

// MissedProposals is a list that records the number of failed rounds when a node
// acted as a proposer.
// acted as a proposer with the highest rank.
//
// The list is ordered according to the committee arrangement (i.e., the counter at index i
// holds the value for the node at index i in the committee).
Expand Down
8 changes: 8 additions & 0 deletions go/worker/common/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -144,4 +144,12 @@ type LivenessStatus struct {

// LiveRounds is the number of rounds in which the node positively contributed.
LiveRounds uint64 `json:"live_rounds"`

// FinalizedProposals is the number of finalized rounds when a node acted as a proposer
// with the highest rank.
FinalizedProposals uint64 `json:"finalized_proposals"`

// MissedProposals is the number of failed rounds when a node acted as a proposer
// with the highest rank.
MissedProposals uint64 `json:"missed_proposals"`
}
2 changes: 2 additions & 0 deletions go/worker/common/committee/node.go
Original file line number Diff line number Diff line change
Expand Up @@ -320,6 +320,8 @@ func (n *Node) GetStatus() (*api.Status, error) {

for _, index := range cmte.Indices {
status.Liveness.LiveRounds += rs.LivenessStatistics.LiveRounds[index]
status.Liveness.FinalizedProposals += rs.LivenessStatistics.FinalizedProposals[index]
status.Liveness.MissedProposals += rs.LivenessStatistics.MissedProposals[index]
}
}
}
Expand Down

0 comments on commit 3d71e90

Please sign in to comment.