Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

go/worker/common: Display additional information in the liveness status #5402

Merged
merged 1 commit into from Oct 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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