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

Backport HotStuff view metric fixes from v0.22-mainnet #1477

Merged
merged 8 commits into from Oct 23, 2021

Conversation

jordanschalm
Copy link
Member

@jordanschalm jordanschalm commented Oct 11, 2021

Fixes two issues with HotStuff view metric from Mainnet deployment branch:

  • HotstuffViewFun unset caused panic on non-consensus nodes
  • hotstuffCurView metric missing role label

@codecov-commenter
Copy link

codecov-commenter commented Oct 13, 2021

Codecov Report

Merging #1477 (eb38fbf) into master (41f0e35) will decrease coverage by 0.01%.
The diff coverage is 0.00%.

❗ Current head eb38fbf differs from pull request most recent head d3be0ed. Consider uploading reports for the commit d3be0ed to get more accurate results
Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1477      +/-   ##
==========================================
- Coverage   55.12%   55.11%   -0.02%     
==========================================
  Files         517      517              
  Lines       32330    32333       +3     
==========================================
- Hits        17823    17819       -4     
- Misses      12116    12122       +6     
- Partials     2391     2392       +1     
Flag Coverage Δ
unittests 55.11% <0.00%> (-0.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
cmd/scaffold.go 0.90% <0.00%> (-0.01%) ⬇️
module/component/component.go 38.83% <0.00%> (-1.95%) ⬇️
admin/command_runner.go 77.19% <0.00%> (-1.76%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 41f0e35...d3be0ed. Read the comment docs.

Copy link
Contributor

@huitseeker huitseeker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just 1 question

cmd/scaffold.go Outdated
Comment on lines 179 to 181
HotstuffViewFun: func() (uint64, error) {
return 0, nil
},
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we set it in the else of the following if, wouldn't that let us return a non-nil error for non-consensus nodes that would say "error: you're looking at something that only makes sense for a consensus node!" ...?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The result seems to be the same (see here) but putting some context in the error is definitely clearer 👍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

// we can exclude metrics from non-consensus nodes by checking if the value is above 0.
// consensus nodes will start this metrics value with 0 as well, and won't report, but that's
// OK, because their hotstuff view will quickly go up and start reporting.
if hotstuffCurView > 0 {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jordanschalm for fixing this.

I removed the label Role, because only consensus nodes will report this methods, not even collection nodes.

I've tested with localnet, and it worked.

image

I tested last time as well, I thought it worked, but actually I didn't run the localnet long enough to catch the bug.

@jordanschalm
Copy link
Member Author

bors merge

bors bot added a commit that referenced this pull request Oct 15, 2021
1477: Backport HotStuff view metric fixes from `v0.22-mainnet` r=jordanschalm a=jordanschalm

Fixes two issues with HotStuff view metric from Mainnet deployment branch:
* `HotstuffViewFun` unset caused panic on non-consensus nodes
* `hotstuffCurView` metric missing `role` label

Co-authored-by: Jordan Schalm <jordan@dapperlabs.com>
Co-authored-by: Kay-Zee <kan@axiomzen.co>
Co-authored-by: Leo Zhang (zhangchiqing) <zhangchiqing@gmail.com>
Co-authored-by: Leo Zhang <zhangchiqing@gmail.com>
@bors
Copy link
Contributor

bors bot commented Oct 15, 2021

Build failed:

@Kay-Zee
Copy link
Member

Kay-Zee commented Oct 23, 2021

bors merge

@bors
Copy link
Contributor

bors bot commented Oct 23, 2021

@bors bors bot merged commit e73e19a into master Oct 23, 2021
@bors bors bot deleted the jordan/backport-hotstuff-view-metrics-fixes branch October 23, 2021 01:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants