-
Notifications
You must be signed in to change notification settings - Fork 2.7k
[Feature] REST endpoint to query connected validators #4066
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
base: staging
Are you sure you want to change the base?
Conversation
c5bbabf to
fa7a220
Compare
fa7a220 to
21740c3
Compare
1d84123 to
fd760b3
Compare
fd760b3 to
eb0850e
Compare
esren0x
left a comment
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.
Noticed README also has the list of routes, but not these new ones.
The new ones from a structure POV look good, just noticed a few extra bits when reviewing. And not sure if you guys usually add integration tests for these?
| elif (( result < min_peers )); then | ||
| log "Node #${node_index} (port=$port) has $result BFT connections, expected at least $min_peers. Will wait and retry..." | ||
| else | ||
| return 0 |
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.
I might not have full context, but looks like this return would potentially show a "sucess" even tho it failed. By logging and then returning 0 it would appear to have worked and not get tot he message at the end for
log "❌ BFT connections did not reach $min_peers within 5 minutes."
|
|
||
| echo "❌ Benchmark failed! Validators did not sync within 30 minutes." | ||
| log "❌ Benchmark failed! Validators did not sync within 30 minutes." | ||
| print_client_logs "$log_dir" "$num_validators" "$num_nodes" |
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.
| print_client_logs "$log_dir" "$num_validators" "$num_nodes" | |
| print_validator_logs "$log_dir" $((num_nodes+1)) 0 |
Motivation
Currently, one can query the connected router peers (through
{network}/peers/..) but not validators connected through the gateway.This PR adds a new set of endpoints
{network}/connection/bft/..and{network}/connections/p2p/... The former allows querying connected validators, while the latter is just an alias for the{network}/peers/..endpoint.Test Plan
The new endpoint is used in the sync benchmark to test that validators are fully connected to each other. Successfully running that benchmark validates that the endpoint works as expected.
Backwards compatibility
Initially, I hoped we could just include the validators in the existing
peersendpoint, but I added the new endpoints to avoid breaking existing functionality.Benchmark fixes
Recent changes on staging broke the benchmark workflow. This PR also contains a commit that fixes the workflow.