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 12, 2023
1 parent d87c438 commit 87fac85
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
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
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
Expand Up @@ -330,6 +330,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 87fac85

Please sign in to comment.