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

[Consensus] add hotstuff view to ping route #1462

Merged
merged 1 commit into from Oct 8, 2021

Conversation

zhangchiqing
Copy link
Member

// NodeInfo tracks the software version and sealed height of a node
NodeInfo(node *flow.Identity, nodeInfo string, version string, sealedHeight uint64)
// NodeInfo tracks the software version, sealed height and hotstuff view of a node
NodeInfo(node *flow.Identity, nodeInfo string, version string, sealedHeight uint64, hotstuffChain string, hotstuffCurView uint64)
Copy link
Member

Choose a reason for hiding this comment

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

It doesn't seem like hotstuffChain argument is included in any of the implementations (eg here)

@@ -8,4 +8,5 @@ message PingRequest {
message PingResponse {
string version = 1; // node software version
uint64 blockHeight = 2; // latest sealed block height
uint64 hotstuffView = 3; // latest hotstuff cur view
Copy link
Member

Choose a reason for hiding this comment

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

Do we need to regenerate pb.go files as well?

Copy link
Member Author

Choose a reason for hiding this comment

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

updated

Comment on lines 3 to 4
# go get github.com/gogo/protobuf/protoc-gen-gofast
# brew install protobuf
Copy link
Member

Choose a reason for hiding this comment

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

We should be able to put at least the go get under make install-tools.

I don't think we assume people have brew installed anywhere else though, so adding that could be breaking.

Copy link
Contributor

Choose a reason for hiding this comment

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

Here's what grpc recommends for protoc installation:
https://grpc.io/docs/protoc-installation/

@zhangchiqing
Copy link
Member Author

Tested with localnet and it worked.
image

Comment on lines -50 to -51
docker-compose -f docker-compose.metrics.yml up -d --remove-orphans
DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1 docker-compose -f docker-compose.nodes.yml up --remove-orphans --build -d
Copy link
Member Author

Choose a reason for hiding this comment

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

This is useful, however, I had to remove it, because the --remove-orphans will stop the containers created by docker-compose -f docker-compose.metrics.yml

pc.hotstuffCurView.With(prometheus.Labels{
LabelNodeID: node.NodeID.String(),
LabelNodeAddress: node.Address,
LabelNodeRole: node.Role.String(),
Copy link
Member

Choose a reason for hiding this comment

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

is it worth only reporting if it's collection/consensus? so we don't have a ton of zeros in our metrics?

Copy link
Member Author

Choose a reason for hiding this comment

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

Already did. Only consensus will report this metrics.
I was thinking to report view for collection in the future, but it's a bit more complex, because we would need to also report chain ID.

For now, I think consensus hotstuff view is enough.

Copy link
Member Author

Choose a reason for hiding this comment

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

I could remove this label as well

@codecov-commenter
Copy link

codecov-commenter commented Oct 8, 2021

Codecov Report

Merging #1462 (4c3798d) into master (adcc2f3) will decrease coverage by 0.00%.
The diff coverage is 25.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1462      +/-   ##
==========================================
- Coverage   55.30%   55.29%   -0.01%     
==========================================
  Files         516      516              
  Lines       32168    32181      +13     
==========================================
+ Hits        17791    17795       +4     
- Misses      11990    11999       +9     
  Partials     2387     2387              
Flag Coverage Δ
unittests 55.29% <25.00%> (-0.01%) ⬇️

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

Impacted Files Coverage Δ
cmd/scaffold.go 0.91% <0.00%> (-0.02%) ⬇️
engine/access/ping/engine.go 0.00% <0.00%> (ø)
network/p2p/ping.go 51.06% <50.00%> (-1.21%) ⬇️
engine/collection/synchronization/engine.go 63.97% <0.00%> (+1.07%) ⬆️

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 adcc2f3...4c3798d. Read the comment docs.

// NodeInfo tracks the software version and sealed height of a node
NodeInfo(node *flow.Identity, nodeInfo string, version string, sealedHeight uint64)
// NodeInfo tracks the software version, sealed height and hotstuff view of a node
NodeInfo(node *flow.Identity, nodeInfo string, version string, sealedHeight uint64, hotstuffCurView uint64)
Copy link
Contributor

Choose a reason for hiding this comment

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

@zhangchiqing - will all node type report this? or only consensus nodes

Copy link
Member Author

Choose a reason for hiding this comment

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

Only Consensus nodes will report metrics. See this screenshot

See the logic control here

@zhangchiqing
Copy link
Member Author

bors merge

@bors
Copy link
Contributor

bors bot commented Oct 8, 2021

Canceled.

@zhangchiqing
Copy link
Member Author

bors merge

@zhangchiqing
Copy link
Member Author

    core_rapid_test.go:157: 
        	Error Trace:	core_rapid_test.go:157
        	            				statemachine.go:78
        	            				engine.go:276
        	            				engine.go:158
        	            				engine.go:94
        	            				core_rapid_test.go:174
        	Error:      	Should be true
        	Test:       	TestRapidSync
        	Messages:   	Height 861ff6f1 was expected to be Received (or filled through a same-height block) and is Queued

was flakey

@bors
Copy link
Contributor

bors bot commented Oct 8, 2021

@bors bors bot merged commit 08b9420 into master Oct 8, 2021
@bors bors bot deleted the leo/add-hotstuff-view-to-ping branch October 8, 2021 22:45
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

7 participants