Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
leighmcculloch committed Nov 3, 2023
1 parent bd5a81a commit e186fb9
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 16 deletions.
10 changes: 5 additions & 5 deletions local/core/etc/config-settings/unlimited.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
{
"updated_entry": [
{
"contract_max_size_bytes": 65536
"contract_max_size_bytes": 4294967295
},
{
"contract_compute_v0": {
"ledger_max_instructions": 9223372036854775807,
"tx_max_instructions": 9223372036854775807,
"ledger_max_instructions": 2305843009213693951,
"tx_max_instructions": 2305843009213693951,
"fee_rate_per_instructions_increment": 100,
"tx_memory_limit": 4294967295
}
Expand Down Expand Up @@ -340,7 +340,7 @@
"contract_data_key_size_bytes": 300
},
{
"contract_data_entry_size_bytes": 65536
"contract_data_entry_size_bytes": 4294967295
},
{
"state_expiration": {
Expand All @@ -357,7 +357,7 @@
},
{
"contract_execution_lanes": {
"ledger_max_tx_count": 42949672950
"ledger_max_tx_count": 4294967295
}
}
]
Expand Down
29 changes: 18 additions & 11 deletions start
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,18 @@ export PGPORT=5432
: "${ENABLE_SOROBAN_RPC_ADMIN_ENDPOINT:=false}"
: "${ENABLE_CORE_MANUAL_CLOSE:=false}"
: "${CORE_SUPPORTS_ENABLE_SOROBAN_DIAGNOSTIC_EVENTS:=false}"
: "${LIMITS:=common}"

QUICKSTART_INITIALIZED=false
CURRENT_POSTGRES_PID=""

function main() {
process_args $*
validate_before_start
start
}

function validate_before_start() {
if [ "$NETWORK" != "local" ] && [ "$NETWORK" != "futurenet" ] && [ "$NETWORK" != "testnet" ] && [ "$ENABLE_SOROBAN_RPC" = "true" ]; then
echo "--enable-soroban-rpc usage only supported on local/futurenet/testnet networks" >&2
exit 1
Expand All @@ -53,11 +59,17 @@ function main() {
if [ "$NETWORK" = "local" ] && [ "$DISABLE_SOROBAN_DIAGNOSTIC_EVENTS" = "false" ]; then
ENABLE_SOROBAN_DIAGNOSTIC_EVENTS=true
fi
if [ "$NETWORK" != "local" ] && [ -n "$LIMITS" ]; then
echo "--limits is only supported with the local network" >&2
exit 1
}

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

function start() {
Expand All @@ -79,6 +91,7 @@ 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 @@ -504,20 +517,14 @@ function upgrade_local() {
# Upgrade local network's soroban config to match testnet
if [ $PROTOCOL_VERSION -ge 20 ]; then
echo "upgrades: soroban config '$LIMITS' limits"
local config_dir="$COREHOME/etc/config-settings"
local config_path="$config_dir/$LIMITS.json"
if [ ! -f "$config_path" ]; then
echo "upgrades: soroban config, unknown limits specified: must be one of $(ls "$config_dir")"
exit 1
fi
# Generate txs for installing, deploying and executing the contract that
# uploads a new config. Use the network root account to submit the txs.
echo $NETWORK_ROOT_SECRET_KEY \
| stellar-core get-settings-upgrade-txs \
"$NETWORK_ROOT_ACCOUNT_ID" \
0 \
"$NETWORK_PASSPHRASE" \
--json $config_path \
--json "$COREHOME/etc/config-settings/$LIMITS.json" \
--signtxs \
2>/dev/null \
| { \
Expand Down

0 comments on commit e186fb9

Please sign in to comment.