-
Notifications
You must be signed in to change notification settings - Fork 166
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
[Consensus] Log verifier ids for missing approvals #1324
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,7 @@ package tracker | |
import ( | ||
"encoding/hex" | ||
"encoding/json" | ||
"fmt" | ||
"time" | ||
|
||
"github.com/rs/zerolog" | ||
|
@@ -170,7 +171,24 @@ func (st *SealingObservation) Complete() { | |
|
||
// dump observation to Logger | ||
observation = observation.Int64("duration_ms", time.Since(st.startTime).Milliseconds()) | ||
observation.Msg("sealing observation") | ||
reason := st.UnsealedReason() | ||
observation.Msgf("sealing observation, unsealed reason: %v", reason) | ||
} | ||
|
||
func (st *SealingObservation) UnsealedReason() string { | ||
if st.finalizedBlock == st.latestSealedBlock { | ||
return "all finalized blocks have been sealed" | ||
} | ||
|
||
unsealedHeight := st.latestSealedBlock.Height + 1 | ||
if len(st.records) == 0 { | ||
return fmt.Sprintf("no result found for next unsealed block at height: %v", unsealedHeight) | ||
} | ||
|
||
return fmt.Sprintf("unsealed block at height %v has been executed, the result has been incorporated on %v fork(s), "+ | ||
"but no result has received enough approvals, check the chunks_with_insufficient_approvals field for more details", | ||
len(st.records), | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
unsealedHeight) | ||
} | ||
|
||
// latestFinalizedSealInfo returns a json string representation with the most | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So far, the sealing observation is structured as a nested json, which allows to post-process the message. I feel, we are flattening the data here, which unnecessarily removes structure:
chunk_index
,IDs of verifiers from which we miss approvals
)I feel it would be beneficial to preserve this structure in the json: