Skip to content

Commit

Permalink
fix the limits validation timing during start on local network
Browse files Browse the repository at this point in the history
  • Loading branch information
sreuland committed Dec 17, 2024
1 parent 8ba15a3 commit f3e4377
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions start
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,16 @@ function validate_before_start() {
fi
}

function validate_after_copy_defaults() {
function validate_limits() {
if [ "$NETWORK" = "local" ] && [ "$LIMITS" != "default" ]; then
local config_dir="$COREHOME/etc/config-settings/p$PROTOCOL_VERSION"
local config_path="$config_dir/$LIMITS.json"
if [ ! -f "$config_path" ]; then
echo "--limits '$LIMITS' unknown: must be one of: default "$(ls $config_dir | sed 's/\.json//g')
exit 1
return false
fi
fi
return true
}

function start() {
Expand All @@ -91,7 +92,6 @@ function start() {
echo "network root account id: $NETWORK_ROOT_ACCOUNT_ID"

copy_defaults
validate_after_copy_defaults
init_db
init_stellar_core
init_horizon
Expand Down Expand Up @@ -540,6 +540,11 @@ function upgrade_local() {
return
fi

if [ ! validate_limits ] ; then
echo "!!!!! Unable to upgrade Soroban Config Settings. Stopping all services. !!!!!"
kill_supervisor
fi

# Upgrade local network's protocol version and base reserve to match pubnet/testnet
if [ $PROTOCOL_VERSION -gt 0 ]; then
echo "upgrades: protocolversion=$PROTOCOL_VERSION, basereserve=5000000"
Expand Down

0 comments on commit f3e4377

Please sign in to comment.