-
Notifications
You must be signed in to change notification settings - Fork 109
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/GetStatus: include the latest epoch #3753
Conversation
31617dd
to
cc40820
Compare
go/consensus/tendermint/full/full.go
Outdated
// Latest block epoch. | ||
epoch, err := t.beacon.GetEpoch(ctx, status.LatestHeight) | ||
if err != nil { | ||
return nil, fmt.Errorf("failed to fetch epoch: %w", err) |
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.
Could this fail when there's no committed blocks? Maybe it should only query the epoch in case if successfully fetches the block above.
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.
Nice, this was actually caught by the early query E2E test :-)
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.
😁 oh yeah i thought we'll fail early above if there's no committed block, missed the exception.
cc40820
to
a48fd73
Compare
go/consensus/tendermint/full/full.go
Outdated
@@ -788,6 +788,11 @@ func (t *fullService) GetStatus(ctx context.Context) (*consensusAPI.Status, erro | |||
status.LatestHash = latestBlk.Hash | |||
status.LatestTime = latestBlk.Time | |||
status.LatestStateRoot = latestBlk.StateRoot | |||
epoch, err := t.beacon.GetEpoch(ctx, status.LatestHeight) |
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.
Maybe add an empty line above.
a48fd73
to
351fd93
Compare
351fd93
to
9fd48ed
Compare
9fd48ed
to
74e3019
Compare
Fixes: #3743