-
Notifications
You must be signed in to change notification settings - Fork 115
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/control: Show last consensus height seen by block history #6013
base: master
Are you sure you want to change the base?
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 | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,8 @@ | ||||||
go/oasis_node: Add runtime block history status message | ||||||
|
||||||
A new field `history` has been added to the `oasis-node control status` | ||||||
output under the runtime status section. This field displays the latest round | ||||||
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.
Suggested change
|
||||||
and consensus height of the latest runtime block seen by the block history. | ||||||
|
||||||
This is useful for the node operators, so that they can estimate the history | ||||||
reindex speed. |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -192,6 +192,9 @@ type RuntimeStatus struct { | |
// Storage contains the storage worker status in case this node is a storage node. | ||
Storage *storageWorker.Status `json:"storage,omitempty"` | ||
|
||
// History is status of block history. | ||
History *HistoryStatus `json:"history,omitempty"` | ||
|
||
// Provisioner is the name of the runtime provisioner. | ||
Provisioner string `json:"provisioner,omitempty"` | ||
|
||
|
@@ -230,6 +233,14 @@ type SeedStatus struct { | |
NodePeers []string `json:"node_peers"` | ||
} | ||
|
||
// HistoryStatus is the status as observed by the block history. | ||
type HistoryStatus struct { | ||
// LastRound is the round of the latest block. | ||
LastRound uint64 `json:"last_round"` | ||
// LastHeight is the consensus height of the latest block. | ||
LastHeight int64 `json:"last_height"` | ||
} | ||
|
||
Comment on lines
+236
to
+243
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. Do we also want a status like we have for If so this logic would have to be moved to consensus roothash, or we add a method to query it. Albeit, feels weird adding this functionality to 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.
Yes, I would like to have percentages (and maybe optional status). From you example, I would like to have at least 3 fields, two that say which range is Having field |
||
// DebugModuleName is the module name for the debug controller service. | ||
const DebugModuleName = "control/debug" | ||
|
||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -48,6 +48,8 @@ type BlockHistory interface { | |||||
|
||||||
// LastConsensusHeight returns the last consensus height which was seen | ||||||
// by block history. | ||||||
// | ||||||
// This method can return height for block not yet synced to storage. | ||||||
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. This whole comment is a bit confusing, as the first part says seen while the second says that the block (which one, consensus or runtime?) doesn't need to be synced. Can we change to
Suggested change
|
||||||
LastConsensusHeight() (int64, error) | ||||||
|
||||||
// GetCommittedBlock returns the committed block at a specific round. | ||||||
|
@@ -57,6 +59,7 @@ type BlockHistory interface { | |||||
GetCommittedBlock(ctx context.Context, round uint64) (*block.Block, error) | ||||||
|
||||||
// GetBlock returns the block at a specific round. | ||||||
// | ||||||
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. You should be consistent and add new line in all places or nowhere. |
||||||
// Passing the special value `RoundLatest` will return the latest block. | ||||||
// | ||||||
// This method returns blocks that are both committed and synced to storage. | ||||||
|
@@ -65,13 +68,19 @@ type BlockHistory interface { | |||||
// GetAnnotatedBlock returns the annotated block at a specific round. | ||||||
// | ||||||
// Passing the special value `RoundLatest` will return the latest annotated block. | ||||||
// | ||||||
// This method returns blocks that are both committed and synced to storage. | ||||||
GetAnnotatedBlock(ctx context.Context, round uint64) (*AnnotatedBlock, error) | ||||||
|
||||||
// GetEarliestBlock returns the earliest known block. | ||||||
// | ||||||
// This method can return blocks not yet synced to storage. | ||||||
GetEarliestBlock(ctx context.Context) (*block.Block, error) | ||||||
|
||||||
// GetRoundResults returns the round results for the given round. | ||||||
// | ||||||
// Passing the special value `RoundLatest` will return results for the latest round. | ||||||
// | ||||||
// This method can return round results for block not yet synced to storage. | ||||||
GetRoundResults(ctx context.Context, round uint64) (*RoundResults, error) | ||||||
} |
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.