-
Notifications
You must be signed in to change notification settings - Fork 838
GetValidators e2e benchmarks #1551
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
Closed
abi87
wants to merge
15
commits into
some_warp_benchmarks
from
modded_platformVM_for_validators_set_benchmarks
Closed
Changes from all commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
7fe18e9
dropped validators set cache to bench worst case scenario
abi87 8d7bc2e
wip: added fake subnet validators for benchmarks
abi87 639c636
reverted fake subnet
abi87 7f4e109
nit
abi87 8bd92da
fix following code review
abi87 1d33545
Merge branch 'some_warp_benchmarks' into modded_platformVM_for_valida…
abi87 6cb9657
fixed validators set metrics£
abi87 ebe599d
Merge branch 'modded_platformVM_for_validators_set_benchmarks' of git…
abi87 00627b4
cleanup
abi87 0f65e6e
reverted faulty change
abi87 bcf9417
Merge branch 'some_warp_benchmarks' into modded_platformVM_for_valida…
abi87 9f07519
Merge branch 'some_warp_benchmarks' into modded_platformVM_for_valida…
abi87 8772917
added script to poll getValidatorsAt depths
abi87 7bbd292
the script
abi87 b6cddd3
added metric
abi87 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,62 @@ | ||
| #! /bin/bash | ||
| set -eu | ||
|
|
||
| # TODO: | ||
| # Just make a bunch of calls, recording timestamp and height called | ||
| # Calls may be alternated among height and getValidatorsAt | ||
| # All the other data can be retrieved from prometheus and processed by hand. | ||
|
|
||
| avalanche_node_addr="127.0.0.1:9650/" | ||
| p_chain_endpoint=$avalanche_node_addr"ext/bc/P" | ||
|
|
||
| temp_height_file="/tmp/warp_height_file.json" | ||
| cat > "${temp_height_file}" << EOF | ||
| { | ||
| "jsonrpc": "2.0", | ||
| "method": "platform.getHeight", | ||
| "params": {}, | ||
| "id": 1 | ||
| } | ||
| EOF | ||
|
|
||
| timestamp=$(date +%s) | ||
| echo $timestamp "START" | ||
|
|
||
| for depth in {10000..1..50}; do | ||
| height_call=$(curl $p_chain_endpoint -X POST -H 'content-type:application/json' --silent --data "@${temp_height_file}") | ||
| if [ $? -ne 0 ]; then | ||
| echo "height call errored. Exiting" | ||
| exit 1 | ||
| fi | ||
|
|
||
| current_height=$(echo $height_call | jq -r '."result"."height"') | ||
| timestamp=$(date +%s) | ||
| echo $timestamp "current height" $current_height | ||
|
|
||
| polled_height=$(($current_height - depth)) | ||
|
|
||
| temp_validatorsAt_file="/tmp/warp_validators_at_file.json" | ||
| cat > "${temp_validatorsAt_file}" << EOF | ||
| { | ||
| "jsonrpc": "2.0", | ||
| "method": "platform.getValidatorsAt", | ||
| "params": { | ||
| "height":$polled_height | ||
| }, | ||
| "id": 1 | ||
| } | ||
| EOF | ||
|
|
||
| validators_call=$(curl $p_chain_endpoint -X POST -H 'content-type:application/json' --silent --data "@${temp_validatorsAt_file}") | ||
| if [ $? -ne 0 ]; then | ||
| echo "validators at call errored. Exiting" | ||
| exit 1 | ||
| fi | ||
| timestamp=$(date +%s) | ||
| echo $timestamp "validtrs height" $polled_height | ||
|
|
||
| sleep 30 | ||
| done | ||
|
|
||
| timestamp=$(date +%s) | ||
| echo $timestamp "DONE" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.