Skip to content

Conversation

@cjonas9
Copy link
Contributor

@cjonas9 cjonas9 commented Dec 8, 2025

What

This PR adds coreSupportedProtocolVersion information to the getNetwork endpoint to provide the protocol version that core supports.

See this PR for changes made to go-stellar-sdk that must be merged before this is.

** sample query/response **
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "id": 1,
    "method": "getNetwork"
  }' | jq 
  "jsonrpc": "2.0",
  "id": 1,
  "result": {
    "passphrase": "Test SDF Network ; September 2015",
    "protocolVersion": 24,
    "coreSupportedProtocolVersion": 24
  }
}

Why

The getNetwork endpoint provides less information than what's exposed to us by core. See discussion at this issue.

Known limitations

Version info extraction is fragile. Specifically, to get this information, because it's not included in any endpoint but rather in the stellar-core version command, a regex is used to capture what comes after "ledger protocol version:" in the output of that command. If core changes the wording of the output of stellar-core version, this endpoint will fail gracefully.

@cjonas9 cjonas9 added this to the platform sprint 66 milestone Dec 8, 2025
@cjonas9 cjonas9 linked an issue Dec 8, 2025 that may be closed by this pull request
@socket-security
Copy link

socket-security bot commented Dec 8, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedgolang/​github.com/​stellar/​go-stellar-sdk@​v0.0.0-20251208182759-7568ee53f4fd ⏵ v0.0.0-20251210212453-0b8bc9bdc88575 +1100100100100

View full report

@cjonas9 cjonas9 moved this from To Do to In Progress in Platform Scrum Dec 8, 2025
@cjonas9 cjonas9 marked this pull request as ready for review December 8, 2025 19:28
@cjonas9 cjonas9 requested a review from a team December 8, 2025 22:41
@cjonas9 cjonas9 requested a review from a team December 9, 2025 16:08
@Shaptic Shaptic removed this from Platform Scrum Dec 9, 2025
@Shaptic Shaptic removed this from the platform sprint 66 milestone Dec 9, 2025
@leighmcculloch
Copy link
Member

The linked issue is quite old. I'm posted some thoughts on whether it is still relevant and asking about what the use cases are for exposing the different versions here: #17 (comment)

@leighmcculloch
Copy link
Member

leighmcculloch commented Dec 9, 2025

  • limits: expansive field adding all relevant network limit info exposed to us by core.

This is interesting. It looks like we have two formats for capturing events evolving in different tools, and we should come up with a way to derive them consistently from network data and use the one format where-ever possible.

@sisuresh Is there a formula that stellar-core uses to map the config ledger entries to soroban-info response from stellar-core which is being exposed here, a formula that doesn't require knowing the names of the configs ahead of time? Or is it a manual mapping?

@sisuresh If the format is a manual mapping today can we change it to be derived from the XDR names, so that we can define a way to programmatically map from the configs ledger entries -> core and rpc settings json, so that we can mirro that behaviour in tooling like the cli? (cc @fnando @mootz12)

We should figure out this story before releasing this in RPC, since it's a more visible endpoint and harder to change once released.

The other format that's being used for network settings is the raw XDR form, used in the stellar-cli and quickstart:

stellar network settings --network testnet

{
  "updated_entry": [
    {
      "contract_max_size_bytes": 131072
    },
    {
      "contract_compute_v0": {
        "ledger_max_instructions": "100000000",
        "tx_max_instructions": "100000000",
        "fee_rate_per_instructions_increment": "25",
        "tx_memory_limit": 41943040
      }
    },
    {
      "contract_ledger_cost_v0": {
        "ledger_max_disk_read_entries": 500,
        "ledger_max_disk_read_bytes": 3500000,
        "ledger_max_write_ledger_entries": 250,
        "ledger_max_write_bytes": 143360,
        "tx_max_disk_read_entries": 100,
        "tx_max_disk_read_bytes": 200000,
        "tx_max_write_ledger_entries": 50,
        "tx_max_write_bytes": 132096,
        "fee_disk_read_ledger_entry": "6250",
        "fee_write_ledger_entry": "10000",
        "fee_disk_read1_kb": "1786",
        "soroban_state_target_size_bytes": "3000000000",
        "rent_fee1_kb_soroban_state_size_low": "-17000",
        "rent_fee1_kb_soroban_state_size_high": "10000",
        "soroban_state_rent_fee_growth_factor": 5000
      }
    },
    {
      "contract_historical_data_v0": {
        "fee_historical1_kb": "16235"
      }
    },
    {
      "contract_events_v0": {
        "tx_max_contract_events_size_bytes": 16384,
        "fee_contract_events1_kb": "10000"
      }
    },
    {
      "contract_bandwidth_v0": {
        "ledger_max_txs_size_bytes": 133120,
        "tx_max_size_bytes": 132096,
        "fee_tx_size1_kb": "1624"
      }
    },
    {
      "contract_cost_params_cpu_instructions": [
        {
          "ext": "v0",
          "const_term": "4",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "434",
          "linear_term": "16"
        },
        {
          "ext": "v0",
          "const_term": "42",
          "linear_term": "16"
        },
        {
          "ext": "v0",
          "const_term": "44",
          "linear_term": "16"
        },
        {
          "ext": "v0",
          "const_term": "295",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "60",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "221",
          "linear_term": "26"
        },
        {
          "ext": "v0",
          "const_term": "331",
          "linear_term": "4369"
        },
        {
          "ext": "v0",
          "const_term": "3636",
          "linear_term": "7013"
        },
        {
          "ext": "v0",
          "const_term": "40256",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "377551",
          "linear_term": "4059"
        },
        {
          "ext": "v0",
          "const_term": "417482",
          "linear_term": "45712"
        },
        {
          "ext": "v0",
          "const_term": "41142",
          "linear_term": "634"
        },
        {
          "ext": "v0",
          "const_term": "1945",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "6481",
          "linear_term": "5943"
        },
        {
          "ext": "v0",
          "const_term": "711",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "2314804",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "4176",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "4716",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "4680",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "4256",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "884",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "1059",
          "linear_term": "502"
        },
        {
          "ext": "v0",
          "const_term": "73077",
          "linear_term": "25410"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "540752"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "176363"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "29989"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "1061449"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "237336"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "328476"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "701845"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "429383"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "28"
        },
        {
          "ext": "v0",
          "const_term": "43030",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "7556"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "10711"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "3300"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "23038"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "42488"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "828974"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "297100"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "14"
        },
        {
          "ext": "v0",
          "const_term": "1882",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "3000906",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "661",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "985",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "1934",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "730510",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "5921",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "1057822",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "92642",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "100742",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "7689",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "2458985",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "2426722",
          "linear_term": "96397671"
        },
        {
          "ext": "v0",
          "const_term": "1541554",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "3211191",
          "linear_term": "6713"
        },
        {
          "ext": "v0",
          "const_term": "25207",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "7873219",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "8035968",
          "linear_term": "309667335"
        },
        {
          "ext": "v0",
          "const_term": "2420202",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "7050564",
          "linear_term": "6797"
        },
        {
          "ext": "v0",
          "const_term": "10558948",
          "linear_term": "632860943"
        },
        {
          "ext": "v0",
          "const_term": "1994",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "1155",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "74",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "332",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "691",
          "linear_term": "74558"
        },
        {
          "ext": "v0",
          "const_term": "35421",
          "linear_term": "0"
        }
      ]
    },
    {
      "contract_cost_params_memory_bytes": [
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "16",
          "linear_term": "128"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "242",
          "linear_term": "384"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "384"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "132773",
          "linear_term": "4903"
        },
        {
          "ext": "v0",
          "const_term": "69472",
          "linear_term": "1217"
        },
        {
          "ext": "v0",
          "const_term": "14",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "181",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "99",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "99",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "99",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "99",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "99",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "17564",
          "linear_term": "6457"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "47464"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "13420"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "6285"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "64670"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "29074"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "48095"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "103229"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "36394"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "257"
        },
        {
          "ext": "v0",
          "const_term": "70704",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "14613"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "6833"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "1025"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "129632"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "13665"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "97637"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "9176"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "126"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "109494",
          "linear_term": "354667"
        },
        {
          "ext": "v0",
          "const_term": "5552",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "9424",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "219654",
          "linear_term": "354667"
        },
        {
          "ext": "v0",
          "const_term": "3344",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "6816",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "2204",
          "linear_term": "9340474"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "248",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "0"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "128"
        },
        {
          "ext": "v0",
          "const_term": "0",
          "linear_term": "0"
        }
      ]
    },
    {
      "contract_data_key_size_bytes": 250
    },
    {
      "contract_data_entry_size_bytes": 65536
    },
    {
      "state_archival": {
        "max_entry_ttl": 3110400,
        "min_temporary_ttl": 720,
        "min_persistent_ttl": 120960,
        "persistent_rent_rate_denominator": "1215",
        "temp_rent_rate_denominator": "2430",
        "max_entries_to_archive": 0,
        "live_soroban_state_size_window_sample_size": 30,
        "live_soroban_state_size_window_sample_period": 64,
        "eviction_scan_size": 500000,
        "starting_eviction_scan_level": 7
      }
    },
    {
      "contract_execution_lanes": {
        "ledger_max_tx_count": 100
      }
    },
    {
      "contract_parallel_compute_v0": {
        "ledger_max_dependent_tx_clusters": 2
      }
    },
    {
      "contract_ledger_cost_ext_v0": {
        "tx_max_footprint_entries": 100,
        "fee_write1_kb": "3500"
      }
    },
    {
      "scp_timing": {
        "ledger_target_close_time_milliseconds": 5000,
        "nomination_timeout_initial_milliseconds": 1000,
        "nomination_timeout_increment_milliseconds": 1000,
        "ballot_timeout_initial_milliseconds": 1000,
        "ballot_timeout_increment_milliseconds": 1000
      }
    }
  ]
}

@sisuresh
Copy link
Contributor

sisuresh commented Dec 9, 2025

the sorobaninfo http command in core has a couple different formats it can return. From
commands.md.

sorobaninfo sorobaninfo?[format=basic,detailed,upgrade_xdr] Retrieves the current Soroban settings in different formats.

    **basic** is the default if the format parameter is not specified. It will dump a subset of the Soroban settings in an easy to read format.

    **detailed** will insert every setting into a ConfigUpgradeSet and dump it in the same format as the dumpproposedsettings command, which lets a user easily compare the existing settings against a proposal.

    **upgrade_xdr** will insert the current upgradeable settings into a ConfigUpgradeSet and dump it as base64 xdr. This can be used along with the stellar-xdr command line tool to dump the current settings in the same format as the JSON file we use for upgrades. This is helpful if you want to make settings changes off of the current settings. Ex. curl -s "127.0.0.1:11626/sorobaninfo?format=upgrade_xdr" | stellar-xdr decode --type ConfigUpgradeSet --output json-formatted

I believe the basic format was initially added for exposing a subset of the settings externally for Supercluster (and maybe some other components). It's a manual mapping. The upgrade_xdr format dumps the upgrade-able settings in base64 xdr, which we use with stellar-xdr decode to get the format in quickstart. Can this format be used instead in RPC?

@leighmcculloch
Copy link
Member

basic is the default if the format parameter is not specified. It will dump a subset of the Soroban settings in an easy to read format.

This basic structure format is easier to read. It's a better developer experience. The upgrade XDR is harder to work with. Could the basic structure be expanded so that it is not only a subset but covers all settings, and doing so in a way that's defined programmatically? That method doesn't have to be complex, it could be just flattening the XDR structure.

For example, one idea:

stellar network settings --network testnet | jq ' # Flatten to dot notation [paths(scalars) as $p | {($p | map(tostring) | join(".")): getpath($p)}] | add # Remove "updated_entry.N." prefix from keys | with_entries(.key |= sub("^updated_entry\\.[0-9]+\\."; "")) # Reverse, make unique by key (keeps last), reverse back to maintain order | to_entries | reverse | unique_by(.key) | reverse | from_entries # Re-expand dot notation back into nested objects | reduce to_entries[] as $e ({}; setpath($e.key | split(".") | map(tonumber? // .); $e.value)) '

{
  "state_archival": {
    "temp_rent_rate_denominator": "2430",
    "starting_eviction_scan_level": 7,
    "persistent_rent_rate_denominator": "1215",
    "min_temporary_ttl": 720,
    "min_persistent_ttl": 120960,
    "max_entry_ttl": 3110400,
    "max_entries_to_archive": 0,
    "live_soroban_state_size_window_sample_size": 30,
    "live_soroban_state_size_window_sample_period": 64,
    "eviction_scan_size": 500000
  },
  "scp_timing": {
    "nomination_timeout_initial_milliseconds": 1000,
    "nomination_timeout_increment_milliseconds": 1000,
    "ledger_target_close_time_milliseconds": 5000,
    "ballot_timeout_initial_milliseconds": 1000,
    "ballot_timeout_increment_milliseconds": 1000
  },
  "contract_parallel_compute_v0": {
    "ledger_max_dependent_tx_clusters": 2
  },
  "contract_max_size_bytes": 131072,
  "contract_ledger_cost_v0": {
    "tx_max_write_ledger_entries": 50,
    "tx_max_write_bytes": 132096,
    "tx_max_disk_read_entries": 100,
    "tx_max_disk_read_bytes": 200000,
    "soroban_state_target_size_bytes": "3000000000",
    "soroban_state_rent_fee_growth_factor": 5000,
    "rent_fee1_kb_soroban_state_size_low": "-17000",
    "rent_fee1_kb_soroban_state_size_high": "10000",
    "ledger_max_write_ledger_entries": 250,
    "ledger_max_write_bytes": 143360,
    "ledger_max_disk_read_entries": 500,
    "ledger_max_disk_read_bytes": 3500000,
    "fee_write_ledger_entry": "10000",
    "fee_disk_read_ledger_entry": "6250",
    "fee_disk_read1_kb": "1786"
  },
  "contract_ledger_cost_ext_v0": {
    "tx_max_footprint_entries": 100,
    "fee_write1_kb": "3500"
  },
  "contract_historical_data_v0": {
    "fee_historical1_kb": "16235"
  },
  "contract_execution_lanes": {
    "ledger_max_tx_count": 100
  },
  "contract_events_v0": {
    "tx_max_contract_events_size_bytes": 16384,
    "fee_contract_events1_kb": "10000"
  },
  "contract_data_key_size_bytes": 250,
  "contract_data_entry_size_bytes": 65536,
  "contract_cost_params_memory_bytes": [
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "128",
      "ext": "v0",
      "const_term": "16"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "384",
      "ext": "v0",
      "const_term": "242"
    },
    {
      "linear_term": "384",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "4903",
      "ext": "v0",
      "const_term": "132773"
    },
    {
      "linear_term": "1217",
      "ext": "v0",
      "const_term": "69472"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "14"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "181"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "99"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "99"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "99"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "99"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "99"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "6457",
      "ext": "v0",
      "const_term": "17564"
    },
    {
      "linear_term": "47464",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "13420",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "6285",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "64670",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "29074",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "48095",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "103229",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "36394",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "257",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "70704"
    },
    {
      "linear_term": "14613",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "6833",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "1025",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "129632",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "13665",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "97637",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "9176",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "126",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "354667",
      "ext": "v0",
      "const_term": "109494"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "5552"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "9424"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "354667",
      "ext": "v0",
      "const_term": "219654"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "3344"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "6816"
    },
    {
      "linear_term": "9340474",
      "ext": "v0",
      "const_term": "2204"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "248"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "128",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "0"
    }
  ],
  "contract_cost_params_cpu_instructions": [
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "4"
    },
    {
      "linear_term": "16",
      "ext": "v0",
      "const_term": "434"
    },
    {
      "linear_term": "16",
      "ext": "v0",
      "const_term": "42"
    },
    {
      "linear_term": "16",
      "ext": "v0",
      "const_term": "44"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "295"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "60"
    },
    {
      "linear_term": "26",
      "ext": "v0",
      "const_term": "221"
    },
    {
      "linear_term": "4369",
      "ext": "v0",
      "const_term": "331"
    },
    {
      "linear_term": "7013",
      "ext": "v0",
      "const_term": "3636"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "40256"
    },
    {
      "linear_term": "4059",
      "ext": "v0",
      "const_term": "377551"
    },
    {
      "linear_term": "45712",
      "ext": "v0",
      "const_term": "417482"
    },
    {
      "linear_term": "634",
      "ext": "v0",
      "const_term": "41142"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "1945"
    },
    {
      "linear_term": "5943",
      "ext": "v0",
      "const_term": "6481"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "711"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "2314804"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "4176"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "4716"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "4680"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "4256"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "884"
    },
    {
      "linear_term": "502",
      "ext": "v0",
      "const_term": "1059"
    },
    {
      "linear_term": "25410",
      "ext": "v0",
      "const_term": "73077"
    },
    {
      "linear_term": "540752",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "176363",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "29989",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "1061449",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "237336",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "328476",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "701845",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "429383",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "28",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "43030"
    },
    {
      "linear_term": "7556",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "10711",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "3300",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "23038",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "42488",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "828974",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "297100",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "14",
      "ext": "v0",
      "const_term": "0"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "1882"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "3000906"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "661"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "985"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "1934"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "730510"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "5921"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "1057822"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "92642"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "100742"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "7689"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "2458985"
    },
    {
      "linear_term": "96397671",
      "ext": "v0",
      "const_term": "2426722"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "1541554"
    },
    {
      "linear_term": "6713",
      "ext": "v0",
      "const_term": "3211191"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "25207"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "7873219"
    },
    {
      "linear_term": "309667335",
      "ext": "v0",
      "const_term": "8035968"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "2420202"
    },
    {
      "linear_term": "6797",
      "ext": "v0",
      "const_term": "7050564"
    },
    {
      "linear_term": "632860943",
      "ext": "v0",
      "const_term": "10558948"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "1994"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "1155"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "74"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "332"
    },
    {
      "linear_term": "74558",
      "ext": "v0",
      "const_term": "691"
    },
    {
      "linear_term": "0",
      "ext": "v0",
      "const_term": "35421"
    }
  ],
  "contract_compute_v0": {
    "tx_memory_limit": 41943040,
    "tx_max_instructions": "100000000",
    "ledger_max_instructions": "100000000",
    "fee_rate_per_instructions_increment": "25"
  },
  "contract_bandwidth_v0": {
    "tx_max_size_bytes": 132096,
    "ledger_max_txs_size_bytes": 133120,
    "fee_tx_size1_kb": "1624"
  }
}

For the purpose of RPC, or having a 'brief' version of the output, it could still be optional to skip the two big cost lists:

stellar network settings --network testnet | jq ' # Flatten to dot notation [paths(scalars) as $p | {($p | map(tostring) | join(".")): getpath($p)}] | add # Remove "updated_entry.N." prefix from keys | with_entries(.key |= sub("^updated_entry\\.[0-9]+\\."; "")) # Reverse, make unique by key (keeps last), reverse back to maintain order | to_entries | reverse | unique_by(.key) | reverse | from_entries # Re-expand dot notation back into nested objects | reduce to_entries[] as $e ({}; setpath($e.key | split(".") | map(tonumber? // .); $e.value)) # Delete unwanted keys | del(.contract_cost_params_memory_bytes, .contract_cost_params_cpu_instructions) '

{
  "state_archival": {
    "temp_rent_rate_denominator": "2430",
    "starting_eviction_scan_level": 7,
    "persistent_rent_rate_denominator": "1215",
    "min_temporary_ttl": 720,
    "min_persistent_ttl": 120960,
    "max_entry_ttl": 3110400,
    "max_entries_to_archive": 0,
    "live_soroban_state_size_window_sample_size": 30,
    "live_soroban_state_size_window_sample_period": 64,
    "eviction_scan_size": 500000
  },
  "scp_timing": {
    "nomination_timeout_initial_milliseconds": 1000,
    "nomination_timeout_increment_milliseconds": 1000,
    "ledger_target_close_time_milliseconds": 5000,
    "ballot_timeout_initial_milliseconds": 1000,
    "ballot_timeout_increment_milliseconds": 1000
  },
  "contract_parallel_compute_v0": {
    "ledger_max_dependent_tx_clusters": 2
  },
  "contract_max_size_bytes": 131072,
  "contract_ledger_cost_v0": {
    "tx_max_write_ledger_entries": 50,
    "tx_max_write_bytes": 132096,
    "tx_max_disk_read_entries": 100,
    "tx_max_disk_read_bytes": 200000,
    "soroban_state_target_size_bytes": "3000000000",
    "soroban_state_rent_fee_growth_factor": 5000,
    "rent_fee1_kb_soroban_state_size_low": "-17000",
    "rent_fee1_kb_soroban_state_size_high": "10000",
    "ledger_max_write_ledger_entries": 250,
    "ledger_max_write_bytes": 143360,
    "ledger_max_disk_read_entries": 500,
    "ledger_max_disk_read_bytes": 3500000,
    "fee_write_ledger_entry": "10000",
    "fee_disk_read_ledger_entry": "6250",
    "fee_disk_read1_kb": "1786"
  },
  "contract_ledger_cost_ext_v0": {
    "tx_max_footprint_entries": 100,
    "fee_write1_kb": "3500"
  },
  "contract_historical_data_v0": {
    "fee_historical1_kb": "16235"
  },
  "contract_execution_lanes": {
    "ledger_max_tx_count": 100
  },
  "contract_events_v0": {
    "tx_max_contract_events_size_bytes": 16384,
    "fee_contract_events1_kb": "10000"
  },
  "contract_data_key_size_bytes": 250,
  "contract_data_entry_size_bytes": 65536,
  "contract_compute_v0": {
    "tx_memory_limit": 41943040,
    "tx_max_instructions": "100000000",
    "ledger_max_instructions": "100000000",
    "fee_rate_per_instructions_increment": "25"
  },
  "contract_bandwidth_v0": {
    "tx_max_size_bytes": 132096,
    "ledger_max_txs_size_bytes": 133120,
    "fee_tx_size1_kb": "1624"
  }
}

@leighmcculloch
Copy link
Member

leighmcculloch commented Dec 9, 2025

The existing basic mapping is still so much easier to use and understand. Maybe we just duplicate that in the other tools.

@sisuresh Could the mapping be defined in a SEP? We can adopt it in stellar-cli and offer the same output options (just two: the sep format, and the raw xdr format). The SEP will just need updating when the XDR gets new. And RPC can continue to do what it is doing in this PR already.

@sisuresh
Copy link
Contributor

sisuresh commented Dec 9, 2025

@sisuresh Could the mapping be defined in a SEP? We can adopt it in stellar-cli and offer the same output options (just two: the sep format, and the raw xdr format). The SEP will just need updating when the XDR gets new. And RPC can continue to do what it is doing in this PR already.

I'm hesitant to do something like this because it'll add a format we'll have to maintain. As you can see, we haven't even maintained basic correctly (some field names are outdated and many settings are missing). They are essentially the minimum set of settings for our supercluster tests.

I also don't think the basic format is really that much better than the upgrade xdr other than the omission of the cost types, but I'll defer to you on RPC UX matters. My vote would be for RPC to make the cost types optional, or maybe add that as an option to sorobaninfo in code. What do you think?

@leighmcculloch
Copy link
Member

leighmcculloch commented Dec 9, 2025

Yeah that's fair, if we can't maintain the format, let's not do it. A better developer experience is only achieved if we can commit to maintaining it, and in lieu of that exposing the raw XDR 👍🏻, and as you say, RPC could just omit the two long cost type lists if the use case limits are being added for don't need them.

@Shaptic you mentioned at #17 (comment):

And limits weren't covered by the issue but they're nice to have imo.

What's the use case we're exposing the limits for?

Limits are already collectable via the getLedgerEntries method (example code), albeit requiring more effort and not as discoverable. But, if the use case we're adding limits for is for an advanced use case, then that's probably okay.

@Shaptic
Copy link
Contributor

Shaptic commented Dec 10, 2025

@leighmcculloch tbh adding the limits just seemed like a nice-to-have: a convenient, human-readable place to check the network's limits instead of perusing stellar.expert or relying on human docs: I wasn't aware of stellar network settings, which does introduce redundancy, but it's full of fluff (contract_cost_params_cpu_instructions et al.) unless you do the jq voodoo in your comment. The idea was to have programmatic access to the important subset covered in the docs (much like basic).

However, I just realized that since /sorobaninfo uses the old single-threaded HTTP server (right, @sisuresh?), someone may be able to slam getNetwork and jam up the Core process with HTTP requests. Fetching ledger entries is a better way to do this, but then you run into a very similar maintenance burden of API upkeep parsing said entries. Furthermore, if we do it that way, RPC would need non-trivial updates for new host functions which we want to avoid.

So I think I agree with the general sentiment here that maybe we shouldn't do the same thing in two places in different ways and just point people to the CLI command (which maybe can just filter out the verbose cost functions).

@leighmcculloch
Copy link
Member

point people to the CLI command (which maybe can just filter out the verbose cost functions)

Opened:

@cjonas9 cjonas9 changed the title Expand getNetwork endpoint response with version info and network limits (P25) Expand getNetwork endpoint response with core supported protocol version info (P25) Dec 10, 2025
Base automatically changed from protocol-25 to main December 12, 2025 01:16
@cjonas9 cjonas9 added the enhancement New feature or request label Jan 6, 2026
@cjonas9 cjonas9 moved this from To Do to Needs Review in Platform Scrum Jan 6, 2026
@cjonas9 cjonas9 requested a review from a team January 6, 2026 19:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

Status: Needs Review

Development

Successfully merging this pull request may close these issues.

Add Soroban interface version to getNetwork response

5 participants