Skip to content
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

troubleshoot the limits validation timing during start with local network #654

Closed
wants to merge 1 commit into from
Closed
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
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
Copy link
Contributor Author

@sreuland sreuland Dec 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this appears to be running too soon since it references PROTOCOL_VERSION, as start has not finished conditionally setting PROTOCOL_VERSION if it's not set and local network, in that case PROTOCOL_VERSION is set later after core has been started dynamically to the default version that the core runtime reports in upgrade_local

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
Loading