-
Notifications
You must be signed in to change notification settings - Fork 30
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
build(fee): sn_resources depend on resource bounds signature
- Loading branch information
1 parent
3930325
commit f61bc65
Showing
10 changed files
with
196 additions
and
53 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -75,6 +75,24 @@ jobs: | |
target/release/papyrus_node --base_layer.node_url ${{ secrets.CI_BASE_LAYER_NODE_URL }} | ||
& sleep 30 ; kill $! | ||
p2p-sync-e2e-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: dtolnay/rust-toolchain@stable | ||
- uses: Swatinem/rust-cache@v2 | ||
- uses: Noelware/[email protected] | ||
with: | ||
version: ${{env.PROTOC_VERSION}} | ||
|
||
- name: Build node | ||
run: | | ||
cargo build -r -p papyrus_node | ||
- name: Run p2p sync end-to-end test | ||
run: | | ||
scripts/papyrus/p2p_sync_e2e_test/main.sh ${{ secrets.CI_BASE_LAYER_NODE_URL }} | ||
integration-test: | ||
runs-on: starkware-ubuntu-latest-medium | ||
steps: | ||
|
This file contains 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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains 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 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 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 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 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,12 @@ | ||
{ | ||
"sync.#is_none": true, | ||
"network.#is_none": false, | ||
"p2p_sync.#is_none": false, | ||
"storage.db_config.path_prefix": "./scripts/papyrus/p2p_sync_e2e_test/data_client", | ||
"monitoring_gateway.server_address": "127.0.0.1:8082", | ||
"collect_metrics": true, | ||
"rpc.server_address": "127.0.0.1:8083", | ||
"network.tcp_port": 10003, | ||
"network.bootstrap_peer_multiaddr.#is_none": false, | ||
"network.bootstrap_peer_multiaddr": "/ip4/127.0.0.1/tcp/10000/p2p/12D3KooWDFYi71juk6dYWo3UDvqs5gAzGDc124LSvcR5d187Tdvi" | ||
} |
This file contains 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,82 @@ | ||
#!/bin/bash | ||
|
||
MONITORING_METRICS_URL="http://localhost:8082/monitoring/metrics" | ||
SLEEP_DURATION_SECONDS=30 | ||
|
||
RED='\033[1;31m' | ||
GREEN='\033[0;32m' | ||
GRAY='\033[0;37m' | ||
NO_COLOR='\033[0m' | ||
|
||
run_nodes_and_process_output() { | ||
local client_command=$1 | ||
local server_command=$2 | ||
|
||
eval "$client_command" & | ||
client_pid=$! | ||
|
||
eval "$server_command" & | ||
server_pid=$! | ||
|
||
echo "Client PID: $client_pid" | ||
echo "Server PID: $server_pid" | ||
|
||
sleep $SLEEP_DURATION_SECONDS | ||
validate_marker papyrus_state_marker | ||
cleanup | ||
echo -e "${GREEN}Test passed successfully.$NO_COLOR" | ||
} | ||
|
||
# Extract the value of the given marker from the monitoring gateway and check it's big enough | ||
validate_marker() { | ||
local marker_name=$1 | ||
|
||
# Run curl and check the state marker | ||
curl_output=$(curl -s -X GET "$MONITORING_METRICS_URL") | ||
|
||
# Extract the numeric value after marker_name | ||
marker_value=$(echo "$curl_output" | grep -oP "$marker_name"' \K\d+') | ||
|
||
if [[ -z "$marker_value" ]]; then | ||
cleanup | ||
echo -e "${RED}Failed to extract $marker_name value from monitoring output. Test failed.$NO_COLOR" | ||
exit 1 | ||
fi | ||
|
||
if (( marker_value < 10 )); then | ||
cleanup | ||
echo -e "${RED}$marker_name is $marker_value which is less than 10. Test failed.$NO_COLOR" | ||
exit 1 | ||
fi | ||
echo -e "${GREEN}$marker_name is $marker_value which is valid.$NO_COLOR" | ||
} | ||
|
||
|
||
|
||
cleanup() { | ||
echo -e "${GRAY}######## Cleaning up... You'll might see an ERROR on the 2nd process that is killed because the connection was closed and when killing it that there's no such process. This is ok. ########$NO_COLOR" | ||
pgrep -P $$ | ||
pkill -P $client_pid | ||
pkill -P $server_pid | ||
kill -KILL "$client_pid" | ||
kill -KILL "$server_pid" | ||
} | ||
|
||
main() { | ||
if [[ $# -ne 1 ]]; then | ||
echo "Usage: $0 <BASE_LAYER_NODE_URL>" | ||
exit 1 | ||
fi | ||
|
||
base_layer_node_url=$1 | ||
|
||
rm -rf scripts/papyrus/p2p_sync_e2e_test/data_client scripts/papyrus/p2p_sync_e2e_test/data_server | ||
mkdir scripts/papyrus/p2p_sync_e2e_test/data_client scripts/papyrus/p2p_sync_e2e_test/data_server | ||
|
||
client_node_command="target/release/papyrus_node --base_layer.node_url $base_layer_node_url --config_file scripts/papyrus/p2p_sync_e2e_test/client_node_config.json" | ||
server_node_command="target/release/papyrus_node --base_layer.node_url $base_layer_node_url --config_file scripts/papyrus/p2p_sync_e2e_test/server_node_config.json" | ||
|
||
run_nodes_and_process_output "$client_node_command" "$server_node_command" | ||
} | ||
|
||
main "$@" |
This file contains 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,6 @@ | ||
{ | ||
"central.http_headers": "X-Throttling-Bypass:dlaxszinf1zggax2xfbqeujanj603hhry8vli3vma34j", | ||
"network.#is_none": false, | ||
"storage.db_config.path_prefix": "./scripts/papyrus/p2p_sync_e2e_test/data_server", | ||
"network.secret_key": "0xabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcdabcd" | ||
} |