-
Notifications
You must be signed in to change notification settings - Fork 117
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 @@ | ||
Show the progress of the history reindex in oasis control status | ||
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -189,6 +189,9 @@ type RuntimeStatus struct { | |
// Storage contains the storage worker status in case this node is a storage node. | ||
Storage *storageWorker.Status `json:"storage,omitempty"` | ||
|
||
// BlockHistoryLastConsensusHeight is last consensus height seen by block history. | ||
BlockHistoryLastConsensusHeight int64 `json:"block_history_last_consensus_height"` | ||
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. Quite long field name. I would try to find a shorter name or move it under history. 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, we should shorten it. 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. Now that I think the cleanest way would probably be to show last round and height as seen by the block history right below "latest_round": 10160924,
"latest_hash": "85867c19bd6ad43521432e187962e3bb19a9731c79cd64f195821bfd90bd7b24",
"latest_time": "2025-01-31T11:08:05+01:00",
"latest_state_root": {
"ns": "000000000000000000000000000000000000000000000000a6d1e3ebf60dff6c",
"version": 10160924,
"root_type": 1,
"hash": "a914f8c8baf05a47757c1d7f7caecebdf614c8b3d1e20aa33d6855ec96a50ba1"
},
"genesis_round": 2995927,
"genesis_hash": "c9f3ca654531b775d944c85e1f00e76944aaf5de1902acfa082ff76e852dba5e",
"last_retained_round": 10145927,
"last_retained_hash": "fad686c7eb077ec1a1a5a1ba1c27027a3788b003c94130e78c7dfb25a1d0e8cd",
// other fields
"storage": {
"status": "syncing rounds",
"last_finalized_round": 10160923
},
"history": {
"last_round": 10160923,
"last_height": 25058099
},
I am thinking could we move |
||
|
||
martintomazic marked this conversation as resolved.
Show resolved
Hide resolved
|
||
// Provisioner is the name of the runtime provisioner. | ||
Provisioner string `json:"provisioner,omitempty"` | ||
} | ||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -343,6 +343,17 @@ | |||||
} | ||||||
} | ||||||
|
||||||
// Fetch last consensus height seen by block history. | ||||||
height, err := rt.History().LastConsensusHeight() | ||||||
Comment on lines
+346
to
+347
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.
Notice I report consensus height instead of runtime round. I would argue this is also more appropriate, since reindex iterates over the block height... 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. Can we show the last height and the last 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. I agree, all of these would be useful. |
||||||
if err == nil { | ||||||
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
|
||||||
n.logger.Error("failed to retrieve last consensus height seen by block history", | ||||||
"err", err, | ||||||
"id", rt.ID(), | ||||||
) | ||||||
} else { | ||||||
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. [nit] I'm not a big fan of Maybe this code could be moved up, where we handle history. |
||||||
status.BlockHistoryLastConsensusHeight = height | ||||||
} | ||||||
|
||||||
// Fetch provisioner type. | ||||||
status.Provisioner = "none" | ||||||
if provisioner := rt.HostProvisioner(); provisioner != nil { | ||||||
|
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.
We usually start changelog and git messages with a prefix, in this case
go/oasis_node/cmd
orgo/oasis_node
would be fine.After the title we could explain which field was added and what it shows. See previous logs for examples.