Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions .ci/bench_bft_sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ trap child_exit_handler CHLD
# Define a trap handler that prints a message when an error occurs
trap 'echo "⛔️ Error in $BASH_SOURCE at line $LINENO: \"$BASH_COMMAND\" failed (exit $?)"' ERR

# Shared flags betwen all nodes
# Shared flags between all nodes
common_flags=(
--nobanner --noupdater --nodisplay \
"--network=$network_id"
Expand Down Expand Up @@ -96,10 +96,26 @@ SECONDS=0
# exit 1
# fi
#done

connect_time=$SECONDS
echo "ℹ️ Nodes are fully connected (took $connect_time secs). Starting block sync measurement."

# Ensure the first node actually has the ledger snapshot.
# This should succeed instantly in most cases
SECONDS=0
has_blocks=false
while (( SECONDS < 30 )); do
if check_heights 0 1 $min_height "$network_name" 0 false; then
has_blocks=true
break
fi
done

if ! $has_blocks; then
echo "Node #0 has not reached the expected height. Maybe the ledger snapshot is corrupted or outdated?"
exit 1
fi

# Check heights periodically with a timeout
SECONDS=0
while (( SECONDS < max_wait )); do
Expand Down
2 changes: 1 addition & 1 deletion .ci/bench_p2p_sync.sh
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ echo "ℹ️ Nodes are fully connected (took $connect_time secs). Starting block
SECONDS=0
has_blocks=false
while (( SECONDS < 30 )); do
if check_heights 0 1 $min_height "$network_name" "0"; then
if check_heights 0 1 $min_height "$network_name" 0 false; then
has_blocks=true
break
fi
Expand Down
2 changes: 1 addition & 1 deletion .ci/devnet_ci.sh
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ trap child_exit_handler CHLD
# Define a trap handler that prints a message when an error occurs
trap 'echo "⛔️ Error in $BASH_SOURCE at line $LINENO: \"$BASH_COMMAND\" failed (exit $?)"' ERR

# Flags used by all ndoes
# Flags used by all nodes
common_flags=(
--nodisplay --nobanner --noupdater "--network=$network_id" --verbosity=1
--allow-external-peers "--dev-num-validators=$total_validators"
Expand Down
8 changes: 7 additions & 1 deletion .ci/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,10 @@ function check_heights() {
local min_height=$3
local network_name=$4
local elapsed=$5
local print_success=$6

# Show the success message by default
: "${print_success:=true}"

local all_reached=true
local highest_height=0
Expand All @@ -63,7 +67,9 @@ function check_heights() {
done

if $all_reached; then
echo "✅ SUCCESS: All nodes reached minimum height of $min_height"
if $print_success; then
echo "✅ SUCCESS: All nodes reached minimum height of $min_height"
fi
return 0
else
if (( elapsed > 0 && ((elapsed % 60) == 0) )); then
Expand Down
2 changes: 1 addition & 1 deletion .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ jobs:

node-router:
executor: rust-docker
resource_class: << pipeline.parameters.large >>
resource_class: << pipeline.parameters.xlarge >>
steps:
- run_serial:
workspace_member: node/router
Expand Down
Loading