From f777bb9f68ac6806fbf436aabf4e5fe1d67bc434 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Wed, 18 Oct 2023 14:54:05 -0700 Subject: [PATCH 01/26] set core version --- .github/workflows/build-soroban-dev.yml | 6 ++---- Makefile | 3 +-- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-soroban-dev.yml b/.github/workflows/build-soroban-dev.yml index 06f3354d..ac356ec4 100644 --- a/.github/workflows/build-soroban-dev.yml +++ b/.github/workflows/build-soroban-dev.yml @@ -35,8 +35,7 @@ jobs: with: arch: amd64 tag: soroban-dev-amd64 - core_ref: v20.0.0-rc.2.1 - core_supports_testing_soroban_high_limit_override: "true" + core_ref: 405e9eb9d2d0703e29a8f9792a94ea9345b58c85 core_supports_enable_soroban_diagnostic_events: "true" go_ref: horizon-v2.27.0-rc1 soroban_tools_ref: v20.0.0-rc4 @@ -54,8 +53,7 @@ jobs: with: arch: arm64 tag: soroban-dev-arm64 - core_ref: v20.0.0-rc.2.1 - core_supports_testing_soroban_high_limit_override: "true" + core_ref: 405e9eb9d2d0703e29a8f9792a94ea9345b58c85 core_supports_enable_soroban_diagnostic_events: "true" core_build_runner_type: ubuntu-latest-16-cores go_ref: horizon-v2.27.0-rc1 diff --git a/Makefile b/Makefile index 178388c1..6ad7bc08 100644 --- a/Makefile +++ b/Makefile @@ -34,8 +34,7 @@ build-testing: build-soroban-dev: $(MAKE) build TAG=soroban-dev \ - CORE_REF=v20.0.0-rc.2.1 \ - CORE_SUPPORTS_TESTING_SOROBAN_HIGH_LIMIT_OVERRIDE=true \ + CORE_REF=405e9eb9d2d0703e29a8f9792a94ea9345b58c85 \ CORE_SUPPORTS_ENABLE_SOROBAN_DIAGNOSTIC_EVENTS=true \ HORIZON_REF=horizon-v2.27.0-rc1 \ SOROBAN_RPC_REF=v20.0.0-rc4 From dbd1df5c60d9568010fce5a01905a87677892554 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Tue, 24 Oct 2023 12:34:21 -0700 Subject: [PATCH 02/26] repo --- Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 6ad7bc08..78680372 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,7 @@ __PHONY__: run logs build build-deps build-deps-core build-deps-horizon build-deps-friendbot build-deps-soroban-rpc TAG?=dev +CORE_REPO?=https://github.com/stellar/stellar-core.git CORE_REF?=master CORE_CONFIGURE_FLAGS?=--disable-tests CORE_SUPPORTS_TESTING_SOROBAN_HIGH_LIMIT_OVERRIDE?=false @@ -34,7 +35,8 @@ build-testing: build-soroban-dev: $(MAKE) build TAG=soroban-dev \ - CORE_REF=405e9eb9d2d0703e29a8f9792a94ea9345b58c85 \ + CORE_REPO=https://github.com/sisuresh/stellar-core.git \ + CORE_REF=cc71408d70172bafa5969fc0e0102af8ba60c3d3 \ CORE_SUPPORTS_ENABLE_SOROBAN_DIAGNOSTIC_EVENTS=true \ HORIZON_REF=horizon-v2.27.0-rc1 \ SOROBAN_RPC_REF=v20.0.0-rc4 @@ -46,7 +48,7 @@ build: build-deps: build-deps-core build-deps-horizon build-deps-friendbot build-deps-soroban-rpc build-deps-core: - docker build -t stellar-core:$(CORE_REF) -f docker/Dockerfile.testing https://github.com/stellar/stellar-core.git#$(CORE_REF) --build-arg BUILDKIT_CONTEXT_KEEP_GIT_DIR=true --build-arg CONFIGURE_FLAGS="$(CORE_CONFIGURE_FLAGS)" + docker build -t stellar-core:$(CORE_REF) -f docker/Dockerfile.testing $(CORE_REPO)#$(CORE_REF) --build-arg BUILDKIT_CONTEXT_KEEP_GIT_DIR=true --build-arg CONFIGURE_FLAGS="$(CORE_CONFIGURE_FLAGS)" build-deps-horizon: docker build -t stellar-horizon:$(HORIZON_REF) -f Dockerfile.horizon --target builder . --build-arg REF="$(HORIZON_REF)" From c1f45d3c3a7046af75b841752447d35592100fb7 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Tue, 24 Oct 2023 12:46:04 -0700 Subject: [PATCH 03/26] sisuresh --- .github/workflows/build-soroban-dev.yml | 6 ++++-- .github/workflows/build.yml | 13 +++++++++---- 2 files changed, 13 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-soroban-dev.yml b/.github/workflows/build-soroban-dev.yml index ac356ec4..03d7a970 100644 --- a/.github/workflows/build-soroban-dev.yml +++ b/.github/workflows/build-soroban-dev.yml @@ -35,7 +35,8 @@ jobs: with: arch: amd64 tag: soroban-dev-amd64 - core_ref: 405e9eb9d2d0703e29a8f9792a94ea9345b58c85 + core_repo: https://github.com/sisuresh/stellar-core.git + core_ref: cc71408d70172bafa5969fc0e0102af8ba60c3d3 core_supports_enable_soroban_diagnostic_events: "true" go_ref: horizon-v2.27.0-rc1 soroban_tools_ref: v20.0.0-rc4 @@ -53,7 +54,8 @@ jobs: with: arch: arm64 tag: soroban-dev-arm64 - core_ref: 405e9eb9d2d0703e29a8f9792a94ea9345b58c85 + core_repo: https://github.com/sisuresh/stellar-core.git + core_ref: cc71408d70172bafa5969fc0e0102af8ba60c3d3 core_supports_enable_soroban_diagnostic_events: "true" core_build_runner_type: ubuntu-latest-16-cores go_ref: horizon-v2.27.0-rc1 diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 87a102b1..7da91e77 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -14,8 +14,12 @@ on: description: 'Tag to use on the image name' type: 'string' required: true + core_repo: + description: 'Git repo for stellar-core' + type: 'string' + default: 'https://github.com/stellar/stellar-core.git' core_ref: - description: 'Git ref for the stellar/stellar-core repo (stellar-core)' + description: 'Git ref for the stellar-core repo' type: 'string' required: true core_configure_flags: @@ -60,7 +64,8 @@ env: IMAGE: ${{ format('{0}/{1}:{2}', secrets.DOCKERHUB_TOKEN && 'docker.io' || 'ghcr.io', github.repository, github.event_name == 'pull_request' && format('pr-{0}-{1}', github.event.pull_request.number, inputs.tag) || inputs.tag) }} GO_REPO_BRANCH: ${{ inputs.go_ref }} SOROBAN_TOOLS_REPO_BRANCH: ${{ inputs.soroban_tools_ref }} - CORE_REPO_BRANCH: ${{ inputs.core_ref }} + CORE_REPO: ${{ inputs.core_repo }} + CORE_REPO_REF: ${{ inputs.core_ref }} jobs: @@ -71,7 +76,7 @@ jobs: uses: actions/cache@v3 with: path: /tmp/image - key: image-stellar-core-${{ inputs.arch }}-${{ env.CORE_REPO_BRANCH }}-${{ inputs.core_configure_flags }} + key: image-stellar-core-${{ inputs.arch }}-${{ env.CORE_REPO_REF }}-${{ inputs.core_configure_flags }} - if: steps.cache.outputs.cache-hit != 'true' && inputs.arch == 'arm64' uses: docker/setup-qemu-action@e81a89b1732b9c48d79cd809d8d81d79c4647a18 with: @@ -84,7 +89,7 @@ jobs: docker buildx build --platform linux/${{ inputs.arch }} -f docker/Dockerfile.testing -t stellar-core:${{ inputs.arch }} -o type=docker,dest=/tmp/image - https://github.com/stellar/stellar-core.git#${{ env.CORE_REPO_BRANCH }} + ${{ env.CORE_REPO }}#${{ env.CORE_REPO_REF }} --build-arg BUILDKIT_CONTEXT_KEEP_GIT_DIR=true --build-arg CONFIGURE_FLAGS='${{ inputs.core_configure_flags }}' - name: Upload Stellar-Core Image From fcc72c4acf030a19391615b5511541d3b420aac3 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Tue, 24 Oct 2023 13:27:52 -0700 Subject: [PATCH 04/26] ver --- .github/workflows/build-soroban-dev.yml | 4 ++-- Makefile | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-soroban-dev.yml b/.github/workflows/build-soroban-dev.yml index 03d7a970..89e9cf72 100644 --- a/.github/workflows/build-soroban-dev.yml +++ b/.github/workflows/build-soroban-dev.yml @@ -36,7 +36,7 @@ jobs: arch: amd64 tag: soroban-dev-amd64 core_repo: https://github.com/sisuresh/stellar-core.git - core_ref: cc71408d70172bafa5969fc0e0102af8ba60c3d3 + core_ref: df249816bb86457585a47cf3163e14663a70a484 core_supports_enable_soroban_diagnostic_events: "true" go_ref: horizon-v2.27.0-rc1 soroban_tools_ref: v20.0.0-rc4 @@ -55,7 +55,7 @@ jobs: arch: arm64 tag: soroban-dev-arm64 core_repo: https://github.com/sisuresh/stellar-core.git - core_ref: cc71408d70172bafa5969fc0e0102af8ba60c3d3 + core_ref: df249816bb86457585a47cf3163e14663a70a484 core_supports_enable_soroban_diagnostic_events: "true" core_build_runner_type: ubuntu-latest-16-cores go_ref: horizon-v2.27.0-rc1 diff --git a/Makefile b/Makefile index 78680372..903b7139 100644 --- a/Makefile +++ b/Makefile @@ -36,7 +36,7 @@ build-testing: build-soroban-dev: $(MAKE) build TAG=soroban-dev \ CORE_REPO=https://github.com/sisuresh/stellar-core.git \ - CORE_REF=cc71408d70172bafa5969fc0e0102af8ba60c3d3 \ + CORE_REF=df249816bb86457585a47cf3163e14663a70a484 \ CORE_SUPPORTS_ENABLE_SOROBAN_DIAGNOSTIC_EVENTS=true \ HORIZON_REF=horizon-v2.27.0-rc1 \ SOROBAN_RPC_REF=v20.0.0-rc4 From 6b50fdd360edd0d8376a56ab535b1e1233cf4473 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Tue, 24 Oct 2023 13:32:07 -0700 Subject: [PATCH 05/26] add logs to existing upgrades --- start | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/start b/start index a71f7f6c..a828ab26 100644 --- a/start +++ b/start @@ -482,7 +482,10 @@ function upgrade_local() { fi if [ ".$PROTOCOL_VERSION" != ".none" ] ; then if [ $PROTOCOL_VERSION -gt 0 ]; then - curl "http://localhost:11626/upgrades?mode=set&upgradetime=1970-01-01T00:00:00Z&protocolversion=$PROTOCOL_VERSION&basereserve=5000000" + echo "upgrade: upgrading to protocol $PROTOCOL_VERSION" + curl -s "http://localhost:11626/upgrades?mode=set&upgradetime=1970-01-01T00:00:00Z&protocolversion=$PROTOCOL_VERSION&basereserve=5000000" + while [ "`curl -s http://localhost:11626/info | jq -r '.info.protocol_version'`" != "$PROTOCOL_VERSION" ]; do sleep 1; done + echo "upgrade: upgraded to protocol $PROTOCOL_VERSION" fi fi fi From c1d06f962442a3671e7c099051c6528ddd4e3370 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Tue, 24 Oct 2023 13:32:31 -0700 Subject: [PATCH 06/26] add todos --- start | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/start b/start index a828ab26..40fecb31 100644 --- a/start +++ b/start @@ -487,6 +487,11 @@ function upgrade_local() { while [ "`curl -s http://localhost:11626/info | jq -r '.info.protocol_version'`" != "$PROTOCOL_VERSION" ]; do sleep 1; done echo "upgrade: upgraded to protocol $PROTOCOL_VERSION" fi + # TODO: If protocol version is greater than v20: + # Generate network config using stellar-core. + # Submit txs with network config. + # Curl upgrade. + # Wait for upgrade to complete. fi fi } From 531aae7e063583d235a1cbab21117e050064fa4d Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Tue, 24 Oct 2023 13:41:44 -0700 Subject: [PATCH 07/26] logs --- start | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/start b/start index 40fecb31..55d7ddc1 100644 --- a/start +++ b/start @@ -482,10 +482,10 @@ function upgrade_local() { fi if [ ".$PROTOCOL_VERSION" != ".none" ] ; then if [ $PROTOCOL_VERSION -gt 0 ]; then - echo "upgrade: upgrading to protocol $PROTOCOL_VERSION" + echo "upgrade: protocolversion=$PROTOCOL_VERSION, basereserve=5000000" curl -s "http://localhost:11626/upgrades?mode=set&upgradetime=1970-01-01T00:00:00Z&protocolversion=$PROTOCOL_VERSION&basereserve=5000000" while [ "`curl -s http://localhost:11626/info | jq -r '.info.protocol_version'`" != "$PROTOCOL_VERSION" ]; do sleep 1; done - echo "upgrade: upgraded to protocol $PROTOCOL_VERSION" + echo "upgrade: done" fi # TODO: If protocol version is greater than v20: # Generate network config using stellar-core. From e4f858a0d35660cd447357811194140cedf050b9 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Tue, 24 Oct 2023 16:00:34 -0700 Subject: [PATCH 08/26] wip --- local/core/etc/config-settings-entries.json | 364 ++++++++++++++++++ .../etc/supervisord.conf.d/friendbot.conf | 2 +- start | 22 +- 3 files changed, 386 insertions(+), 2 deletions(-) create mode 100644 local/core/etc/config-settings-entries.json diff --git a/local/core/etc/config-settings-entries.json b/local/core/etc/config-settings-entries.json new file mode 100644 index 00000000..5f11ff7c --- /dev/null +++ b/local/core/etc/config-settings-entries.json @@ -0,0 +1,364 @@ +{ + "updated_entry": [ + { + "contract_max_size_bytes": 65536 + }, + { + "contract_compute_v0": { + "ledger_max_instructions": 100000000, + "tx_max_instructions": 100000000, + "fee_rate_per_instructions_increment": 100, + "tx_memory_limit": 41943040 + } + }, + { + "contract_ledger_cost_v0": { + "ledger_max_read_ledger_entries": 30, + "ledger_max_read_bytes": 133120, + "ledger_max_write_ledger_entries": 20, + "ledger_max_write_bytes": 66560, + "tx_max_read_ledger_entries": 30, + "tx_max_read_bytes": 133120, + "tx_max_write_ledger_entries": 20, + "tx_max_write_bytes": 66560, + "fee_read_ledger_entry": 1000, + "fee_write_ledger_entry": 3000, + "fee_read1_kb": 1000, + "bucket_list_target_size_bytes": 2147483648, + "write_fee1_kb_bucket_list_low": 1000, + "write_fee1_kb_bucket_list_high": 4000000, + "bucket_list_write_fee_growth_factor": 1000 + } + }, + { + "contract_historical_data_v0": { + "fee_historical1_kb": 5000 + } + }, + { + "contract_events_v0": { + "tx_max_contract_events_size_bytes": 2048, + "fee_contract_events1_kb": 300 + } + }, + { + "contract_bandwidth_v0": { + "ledger_max_txs_size_bytes": 71680, + "tx_max_size_bytes": 71680, + "fee_tx_size1_kb": 500 + } + }, + { + "contract_cost_params_cpu_instructions": [ + { + "ext": "v0", + "const_term": 6, + "linear_term": 0 + }, + { + "ext": "v0", + "const_term": 0, + "linear_term": 0 + }, + { + "ext": "v0", + "const_term": 1141, + "linear_term": 1 + }, + { + "ext": "v0", + "const_term": 39, + "linear_term": 24 + }, + { + "ext": "v0", + "const_term": 20, + "linear_term": 64 + }, + { + "ext": "v0", + "const_term": 263, + "linear_term": 0 + }, + { + "ext": "v0", + "const_term": 108, + "linear_term": 0 + }, + { + "ext": "v0", + "const_term": 591, + "linear_term": 69 + }, + { + "ext": "v0", + "const_term": 1112, + "linear_term": 34 + }, + { + "ext": "v0", + "const_term": 2924, + "linear_term": 4149 + }, + { + "ext": "v0", + "const_term": 25584, + "linear_term": 0 + }, + { + "ext": "v0", + "const_term": 53, + "linear_term": 0 + }, + { + "ext": "v0", + "const_term": 0, + "linear_term": 0 + }, + { + "ext": "v0", + "const_term": 376877, + "linear_term": 2747 + }, + { + "ext": "v0", + "const_term": 182, + "linear_term": 24 + }, + { + "ext": "v0", + "const_term": 182, + "linear_term": 24 + }, + { + "ext": "v0", + "const_term": 967154, + "linear_term": 69991 + }, + { + "ext": "v0", + "const_term": 967154, + "linear_term": 69991 + }, + { + "ext": "v0", + "const_term": 1125, + "linear_term": 0 + }, + { + "ext": "v0", + "const_term": 2890, + "linear_term": 3561 + }, + { + "ext": "v0", + "const_term": 38363, + "linear_term": 0 + }, + { + "ext": "v0", + "const_term": 224, + "linear_term": 0 + }, + { + "ext": "v0", + "const_term": 1666155, + "linear_term": 0 + }, + { + "ext": "v0", + "const_term": 1716, + "linear_term": 0 + }, + { + "ext": "v0", + "const_term": 2226, + "linear_term": 0 + }, + { + "ext": "v0", + "const_term": 2333, + "linear_term": 0 + }, + { + "ext": "v0", + "const_term": 5212, + "linear_term": 0 + }, + { + "ext": "v0", + "const_term": 412, + "linear_term": 0 + } + ] + }, + { + "contract_cost_params_memory_bytes": [ + { + "ext": "v0", + "const_term": 0, + "linear_term": 0 + }, + { + "ext": "v0", + "const_term": 1, + "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": 18, + "linear_term": 384 + }, + { + "ext": "v0", + "const_term": 16, + "linear_term": 128 + }, + { + "ext": "v0", + "const_term": 40, + "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": 131103, + "linear_term": 5080 + }, + { + "ext": "v0", + "const_term": 131103, + "linear_term": 5080 + }, + { + "ext": "v0", + "const_term": 14, + "linear_term": 0 + }, + { + "ext": "v0", + "const_term": 40, + "linear_term": 0 + }, + { + "ext": "v0", + "const_term": 0, + "linear_term": 0 + }, + { + "ext": "v0", + "const_term": 0, + "linear_term": 0 + }, + { + "ext": "v0", + "const_term": 201, + "linear_term": 0 + }, + { + "ext": "v0", + "const_term": 119, + "linear_term": 0 + }, + { + "ext": "v0", + "const_term": 119, + "linear_term": 0 + }, + { + "ext": "v0", + "const_term": 119, + "linear_term": 0 + }, + { + "ext": "v0", + "const_term": 119, + "linear_term": 0 + }, + { + "ext": "v0", + "const_term": 119, + "linear_term": 0 + } + ] + }, + { + "contract_data_key_size_bytes": 300 + }, + { + "contract_data_entry_size_bytes": 65536 + }, + { + "state_expiration": { + "max_entry_expiration": 535680, + "min_temp_entry_expiration": 16, + "min_persistent_entry_expiration": 120960, + "persistent_rent_rate_denominator": 535680, + "temp_rent_rate_denominator": 5356800, + "max_entries_to_expire": 100, + "bucket_list_size_window_sample_size": 30, + "eviction_scan_size": 100000, + "starting_eviction_scan_level": 1 + } + }, + { + "contract_execution_lanes": { + "ledger_max_tx_count": 30 + } + } + ] +} diff --git a/local/supervisor/etc/supervisord.conf.d/friendbot.conf b/local/supervisor/etc/supervisord.conf.d/friendbot.conf index 5c000b4f..84caf1fc 100644 --- a/local/supervisor/etc/supervisord.conf.d/friendbot.conf +++ b/local/supervisor/etc/supervisord.conf.d/friendbot.conf @@ -2,7 +2,7 @@ user=stellar directory=/opt/stellar/friendbot command=/opt/stellar/friendbot/bin/start -autostart=true +autostart=false autorestart=true startretries=100 priority=40 diff --git a/start b/start index 55d7ddc1..39f105e3 100644 --- a/start +++ b/start @@ -29,6 +29,7 @@ export PGPORT=5432 : "${ENABLE_CORE_MANUAL_CLOSE:=false}" : "${CORE_SUPPORTS_TESTING_SOROBAN_HIGH_LIMIT_OVERRIDE:=false}" : "${CORE_SUPPORTS_ENABLE_SOROBAN_DIAGNOSTIC_EVENTS:=false}" +: "${CONFIG_SETTINGS:=''}" QUICKSTART_INITIALIZED=false CURRENT_POSTGRES_PID="" @@ -171,6 +172,9 @@ function process_args() { if [ "$RANDOMIZE_NETWORK_PASSPHRASE" = "true" ]; then NETWORK_PASSPHRASE="${NETWORK_PASSPHRASE} ; $(openssl rand -hex 32)" fi + export NETWORK_ID=$(printf "$NETWORK_PASSPHRASE" | sha256sum | cut -f 1 -d " ") + export NETWORK_ROOT_SECRET_KEY=$(printf 'SC5O7VZUXDJ6JBDSZ74DSERXL7W3Y5LTOAMRF7RQRL3TAGAPS7LUVG3L') # TODO: Replace with calcualted from NETWORK_ID. + export NETWORK_ROOT_ACCOUNT_ID=$(printf 'GBZXN7PIRZGNMHGA7MUUUF4GWPY5AYPV6LY4UV2GL6VJGIQRXFDNMADI') # TODO: Replace with calculated from NETWORK_ROOT_SECRET_KEY. # Are we ephemeral or persistent? if [ -z "$STELLAR_MODE" ]; then @@ -487,13 +491,29 @@ function upgrade_local() { while [ "`curl -s http://localhost:11626/info | jq -r '.info.protocol_version'`" != "$PROTOCOL_VERSION" ]; do sleep 1; done echo "upgrade: done" fi - # TODO: If protocol version is greater than v20: + if [ $PROTOCOL_VERSION -ge 20 ]; then + echo "upgrade: config=$CONFIG" + # TODO: Make the config-settings-entries.json something that can be overriden by a commandline option. + # TODO: Is the below going to work? It's pretty brittle. + echo $NETWORK_ROOT_SECRET_KEY | stellar-core get-settings-upgrade-txs "$NETWORK_ROOT_ACCOUNT_ID" 1 "$NETWORK_PASSPHRASE" --signtxs $COREHOME/etc/config-settings-entries.json | { \ + curl -s -G 'http://localhost:11626/tx' --data-urlencode "blob=$(read)" + curl -s -G 'http://localhost:11626/tx' --data-urlencode "blob=$(read)" + curl -s -G 'http://localhost:11626/tx' --data-urlencode "blob=$(read)" + curl -s -G 'http://localhost:11626/upgrades?mode=set&upgradetime=1970-01-01T00:00:00Z' --data-urlencode "configupgradesetkey=$(read)" + } + # TODO: How do we query if the upgrade succeeded? There won't be a protocol version change to watch for. + echo "upgrade: done" + fi # Generate network config using stellar-core. # Submit txs with network config. # Curl upgrade. # Wait for upgrade to complete. fi fi + # Delay friendbot starting till now because the config upgrade above will use + # the network root account to submit txs, and friendbot on local is configured + # to use the network root account as a funding source. + supervisorctl start friendbot } function exec_supervisor() { From bbaf85eae8f6604dd3f10bc53830fb4a8a785ec4 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Tue, 24 Oct 2023 16:03:34 -0700 Subject: [PATCH 09/26] wip --- start | 3 +++ 1 file changed, 3 insertions(+) diff --git a/start b/start index 39f105e3..0f79e1b4 100644 --- a/start +++ b/start @@ -497,8 +497,11 @@ function upgrade_local() { # TODO: Is the below going to work? It's pretty brittle. echo $NETWORK_ROOT_SECRET_KEY | stellar-core get-settings-upgrade-txs "$NETWORK_ROOT_ACCOUNT_ID" 1 "$NETWORK_PASSPHRASE" --signtxs $COREHOME/etc/config-settings-entries.json | { \ curl -s -G 'http://localhost:11626/tx' --data-urlencode "blob=$(read)" + # TODO: Wait for tx to succeed? curl -s -G 'http://localhost:11626/tx' --data-urlencode "blob=$(read)" + # TODO: Wait for tx to succeed? curl -s -G 'http://localhost:11626/tx' --data-urlencode "blob=$(read)" + # TODO: Wait for tx to succeed? curl -s -G 'http://localhost:11626/upgrades?mode=set&upgradetime=1970-01-01T00:00:00Z' --data-urlencode "configupgradesetkey=$(read)" } # TODO: How do we query if the upgrade succeeded? There won't be a protocol version change to watch for. From ec8793dda47898318a24aa77ff4b72ff739e9a4d Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Thu, 26 Oct 2023 14:46:11 -0700 Subject: [PATCH 10/26] wip --- start | 52 +++++++++++++++++++++++++++++++++++++++++++--------- 1 file changed, 43 insertions(+), 9 deletions(-) diff --git a/start b/start index 0f79e1b4..fadccc3a 100644 --- a/start +++ b/start @@ -492,17 +492,51 @@ function upgrade_local() { echo "upgrade: done" fi if [ $PROTOCOL_VERSION -ge 20 ]; then - echo "upgrade: config=$CONFIG" + sleep 5; + echo "upgrade: config" + local tx='{ + "source_account": "GBZXN7PIRZGNMHGA7MUUUF4GWPY5AYPV6LY4UV2GL6VJGIQRXFDNMADI", + "fee": 100, + "seq_num": 1, + "cond": { + "time": { + "min_time": 0, + "max_time": 0 + } + }, + "memo": "none", + "operations": [ + { + "source_account": null, + "body": { + "bump_sequence": { + "bump_to": 1 + } + } + } + ], + "ext": "v0" +}' + local hash=$(printf "$tx" | jq -n '{"network_id":"'"$NETWORK_ID"'","tagged_transaction":{"tx":inputs}}' | stellar-xdr encode --type TransactionSignaturePayload --output single | sha256sum | cut -f 1 -d " ") # TODO: Make the config-settings-entries.json something that can be overriden by a commandline option. # TODO: Is the below going to work? It's pretty brittle. - echo $NETWORK_ROOT_SECRET_KEY | stellar-core get-settings-upgrade-txs "$NETWORK_ROOT_ACCOUNT_ID" 1 "$NETWORK_PASSPHRASE" --signtxs $COREHOME/etc/config-settings-entries.json | { \ - curl -s -G 'http://localhost:11626/tx' --data-urlencode "blob=$(read)" - # TODO: Wait for tx to succeed? - curl -s -G 'http://localhost:11626/tx' --data-urlencode "blob=$(read)" - # TODO: Wait for tx to succeed? - curl -s -G 'http://localhost:11626/tx' --data-urlencode "blob=$(read)" - # TODO: Wait for tx to succeed? - curl -s -G 'http://localhost:11626/upgrades?mode=set&upgradetime=1970-01-01T00:00:00Z' --data-urlencode "configupgradesetkey=$(read)" + echo $NETWORK_ROOT_SECRET_KEY | stellar-core get-settings-upgrade-txs "$NETWORK_ROOT_ACCOUNT_ID" 0 "$NETWORK_PASSPHRASE" --signtxs $COREHOME/etc/config-settings-entries.json | { \ + read tx; \ + echo "upgrade: submitting 1 $tx"; + curl -sG 'http://localhost:11626/tx' --data-urlencode "blob=$tx"; \ + sleep 2; \ + read tx; \ + echo "upgrade: submitting 2 $tx"; + curl -sG 'http://localhost:11626/tx' --data-urlencode "blob=$tx"; \ + sleep 2; \ + read tx; \ + echo "upgrade: submitting 3 $tx"; + curl -sG 'http://localhost:11626/tx' --data-urlencode "blob=$tx"; \ + sleep 2; \ + read key; \ + echo "upgrade: starting upgrade with key $key"; + curl -sG 'http://localhost:11626/upgrades?mode=set&upgradetime=1970-01-01T00:00:00Z' --data-urlencode "configupgradesetkey=$key"; \ + sleep 2; \ } # TODO: How do we query if the upgrade succeeded? There won't be a protocol version change to watch for. echo "upgrade: done" From 0041e14620b409cbf6b30228d0b40306c7b589ba Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Fri, 27 Oct 2023 17:15:08 -0700 Subject: [PATCH 11/26] working --- .github/workflows/build-soroban-dev.yml | 4 +- Makefile | 2 +- start | 131 +++++++++++------------- 3 files changed, 61 insertions(+), 76 deletions(-) diff --git a/.github/workflows/build-soroban-dev.yml b/.github/workflows/build-soroban-dev.yml index 89e9cf72..977d2f13 100644 --- a/.github/workflows/build-soroban-dev.yml +++ b/.github/workflows/build-soroban-dev.yml @@ -36,7 +36,7 @@ jobs: arch: amd64 tag: soroban-dev-amd64 core_repo: https://github.com/sisuresh/stellar-core.git - core_ref: df249816bb86457585a47cf3163e14663a70a484 + core_ref: 9931d1275ae99740b62a452b0c397237c1a32d63 core_supports_enable_soroban_diagnostic_events: "true" go_ref: horizon-v2.27.0-rc1 soroban_tools_ref: v20.0.0-rc4 @@ -55,7 +55,7 @@ jobs: arch: arm64 tag: soroban-dev-arm64 core_repo: https://github.com/sisuresh/stellar-core.git - core_ref: df249816bb86457585a47cf3163e14663a70a484 + core_ref: 9931d1275ae99740b62a452b0c397237c1a32d63 core_supports_enable_soroban_diagnostic_events: "true" core_build_runner_type: ubuntu-latest-16-cores go_ref: horizon-v2.27.0-rc1 diff --git a/Makefile b/Makefile index 903b7139..fd5ca5fc 100644 --- a/Makefile +++ b/Makefile @@ -36,7 +36,7 @@ build-testing: build-soroban-dev: $(MAKE) build TAG=soroban-dev \ CORE_REPO=https://github.com/sisuresh/stellar-core.git \ - CORE_REF=df249816bb86457585a47cf3163e14663a70a484 \ + CORE_REF=9931d1275ae99740b62a452b0c397237c1a32d63 \ CORE_SUPPORTS_ENABLE_SOROBAN_DIAGNOSTIC_EVENTS=true \ HORIZON_REF=horizon-v2.27.0-rc1 \ SOROBAN_RPC_REF=v20.0.0-rc4 diff --git a/start b/start index fadccc3a..a37cc0d8 100644 --- a/start +++ b/start @@ -64,6 +64,9 @@ function start() { echo "mode: $STELLAR_MODE" echo "network: $NETWORK" echo "network passphrase: $NETWORK_PASSPHRASE" + echo "network id: $NETWORK_ID" + echo "network root secret key: $NETWORK_ROOT_SECRET_KEY" + echo "network root account id: $NETWORK_ROOT_ACCOUNT_ID" copy_defaults init_db @@ -172,9 +175,11 @@ function process_args() { if [ "$RANDOMIZE_NETWORK_PASSPHRASE" = "true" ]; then NETWORK_PASSPHRASE="${NETWORK_PASSPHRASE} ; $(openssl rand -hex 32)" fi + export NETWORK_ID=$(printf "$NETWORK_PASSPHRASE" | sha256sum | cut -f 1 -d " ") - export NETWORK_ROOT_SECRET_KEY=$(printf 'SC5O7VZUXDJ6JBDSZ74DSERXL7W3Y5LTOAMRF7RQRL3TAGAPS7LUVG3L') # TODO: Replace with calcualted from NETWORK_ID. - export NETWORK_ROOT_ACCOUNT_ID=$(printf 'GBZXN7PIRZGNMHGA7MUUUF4GWPY5AYPV6LY4UV2GL6VJGIQRXFDNMADI') # TODO: Replace with calculated from NETWORK_ROOT_SECRET_KEY. + local network_id_keys=$(stellar-core convert-id $NETWORK_ID | awk -F': ' '/strKey: /{print $2}' | tail -2) + export NETWORK_ROOT_SECRET_KEY=$(printf "$network_id_keys" | head -1) + export NETWORK_ROOT_ACCOUNT_ID=$(printf "$network_id_keys" | tail -1) # Are we ephemeral or persistent? if [ -z "$STELLAR_MODE" ]; then @@ -476,80 +481,60 @@ function init_soroban_rpc() { } function upgrade_local() { + if [ "$NETWORK" != "local" ]; then + return + fi + # Upgrade local network's protocol version and base reserve to match pubnet/testnet - if [ "$NETWORK" = "local" ]; then - # Wait for server - while ! echo "Stellar-core http server listening!" | nc localhost 11626 &> /dev/null; do sleep 1; done - if [ -z "$PROTOCOL_VERSION" ]; then - # default to latest version supported by core - export PROTOCOL_VERSION=`curl -s http://localhost:11626/info | jq -r '.info.protocol_version'` - fi - if [ ".$PROTOCOL_VERSION" != ".none" ] ; then - if [ $PROTOCOL_VERSION -gt 0 ]; then - echo "upgrade: protocolversion=$PROTOCOL_VERSION, basereserve=5000000" - curl -s "http://localhost:11626/upgrades?mode=set&upgradetime=1970-01-01T00:00:00Z&protocolversion=$PROTOCOL_VERSION&basereserve=5000000" - while [ "`curl -s http://localhost:11626/info | jq -r '.info.protocol_version'`" != "$PROTOCOL_VERSION" ]; do sleep 1; done - echo "upgrade: done" - fi - if [ $PROTOCOL_VERSION -ge 20 ]; then - sleep 5; - echo "upgrade: config" - local tx='{ - "source_account": "GBZXN7PIRZGNMHGA7MUUUF4GWPY5AYPV6LY4UV2GL6VJGIQRXFDNMADI", - "fee": 100, - "seq_num": 1, - "cond": { - "time": { - "min_time": 0, - "max_time": 0 - } - }, - "memo": "none", - "operations": [ - { - "source_account": null, - "body": { - "bump_sequence": { - "bump_to": 1 - } - } + + # Wait for server + while ! echo "Stellar-core http server listening!" | nc localhost 11626 &> /dev/null; do sleep 1; done + + # Default to latest version supported by core + if [ -z "$PROTOCOL_VERSION" ]; then + export PROTOCOL_VERSION=`curl -s http://localhost:11626/info | jq -r '.info.protocol_version'` + fi + + if [ ".$PROTOCOL_VERSION" == ".none" ] ; then + return + fi + + if [ $PROTOCOL_VERSION -gt 0 ]; then + echo "upgrade: protocolversion=$PROTOCOL_VERSION, basereserve=5000000" + curl -s "http://localhost:11626/upgrades?mode=set&upgradetime=1970-01-01T00:00:00Z&protocolversion=$PROTOCOL_VERSION&basereserve=5000000" + while [ "`curl -s http://localhost:11626/info | jq -r '.info.ledger.version'`" != "$PROTOCOL_VERSION" ]; do sleep 1; echo wait protocol change; done + echo "upgrade: done" + fi + + if [ $PROTOCOL_VERSION -ge 20 ]; then + echo "upgrade: soroban config" + echo $NETWORK_ROOT_SECRET_KEY | stellar-core get-settings-upgrade-txs "$NETWORK_ROOT_ACCOUNT_ID" 0 "$NETWORK_PASSPHRASE" --signtxs $COREHOME/etc/config-settings-entries.json 2>/dev/null | { \ + read tx; \ + read txid; \ + echo "upgrade: submitting 1 $txid"; + curl -sG 'http://localhost:11626/tx' --data-urlencode "blob=$tx"; \ + while [ "`curl -s http://localhost:11626/metrics | jq -r '.metrics."ledger.transaction.count".count'`" != "1" ]; do sleep 1; done + read tx; \ + read txid; \ + echo "upgrade: submitting 2 $txid"; + curl -sG 'http://localhost:11626/tx' --data-urlencode "blob=$tx"; \ + while [ "`curl -s http://localhost:11626/metrics | jq -r '.metrics."ledger.transaction.count".count'`" != "2" ]; do sleep 1; done + read tx; \ + read txid; \ + echo "upgrade: submitting 3 $txid"; + curl -sG 'http://localhost:11626/tx' --data-urlencode "blob=$tx"; \ + while [ "`curl -s http://localhost:11626/metrics | jq -r '.metrics."ledger.transaction.count".count'`" != "3" ]; do sleep 1; done + read key; \ + echo "upgrade: starting upgrade with key $key"; + curl -sG 'http://localhost:11626/upgrades?mode=set&upgradetime=1970-01-01T00:00:00Z' --data-urlencode "configupgradesetkey=$key"; \ } - ], - "ext": "v0" -}' - local hash=$(printf "$tx" | jq -n '{"network_id":"'"$NETWORK_ID"'","tagged_transaction":{"tx":inputs}}' | stellar-xdr encode --type TransactionSignaturePayload --output single | sha256sum | cut -f 1 -d " ") - # TODO: Make the config-settings-entries.json something that can be overriden by a commandline option. - # TODO: Is the below going to work? It's pretty brittle. - echo $NETWORK_ROOT_SECRET_KEY | stellar-core get-settings-upgrade-txs "$NETWORK_ROOT_ACCOUNT_ID" 0 "$NETWORK_PASSPHRASE" --signtxs $COREHOME/etc/config-settings-entries.json | { \ - read tx; \ - echo "upgrade: submitting 1 $tx"; - curl -sG 'http://localhost:11626/tx' --data-urlencode "blob=$tx"; \ - sleep 2; \ - read tx; \ - echo "upgrade: submitting 2 $tx"; - curl -sG 'http://localhost:11626/tx' --data-urlencode "blob=$tx"; \ - sleep 2; \ - read tx; \ - echo "upgrade: submitting 3 $tx"; - curl -sG 'http://localhost:11626/tx' --data-urlencode "blob=$tx"; \ - sleep 2; \ - read key; \ - echo "upgrade: starting upgrade with key $key"; - curl -sG 'http://localhost:11626/upgrades?mode=set&upgradetime=1970-01-01T00:00:00Z' --data-urlencode "configupgradesetkey=$key"; \ - sleep 2; \ - } - # TODO: How do we query if the upgrade succeeded? There won't be a protocol version change to watch for. - echo "upgrade: done" - fi - # Generate network config using stellar-core. - # Submit txs with network config. - # Curl upgrade. - # Wait for upgrade to complete. - fi + echo "upgrade: done" fi - # Delay friendbot starting till now because the config upgrade above will use - # the network root account to submit txs, and friendbot on local is configured - # to use the network root account as a funding source. + + # Delay friendbot starting till now because until network upgrades it won't be + # able to create accounts. Also the config upgrade above will use the network + # root account to submit txs, and friendbot on local is configured to use the + # network root account as a funding source. supervisorctl start friendbot } From 1103e41e7e79296ac14a5d7e6d62346594ff3734 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Fri, 27 Oct 2023 17:16:05 -0700 Subject: [PATCH 12/26] rem --- start | 1 - 1 file changed, 1 deletion(-) diff --git a/start b/start index a37cc0d8..902d24eb 100644 --- a/start +++ b/start @@ -29,7 +29,6 @@ export PGPORT=5432 : "${ENABLE_CORE_MANUAL_CLOSE:=false}" : "${CORE_SUPPORTS_TESTING_SOROBAN_HIGH_LIMIT_OVERRIDE:=false}" : "${CORE_SUPPORTS_ENABLE_SOROBAN_DIAGNOSTIC_EVENTS:=false}" -: "${CONFIG_SETTINGS:=''}" QUICKSTART_INITIALIZED=false CURRENT_POSTGRES_PID="" From 3b3b8d6aca54d3cd3a86fc18af6db02bb844cb9b Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Fri, 27 Oct 2023 17:20:04 -0700 Subject: [PATCH 13/26] logs --- start | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/start b/start index 902d24eb..105ee6c3 100644 --- a/start +++ b/start @@ -510,21 +510,21 @@ function upgrade_local() { echo $NETWORK_ROOT_SECRET_KEY | stellar-core get-settings-upgrade-txs "$NETWORK_ROOT_ACCOUNT_ID" 0 "$NETWORK_PASSPHRASE" --signtxs $COREHOME/etc/config-settings-entries.json 2>/dev/null | { \ read tx; \ read txid; \ - echo "upgrade: submitting 1 $txid"; + echo "upgrade: soroban config submitting tx 1: $txid"; curl -sG 'http://localhost:11626/tx' --data-urlencode "blob=$tx"; \ while [ "`curl -s http://localhost:11626/metrics | jq -r '.metrics."ledger.transaction.count".count'`" != "1" ]; do sleep 1; done read tx; \ read txid; \ - echo "upgrade: submitting 2 $txid"; + echo "upgrade: soroban config submitting tx 2: $txid"; curl -sG 'http://localhost:11626/tx' --data-urlencode "blob=$tx"; \ while [ "`curl -s http://localhost:11626/metrics | jq -r '.metrics."ledger.transaction.count".count'`" != "2" ]; do sleep 1; done read tx; \ read txid; \ - echo "upgrade: submitting 3 $txid"; + echo "upgrade: soroban config submitting tx 3: $txid"; curl -sG 'http://localhost:11626/tx' --data-urlencode "blob=$tx"; \ while [ "`curl -s http://localhost:11626/metrics | jq -r '.metrics."ledger.transaction.count".count'`" != "3" ]; do sleep 1; done read key; \ - echo "upgrade: starting upgrade with key $key"; + echo "upgrade: soroban config initiating upgrade: $key"; curl -sG 'http://localhost:11626/upgrades?mode=set&upgradetime=1970-01-01T00:00:00Z' --data-urlencode "configupgradesetkey=$key"; \ } echo "upgrade: done" From a1edb41a351b11ac514160162aa760d090f537af Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Fri, 27 Oct 2023 17:22:32 -0700 Subject: [PATCH 14/26] logs --- start | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/start b/start index 105ee6c3..97c06171 100644 --- a/start +++ b/start @@ -499,35 +499,35 @@ function upgrade_local() { fi if [ $PROTOCOL_VERSION -gt 0 ]; then - echo "upgrade: protocolversion=$PROTOCOL_VERSION, basereserve=5000000" + echo "upgrades: protocolversion=$PROTOCOL_VERSION, basereserve=5000000" curl -s "http://localhost:11626/upgrades?mode=set&upgradetime=1970-01-01T00:00:00Z&protocolversion=$PROTOCOL_VERSION&basereserve=5000000" - while [ "`curl -s http://localhost:11626/info | jq -r '.info.ledger.version'`" != "$PROTOCOL_VERSION" ]; do sleep 1; echo wait protocol change; done - echo "upgrade: done" + while [ "`curl -s http://localhost:11626/info | jq -r '.info.ledger.version'`" != "$PROTOCOL_VERSION" ]; do sleep 1; done + echo "upgrades: done" fi if [ $PROTOCOL_VERSION -ge 20 ]; then - echo "upgrade: soroban config" + echo "upgrades: soroban config" echo $NETWORK_ROOT_SECRET_KEY | stellar-core get-settings-upgrade-txs "$NETWORK_ROOT_ACCOUNT_ID" 0 "$NETWORK_PASSPHRASE" --signtxs $COREHOME/etc/config-settings-entries.json 2>/dev/null | { \ read tx; \ read txid; \ - echo "upgrade: soroban config submitting tx 1: $txid"; + echo "upgrades: soroban config submitting tx 1: $txid"; curl -sG 'http://localhost:11626/tx' --data-urlencode "blob=$tx"; \ while [ "`curl -s http://localhost:11626/metrics | jq -r '.metrics."ledger.transaction.count".count'`" != "1" ]; do sleep 1; done read tx; \ read txid; \ - echo "upgrade: soroban config submitting tx 2: $txid"; + echo "upgrades: soroban config submitting tx 2: $txid"; curl -sG 'http://localhost:11626/tx' --data-urlencode "blob=$tx"; \ while [ "`curl -s http://localhost:11626/metrics | jq -r '.metrics."ledger.transaction.count".count'`" != "2" ]; do sleep 1; done read tx; \ read txid; \ - echo "upgrade: soroban config submitting tx 3: $txid"; + echo "upgrades: soroban config submitting tx 3: $txid"; curl -sG 'http://localhost:11626/tx' --data-urlencode "blob=$tx"; \ while [ "`curl -s http://localhost:11626/metrics | jq -r '.metrics."ledger.transaction.count".count'`" != "3" ]; do sleep 1; done read key; \ - echo "upgrade: soroban config initiating upgrade: $key"; + echo "upgrades: soroban config initiating upgrade: $key"; curl -sG 'http://localhost:11626/upgrades?mode=set&upgradetime=1970-01-01T00:00:00Z' --data-urlencode "configupgradesetkey=$key"; \ } - echo "upgrade: done" + echo "upgrades: done" fi # Delay friendbot starting till now because until network upgrades it won't be From b5232120f3e64bf817f487d988302adaee29e2a3 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Fri, 27 Oct 2023 17:50:41 -0700 Subject: [PATCH 15/26] logs --- start | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/start b/start index 97c06171..89f4789a 100644 --- a/start +++ b/start @@ -502,7 +502,7 @@ function upgrade_local() { echo "upgrades: protocolversion=$PROTOCOL_VERSION, basereserve=5000000" curl -s "http://localhost:11626/upgrades?mode=set&upgradetime=1970-01-01T00:00:00Z&protocolversion=$PROTOCOL_VERSION&basereserve=5000000" while [ "`curl -s http://localhost:11626/info | jq -r '.info.ledger.version'`" != "$PROTOCOL_VERSION" ]; do sleep 1; done - echo "upgrades: done" + echo "upgrades: protocolversion done" fi if [ $PROTOCOL_VERSION -ge 20 ]; then @@ -510,24 +510,21 @@ function upgrade_local() { echo $NETWORK_ROOT_SECRET_KEY | stellar-core get-settings-upgrade-txs "$NETWORK_ROOT_ACCOUNT_ID" 0 "$NETWORK_PASSPHRASE" --signtxs $COREHOME/etc/config-settings-entries.json 2>/dev/null | { \ read tx; \ read txid; \ - echo "upgrades: soroban config submitting tx 1: $txid"; - curl -sG 'http://localhost:11626/tx' --data-urlencode "blob=$tx"; \ + echo "upgrades: soroban config submitting tx 1: $txid .. $(curl -sG 'http://localhost:11626/tx' --data-urlencode "blob=$tx" | jq -r '.status')"; \ while [ "`curl -s http://localhost:11626/metrics | jq -r '.metrics."ledger.transaction.count".count'`" != "1" ]; do sleep 1; done read tx; \ read txid; \ - echo "upgrades: soroban config submitting tx 2: $txid"; - curl -sG 'http://localhost:11626/tx' --data-urlencode "blob=$tx"; \ + echo "upgrades: soroban config submitting tx 2: $txid .. $(curl -sG 'http://localhost:11626/tx' --data-urlencode "blob=$tx" | jq -r '.status')"; \ while [ "`curl -s http://localhost:11626/metrics | jq -r '.metrics."ledger.transaction.count".count'`" != "2" ]; do sleep 1; done read tx; \ read txid; \ - echo "upgrades: soroban config submitting tx 3: $txid"; - curl -sG 'http://localhost:11626/tx' --data-urlencode "blob=$tx"; \ + echo "upgrades: soroban config submitting tx 3: $txid .. $(curl -sG 'http://localhost:11626/tx' --data-urlencode "blob=$tx" | jq -r '.status')"; \ while [ "`curl -s http://localhost:11626/metrics | jq -r '.metrics."ledger.transaction.count".count'`" != "3" ]; do sleep 1; done read key; \ echo "upgrades: soroban config initiating upgrade: $key"; curl -sG 'http://localhost:11626/upgrades?mode=set&upgradetime=1970-01-01T00:00:00Z' --data-urlencode "configupgradesetkey=$key"; \ } - echo "upgrades: done" + echo "upgrades: soroban config done" fi # Delay friendbot starting till now because until network upgrades it won't be From f4a092c98b5c715418200636d403f4491634d408 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Fri, 27 Oct 2023 17:52:34 -0700 Subject: [PATCH 16/26] logs --- start | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/start b/start index 89f4789a..41d0d004 100644 --- a/start +++ b/start @@ -484,8 +484,6 @@ function upgrade_local() { return fi - # Upgrade local network's protocol version and base reserve to match pubnet/testnet - # Wait for server while ! echo "Stellar-core http server listening!" | nc localhost 11626 &> /dev/null; do sleep 1; done @@ -498,6 +496,7 @@ function upgrade_local() { return 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" curl -s "http://localhost:11626/upgrades?mode=set&upgradetime=1970-01-01T00:00:00Z&protocolversion=$PROTOCOL_VERSION&basereserve=5000000" @@ -505,6 +504,7 @@ function upgrade_local() { echo "upgrades: protocolversion done" fi + # Upgrade local network's soroban config to match testnet if [ $PROTOCOL_VERSION -ge 20 ]; then echo "upgrades: soroban config" echo $NETWORK_ROOT_SECRET_KEY | stellar-core get-settings-upgrade-txs "$NETWORK_ROOT_ACCOUNT_ID" 0 "$NETWORK_PASSPHRASE" --signtxs $COREHOME/etc/config-settings-entries.json 2>/dev/null | { \ From b2768ab0d6b8aa07f51d86c83c6aa1621d2cb710 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Fri, 27 Oct 2023 17:54:33 -0700 Subject: [PATCH 17/26] logs --- start | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/start b/start index 41d0d004..59ac8547 100644 --- a/start +++ b/start @@ -510,18 +510,18 @@ function upgrade_local() { echo $NETWORK_ROOT_SECRET_KEY | stellar-core get-settings-upgrade-txs "$NETWORK_ROOT_ACCOUNT_ID" 0 "$NETWORK_PASSPHRASE" --signtxs $COREHOME/etc/config-settings-entries.json 2>/dev/null | { \ read tx; \ read txid; \ - echo "upgrades: soroban config submitting tx 1: $txid .. $(curl -sG 'http://localhost:11626/tx' --data-urlencode "blob=$tx" | jq -r '.status')"; \ + echo "upgrades: soroban config: install contract: $txid .. $(curl -sG 'http://localhost:11626/tx' --data-urlencode "blob=$tx" | jq -r '.status')"; \ while [ "`curl -s http://localhost:11626/metrics | jq -r '.metrics."ledger.transaction.count".count'`" != "1" ]; do sleep 1; done read tx; \ read txid; \ - echo "upgrades: soroban config submitting tx 2: $txid .. $(curl -sG 'http://localhost:11626/tx' --data-urlencode "blob=$tx" | jq -r '.status')"; \ + echo "upgrades: soroban config: deploy contract: $txid .. $(curl -sG 'http://localhost:11626/tx' --data-urlencode "blob=$tx" | jq -r '.status')"; \ while [ "`curl -s http://localhost:11626/metrics | jq -r '.metrics."ledger.transaction.count".count'`" != "2" ]; do sleep 1; done read tx; \ read txid; \ - echo "upgrades: soroban config submitting tx 3: $txid .. $(curl -sG 'http://localhost:11626/tx' --data-urlencode "blob=$tx" | jq -r '.status')"; \ + echo "upgrades: soroban config: upload config: $txid .. $(curl -sG 'http://localhost:11626/tx' --data-urlencode "blob=$tx" | jq -r '.status')"; \ while [ "`curl -s http://localhost:11626/metrics | jq -r '.metrics."ledger.transaction.count".count'`" != "3" ]; do sleep 1; done read key; \ - echo "upgrades: soroban config initiating upgrade: $key"; + echo "upgrades: soroban config: set config with key: $key"; curl -sG 'http://localhost:11626/upgrades?mode=set&upgradetime=1970-01-01T00:00:00Z' --data-urlencode "configupgradesetkey=$key"; \ } echo "upgrades: soroban config done" From f605d1244512883b6f33780177a7dec19aa18c39 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Fri, 27 Oct 2023 20:29:19 -0700 Subject: [PATCH 18/26] add docker container logs --- .github/workflows/build.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 7da91e77..b978c7b1 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -270,17 +270,20 @@ jobs: run: sleep 10 - name: Run core test run: | + docker logs stellar -f & echo "supervisorctl tail -f stellar-core" | docker exec -i stellar sh & go run test_core.go curl http://localhost:11626/info - name: Run horizon up test run: | + docker logs stellar -f & echo "supervisorctl tail -f horizon" | docker exec -i stellar sh & go run test_horizon_up.go curl http://localhost:8000 - name: Run horizon ingesting test if: ${{ matrix.network != 'pubnet' }} run: | + docker logs stellar -f & echo "supervisorctl tail -f stellar-core" | docker exec -i stellar sh & echo "supervisorctl tail -f horizon" | docker exec -i stellar sh & go run test_horizon_ingesting.go @@ -288,12 +291,14 @@ jobs: - name: Run friendbot test if: ${{ matrix.network == 'local' }} run: | + docker logs stellar -f & echo "supervisorctl tail -f friendbot" | docker exec -i stellar sh & echo "supervisorctl tail -f horizon" | docker exec -i stellar sh & go run test_friendbot.go - name: Run soroban rpc test if: ${{ contains(matrix.options, '--enable-soroban-rpc') }} run: | + docker logs stellar -f & echo "supervisorctl tail -f soroban-rpc" | docker exec -i stellar sh & go run test_soroban_rpc_up.go From 84f516dd6ddceffdf74691d24b0758e0a6d76081 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Fri, 27 Oct 2023 20:42:10 -0700 Subject: [PATCH 19/26] testing --- .github/workflows/build-testing.yml | 8 ++++---- Makefile | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-testing.yml b/.github/workflows/build-testing.yml index 1f0ce0cf..1e9a7c25 100644 --- a/.github/workflows/build-testing.yml +++ b/.github/workflows/build-testing.yml @@ -37,8 +37,8 @@ jobs: with: arch: amd64 tag: testing-amd64 - core_ref: v20.0.0-rc.2.1 - core_supports_testing_soroban_high_limit_override: "true" + core_repo: https://github.com/sisuresh/stellar-core.git + core_ref: 9931d1275ae99740b62a452b0c397237c1a32d63 core_supports_enable_soroban_diagnostic_events: "true" go_ref: horizon-v2.27.0-rc1 soroban_tools_ref: v20.0.0-rc4 @@ -59,8 +59,8 @@ jobs: with: arch: arm64 tag: testing-arm64 - core_ref: v20.0.0-rc.2.1 - core_supports_testing_soroban_high_limit_override: "true" + core_repo: https://github.com/sisuresh/stellar-core.git + core_ref: 9931d1275ae99740b62a452b0c397237c1a32d63 core_supports_enable_soroban_diagnostic_events: "true" core_build_runner_type: ubuntu-latest-16-cores go_ref: horizon-v2.27.0-rc1 diff --git a/Makefile b/Makefile index fd5ca5fc..a566a20b 100644 --- a/Makefile +++ b/Makefile @@ -27,8 +27,8 @@ build-latest: build-testing: $(MAKE) build TAG=testing \ - CORE_REF=v20.0.0-rc.2.1 \ - CORE_SUPPORTS_TESTING_SOROBAN_HIGH_LIMIT_OVERRIDE=true \ + CORE_REPO=https://github.com/sisuresh/stellar-core.git \ + CORE_REF=9931d1275ae99740b62a452b0c397237c1a32d63 \ CORE_SUPPORTS_ENABLE_SOROBAN_DIAGNOSTIC_EVENTS=true \ HORIZON_REF=horizon-v2.27.0-rc1 \ SOROBAN_RPC_REF=v20.0.0-rc4 From 19d59b8ac71206f2e25884313fdf22f2396e008c Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Fri, 27 Oct 2023 20:43:54 -0700 Subject: [PATCH 20/26] cleanup --- .github/workflows/build.yml | 6 +----- Dockerfile | 2 -- Makefile | 3 +-- README.md | 2 -- local/core/etc/stellar-core.cfg | 1 - local/horizon/etc/stellar-captive-core.cfg | 1 - .../soroban-rpc/etc/stellar-captive-core.cfg | 1 - start | 19 ------------------- 8 files changed, 2 insertions(+), 33 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index b978c7b1..495a451d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -26,10 +26,6 @@ on: description: 'CONFIGURE_FLAGS used when building stellar-core' type: 'string' default: '--disable-tests' - core_supports_testing_soroban_high_limit_override: - description: 'Indicator whether stellar-core supports the TESTING_SOROBAN_HIGH_LIMIT_OVERRIDE config' - type: 'string' - default: 'false' core_supports_enable_soroban_diagnostic_events: description: 'Indicator whether stellar-core supports the ENABLE_SOROBAN_DIAGNOSTIC_EVENTS config' type: 'string' @@ -231,7 +227,7 @@ jobs: # save can. Once buildx supports it we can update. # https://github.com/docker/buildx/issues/847 - name: Build Quickstart Image - run: docker build --platform linux/${{ inputs.arch }} -f Dockerfile -t $IMAGE --label org.opencontainers.image.revision="${{ env.HEAD_SHA }}" . --build-arg STELLAR_CORE_IMAGE_REF=stellar-core:${{ inputs.arch }} --build-arg HORIZON_IMAGE_REF=stellar-horizon:${{ inputs.arch }} --build-arg FRIENDBOT_IMAGE_REF=stellar-friendbot:${{ inputs.arch }} --build-arg SOROBAN_RPC_IMAGE_REF=stellar-soroban-rpc:${{ inputs.arch }} --build-arg CORE_SUPPORTS_TESTING_SOROBAN_HIGH_LIMIT_OVERRIDE=${{ inputs.core_supports_testing_soroban_high_limit_override }} --build-arg CORE_SUPPORTS_ENABLE_SOROBAN_DIAGNOSTIC_EVENTS=${{ inputs.core_supports_enable_soroban_diagnostic_events }} + run: docker build --platform linux/${{ inputs.arch }} -f Dockerfile -t $IMAGE --label org.opencontainers.image.revision="${{ env.HEAD_SHA }}" . --build-arg STELLAR_CORE_IMAGE_REF=stellar-core:${{ inputs.arch }} --build-arg HORIZON_IMAGE_REF=stellar-horizon:${{ inputs.arch }} --build-arg FRIENDBOT_IMAGE_REF=stellar-friendbot:${{ inputs.arch }} --build-arg SOROBAN_RPC_IMAGE_REF=stellar-soroban-rpc:${{ inputs.arch }} --build-arg CORE_SUPPORTS_ENABLE_SOROBAN_DIAGNOSTIC_EVENTS=${{ inputs.core_supports_enable_soroban_diagnostic_events }} - name: Save Quickstart Image run: docker save $IMAGE -o /tmp/image - name: Upload Quickstart Image diff --git a/Dockerfile b/Dockerfile index eeb03c0b..599b05bd 100644 --- a/Dockerfile +++ b/Dockerfile @@ -42,8 +42,6 @@ ADD pubnet /opt/stellar-default/pubnet ADD testnet /opt/stellar-default/testnet ADD futurenet /opt/stellar-default/futurenet -ARG CORE_SUPPORTS_TESTING_SOROBAN_HIGH_LIMIT_OVERRIDE -ENV CORE_SUPPORTS_TESTING_SOROBAN_HIGH_LIMIT_OVERRIDE $CORE_SUPPORTS_TESTING_SOROBAN_HIGH_LIMIT_OVERRIDE ARG CORE_SUPPORTS_ENABLE_SOROBAN_DIAGNOSTIC_EVENTS ENV CORE_SUPPORTS_ENABLE_SOROBAN_DIAGNOSTIC_EVENTS $CORE_SUPPORTS_ENABLE_SOROBAN_DIAGNOSTIC_EVENTS diff --git a/Makefile b/Makefile index a566a20b..8eb5ec77 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,6 @@ TAG?=dev CORE_REPO?=https://github.com/stellar/stellar-core.git CORE_REF?=master CORE_CONFIGURE_FLAGS?=--disable-tests -CORE_SUPPORTS_TESTING_SOROBAN_HIGH_LIMIT_OVERRIDE?=false CORE_SUPPORTS_ENABLE_SOROBAN_DIAGNOSTIC_EVENTS?=false SOROBAN_RPC_REF?=main HORIZON_REF?=$(shell ./scripts/soroban_repo_to_horizon_repo.sh $(SOROBAN_RPC_REF)) @@ -43,7 +42,7 @@ build-soroban-dev: build: $(MAKE) -j 4 build-deps - docker build -t stellar/quickstart:$(TAG) -f Dockerfile . --build-arg STELLAR_CORE_IMAGE_REF=stellar-core:$(CORE_REF) --build-arg HORIZON_IMAGE_REF=stellar-horizon:$(HORIZON_REF) --build-arg FRIENDBOT_IMAGE_REF=stellar-friendbot:$(FRIENDBOT_REF) --build-arg SOROBAN_RPC_IMAGE_REF=stellar-soroban-rpc:$(SOROBAN_RPC_REF) --build-arg CORE_SUPPORTS_TESTING_SOROBAN_HIGH_LIMIT_OVERRIDE=$(CORE_SUPPORTS_TESTING_SOROBAN_HIGH_LIMIT_OVERRIDE) --build-arg CORE_SUPPORTS_ENABLE_SOROBAN_DIAGNOSTIC_EVENTS=$(CORE_SUPPORTS_ENABLE_SOROBAN_DIAGNOSTIC_EVENTS) + docker build -t stellar/quickstart:$(TAG) -f Dockerfile . --build-arg STELLAR_CORE_IMAGE_REF=stellar-core:$(CORE_REF) --build-arg HORIZON_IMAGE_REF=stellar-horizon:$(HORIZON_REF) --build-arg FRIENDBOT_IMAGE_REF=stellar-friendbot:$(FRIENDBOT_REF) --build-arg SOROBAN_RPC_IMAGE_REF=stellar-soroban-rpc:$(SOROBAN_RPC_REF) --build-arg CORE_SUPPORTS_ENABLE_SOROBAN_DIAGNOSTIC_EVENTS=$(CORE_SUPPORTS_ENABLE_SOROBAN_DIAGNOSTIC_EVENTS) build-deps: build-deps-core build-deps-horizon build-deps-friendbot build-deps-soroban-rpc diff --git a/README.md b/README.md index d75ba34d..0d71f00b 100644 --- a/README.md +++ b/README.md @@ -161,7 +161,6 @@ built with. build with. Typically include `--disable-tests`, and to enable the next protocol version that is still in development, add `--enable-next-protocol-version-unsafe-for-production`. -- `CORE_SUPPORTS_TESTING_SOROBAN_HIGH_LIMIT_OVERRIDE`: Flag for whether high limits for testing are enabled. Default `false`. - `CORE_SUPPORTS_ENABLE_SOROBAN_DIAGNOSTIC_EVENTS`: Flag for whether enabling Soroban diagnostic events is supported. Default `false`. - `HORIZON_REF`: The git reference of stellar-horizon to build. - `FRIENDBOT_REF`: The git reference of stellar-friendbot to build. @@ -173,7 +172,6 @@ make build \ TAG=soroban-dev \ CORE_REF=... \ CORE_CONFIGURE_FLAGS=... \ - CORE_SUPPORTS_TESTING_SOROBAN_HIGH_LIMIT_OVERRIDE=... \ HORIZON_REF=... \ FRIENDBOT_REF=... \ SOROBAN_RPC_REF=... diff --git a/local/core/etc/stellar-core.cfg b/local/core/etc/stellar-core.cfg index b591a037..5a677327 100644 --- a/local/core/etc/stellar-core.cfg +++ b/local/core/etc/stellar-core.cfg @@ -5,7 +5,6 @@ HTTP_PORT=11626 PUBLIC_HTTP_PORT=true MANUAL_CLOSE=__MANUAL_CLOSE__ ARTIFICIALLY_ACCELERATE_TIME_FOR_TESTING=true -__TESTING_SOROBAN_HIGH_LIMIT_OVERRIDE__ NETWORK_PASSPHRASE="__NETWORK__" KNOWN_CURSORS=["HORIZON"] diff --git a/local/horizon/etc/stellar-captive-core.cfg b/local/horizon/etc/stellar-captive-core.cfg index 632b394f..446737dd 100644 --- a/local/horizon/etc/stellar-captive-core.cfg +++ b/local/horizon/etc/stellar-captive-core.cfg @@ -7,7 +7,6 @@ PUBLIC_HTTP_PORT=false PEER_PORT=11725 DATABASE="__DATABASE__" ARTIFICIALLY_ACCELERATE_TIME_FOR_TESTING=true -__TESTING_SOROBAN_HIGH_LIMIT_OVERRIDE__ __ENABLE_SOROBAN_DIAGNOSTIC_EVENTS__ UNSAFE_QUORUM=true diff --git a/local/soroban-rpc/etc/stellar-captive-core.cfg b/local/soroban-rpc/etc/stellar-captive-core.cfg index e32e0e19..65f24c61 100644 --- a/local/soroban-rpc/etc/stellar-captive-core.cfg +++ b/local/soroban-rpc/etc/stellar-captive-core.cfg @@ -7,7 +7,6 @@ PUBLIC_HTTP_PORT=false PEER_PORT=11726 DATABASE="__DATABASE__" ARTIFICIALLY_ACCELERATE_TIME_FOR_TESTING=true -__TESTING_SOROBAN_HIGH_LIMIT_OVERRIDE__ __ENABLE_SOROBAN_DIAGNOSTIC_EVENTS__ EXPERIMENTAL_BUCKETLIST_DB=true diff --git a/start b/start index 59ac8547..6e557e27 100644 --- a/start +++ b/start @@ -27,7 +27,6 @@ export PGPORT=5432 : "${DISABLE_SOROBAN_DIAGNOSTIC_EVENTS:=false}" : "${ENABLE_SOROBAN_RPC_ADMIN_ENDPOINT:=false}" : "${ENABLE_CORE_MANUAL_CLOSE:=false}" -: "${CORE_SUPPORTS_TESTING_SOROBAN_HIGH_LIMIT_OVERRIDE:=false}" : "${CORE_SUPPORTS_ENABLE_SOROBAN_DIAGNOSTIC_EVENTS:=false}" QUICKSTART_INITIALIZED=false @@ -370,12 +369,6 @@ function init_stellar_core() { run_silent "finalize-core-config-manual-close" perl -pi -e "s/__MANUAL_CLOSE__/$ENABLE_CORE_MANUAL_CLOSE/g" etc/stellar-core.cfg - if [ "$NETWORK" = "local" ] && [ "${CORE_SUPPORTS_TESTING_SOROBAN_HIGH_LIMIT_OVERRIDE}" = "true" ]; then - run_silent "finalize-core-config-testing-soroban-high-limit-override-set-true" perl -pi -e "s/__TESTING_SOROBAN_HIGH_LIMIT_OVERRIDE__/TESTING_SOROBAN_HIGH_LIMIT_OVERRIDE=true/g" etc/stellar-core.cfg - else - run_silent "finalize-core-config-testing-soroban-high-limit-override-unset" perl -pi -e "s/__TESTING_SOROBAN_HIGH_LIMIT_OVERRIDE__//g" etc/stellar-core.cfg - fi - start_postgres run_silent "init-core-db" sudo -u stellar stellar-core new-db --conf etc/stellar-core.cfg @@ -411,12 +404,6 @@ function init_horizon() { run_silent "finalize-horizon-captivecore-config-enable-soroban-diagnostic-events-unset" perl -pi -e "s/__ENABLE_SOROBAN_DIAGNOSTIC_EVENTS__//g" $HORIZON_CAPTIVE_CORE_CFG fi - if [ "$NETWORK" = "local" ] && [ "${CORE_SUPPORTS_TESTING_SOROBAN_HIGH_LIMIT_OVERRIDE}" = "true" ]; then - run_silent "finalize-horizon-captivecore-config-testing-soroban-high-limit-override-set-true" perl -pi -e "s/__TESTING_SOROBAN_HIGH_LIMIT_OVERRIDE__/TESTING_SOROBAN_HIGH_LIMIT_OVERRIDE=true/g" $HORIZON_CAPTIVE_CORE_CFG - else - run_silent "finalize-horizon-captivecore-config-testing-soroban-high-limit-override-unset" perl -pi -e "s/__TESTING_SOROBAN_HIGH_LIMIT_OVERRIDE__//g" $HORIZON_CAPTIVE_CORE_CFG - fi - cat << EOF >> etc/horizon.env export CAPTIVE_CORE_CONFIG_PATH=$HORIZON_CAPTIVE_CORE_CFG export CAPTIVE_CORE_STORAGE_PATH=$HZHOME/captive-core @@ -458,12 +445,6 @@ function init_soroban_rpc() { run_silent "finalize-soroban-rpc-captivecore-config-enable-soroban-diagnostic-events-unset" perl -pi -e "s/__ENABLE_SOROBAN_DIAGNOSTIC_EVENTS__//g" $SOROBAN_RPC_CAPTIVE_CORE_CFG fi - if [ "$NETWORK" = "local" ] && [ "${CORE_SUPPORTS_TESTING_SOROBAN_HIGH_LIMIT_OVERRIDE}" = "true" ]; then - run_silent "finalize-soroban-rpc-captivecore-config-testing-soroban-high-limit-override-set-true" perl -pi -e "s/__TESTING_SOROBAN_HIGH_LIMIT_OVERRIDE__/TESTING_SOROBAN_HIGH_LIMIT_OVERRIDE=true/g" $SOROBAN_RPC_CAPTIVE_CORE_CFG - else - run_silent "finalize-soroban-rpc-captivecore-config-testing-soroban-high-limit-override-unset" perl -pi -e "s/__TESTING_SOROBAN_HIGH_LIMIT_OVERRIDE__//g" $SOROBAN_RPC_CAPTIVE_CORE_CFG - fi - local ADMIN_ENDPOINT=0.0.0.0:6061 if [ "$ENABLE_SOROBAN_RPC_ADMIN_ENDPOINT" != "true" ]; then ADMIN_ENDPOINT= From 3907ad87beea472199b1c04411e83a8dc34dcd00 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Sat, 28 Oct 2023 14:46:34 -0700 Subject: [PATCH 21/26] clearer docs --- start | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/start b/start index 6e557e27..a1b287c1 100644 --- a/start +++ b/start @@ -508,10 +508,11 @@ function upgrade_local() { echo "upgrades: soroban config done" fi - # Delay friendbot starting till now because until network upgrades it won't be - # able to create accounts. Also the config upgrade above will use the network - # root account to submit txs, and friendbot on local is configured to use the - # network root account as a funding source. + # Start friendbot once network upgrades are complete and network is ready. + # Note that friendbot and the config upgrade txs above use the same + # account to submit txs. while friend it is not dependent on the config + # upgrade txs, it must not be started until the config upgrades are + # complete otherwise the txs sequence numbers will conflict. supervisorctl start friendbot } From 98ffb34e8ed1c762ec049de86920a653638966f4 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Mon, 30 Oct 2023 10:24:15 -0700 Subject: [PATCH 22/26] upd --- .github/workflows/build-soroban-dev.yml | 4 ++-- .github/workflows/build-testing.yml | 4 ++-- Makefile | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/build-soroban-dev.yml b/.github/workflows/build-soroban-dev.yml index 977d2f13..747c5df1 100644 --- a/.github/workflows/build-soroban-dev.yml +++ b/.github/workflows/build-soroban-dev.yml @@ -36,7 +36,7 @@ jobs: arch: amd64 tag: soroban-dev-amd64 core_repo: https://github.com/sisuresh/stellar-core.git - core_ref: 9931d1275ae99740b62a452b0c397237c1a32d63 + core_ref: 5fc6eba34fe49e55c7b72a55896d8ba3ab254111 core_supports_enable_soroban_diagnostic_events: "true" go_ref: horizon-v2.27.0-rc1 soroban_tools_ref: v20.0.0-rc4 @@ -55,7 +55,7 @@ jobs: arch: arm64 tag: soroban-dev-arm64 core_repo: https://github.com/sisuresh/stellar-core.git - core_ref: 9931d1275ae99740b62a452b0c397237c1a32d63 + core_ref: 5fc6eba34fe49e55c7b72a55896d8ba3ab254111 core_supports_enable_soroban_diagnostic_events: "true" core_build_runner_type: ubuntu-latest-16-cores go_ref: horizon-v2.27.0-rc1 diff --git a/.github/workflows/build-testing.yml b/.github/workflows/build-testing.yml index 1e9a7c25..c77f5408 100644 --- a/.github/workflows/build-testing.yml +++ b/.github/workflows/build-testing.yml @@ -38,7 +38,7 @@ jobs: arch: amd64 tag: testing-amd64 core_repo: https://github.com/sisuresh/stellar-core.git - core_ref: 9931d1275ae99740b62a452b0c397237c1a32d63 + core_ref: 5fc6eba34fe49e55c7b72a55896d8ba3ab254111 core_supports_enable_soroban_diagnostic_events: "true" go_ref: horizon-v2.27.0-rc1 soroban_tools_ref: v20.0.0-rc4 @@ -60,7 +60,7 @@ jobs: arch: arm64 tag: testing-arm64 core_repo: https://github.com/sisuresh/stellar-core.git - core_ref: 9931d1275ae99740b62a452b0c397237c1a32d63 + core_ref: 5fc6eba34fe49e55c7b72a55896d8ba3ab254111 core_supports_enable_soroban_diagnostic_events: "true" core_build_runner_type: ubuntu-latest-16-cores go_ref: horizon-v2.27.0-rc1 diff --git a/Makefile b/Makefile index 8eb5ec77..e8b7fcaa 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,7 @@ build-latest: build-testing: $(MAKE) build TAG=testing \ CORE_REPO=https://github.com/sisuresh/stellar-core.git \ - CORE_REF=9931d1275ae99740b62a452b0c397237c1a32d63 \ + CORE_REF=5fc6eba34fe49e55c7b72a55896d8ba3ab254111 \ CORE_SUPPORTS_ENABLE_SOROBAN_DIAGNOSTIC_EVENTS=true \ HORIZON_REF=horizon-v2.27.0-rc1 \ SOROBAN_RPC_REF=v20.0.0-rc4 @@ -35,7 +35,7 @@ build-testing: build-soroban-dev: $(MAKE) build TAG=soroban-dev \ CORE_REPO=https://github.com/sisuresh/stellar-core.git \ - CORE_REF=9931d1275ae99740b62a452b0c397237c1a32d63 \ + CORE_REF=5fc6eba34fe49e55c7b72a55896d8ba3ab254111 \ CORE_SUPPORTS_ENABLE_SOROBAN_DIAGNOSTIC_EVENTS=true \ HORIZON_REF=horizon-v2.27.0-rc1 \ SOROBAN_RPC_REF=v20.0.0-rc4 From 2d1a2e564fb53c4e1faceea8677298bb2e33aef0 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Mon, 30 Oct 2023 13:05:04 -0700 Subject: [PATCH 23/26] upd --- .github/workflows/build-soroban-dev.yml | 4 ++-- .github/workflows/build-testing.yml | 4 ++-- Makefile | 4 ++-- start | 2 +- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/build-soroban-dev.yml b/.github/workflows/build-soroban-dev.yml index 747c5df1..e1a9eaee 100644 --- a/.github/workflows/build-soroban-dev.yml +++ b/.github/workflows/build-soroban-dev.yml @@ -36,7 +36,7 @@ jobs: arch: amd64 tag: soroban-dev-amd64 core_repo: https://github.com/sisuresh/stellar-core.git - core_ref: 5fc6eba34fe49e55c7b72a55896d8ba3ab254111 + core_ref: 35edba32d29c47cd78eea736afa2fdb498b6ecd2 core_supports_enable_soroban_diagnostic_events: "true" go_ref: horizon-v2.27.0-rc1 soroban_tools_ref: v20.0.0-rc4 @@ -55,7 +55,7 @@ jobs: arch: arm64 tag: soroban-dev-arm64 core_repo: https://github.com/sisuresh/stellar-core.git - core_ref: 5fc6eba34fe49e55c7b72a55896d8ba3ab254111 + core_ref: 35edba32d29c47cd78eea736afa2fdb498b6ecd2 core_supports_enable_soroban_diagnostic_events: "true" core_build_runner_type: ubuntu-latest-16-cores go_ref: horizon-v2.27.0-rc1 diff --git a/.github/workflows/build-testing.yml b/.github/workflows/build-testing.yml index c77f5408..f7330ec8 100644 --- a/.github/workflows/build-testing.yml +++ b/.github/workflows/build-testing.yml @@ -38,7 +38,7 @@ jobs: arch: amd64 tag: testing-amd64 core_repo: https://github.com/sisuresh/stellar-core.git - core_ref: 5fc6eba34fe49e55c7b72a55896d8ba3ab254111 + core_ref: 35edba32d29c47cd78eea736afa2fdb498b6ecd2 core_supports_enable_soroban_diagnostic_events: "true" go_ref: horizon-v2.27.0-rc1 soroban_tools_ref: v20.0.0-rc4 @@ -60,7 +60,7 @@ jobs: arch: arm64 tag: testing-arm64 core_repo: https://github.com/sisuresh/stellar-core.git - core_ref: 5fc6eba34fe49e55c7b72a55896d8ba3ab254111 + core_ref: 35edba32d29c47cd78eea736afa2fdb498b6ecd2 core_supports_enable_soroban_diagnostic_events: "true" core_build_runner_type: ubuntu-latest-16-cores go_ref: horizon-v2.27.0-rc1 diff --git a/Makefile b/Makefile index e8b7fcaa..fb2ad7d9 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,7 @@ build-latest: build-testing: $(MAKE) build TAG=testing \ CORE_REPO=https://github.com/sisuresh/stellar-core.git \ - CORE_REF=5fc6eba34fe49e55c7b72a55896d8ba3ab254111 \ + CORE_REF=35edba32d29c47cd78eea736afa2fdb498b6ecd2 \ CORE_SUPPORTS_ENABLE_SOROBAN_DIAGNOSTIC_EVENTS=true \ HORIZON_REF=horizon-v2.27.0-rc1 \ SOROBAN_RPC_REF=v20.0.0-rc4 @@ -35,7 +35,7 @@ build-testing: build-soroban-dev: $(MAKE) build TAG=soroban-dev \ CORE_REPO=https://github.com/sisuresh/stellar-core.git \ - CORE_REF=5fc6eba34fe49e55c7b72a55896d8ba3ab254111 \ + CORE_REF=35edba32d29c47cd78eea736afa2fdb498b6ecd2 \ CORE_SUPPORTS_ENABLE_SOROBAN_DIAGNOSTIC_EVENTS=true \ HORIZON_REF=horizon-v2.27.0-rc1 \ SOROBAN_RPC_REF=v20.0.0-rc4 diff --git a/start b/start index a1b287c1..1d5013d2 100644 --- a/start +++ b/start @@ -488,7 +488,7 @@ function upgrade_local() { # Upgrade local network's soroban config to match testnet if [ $PROTOCOL_VERSION -ge 20 ]; then echo "upgrades: soroban config" - echo $NETWORK_ROOT_SECRET_KEY | stellar-core get-settings-upgrade-txs "$NETWORK_ROOT_ACCOUNT_ID" 0 "$NETWORK_PASSPHRASE" --signtxs $COREHOME/etc/config-settings-entries.json 2>/dev/null | { \ + echo $NETWORK_ROOT_SECRET_KEY | stellar-core get-settings-upgrade-txs "$NETWORK_ROOT_ACCOUNT_ID" 0 "$NETWORK_PASSPHRASE" --json $COREHOME/etc/config-settings-entries.json --signtxs 2>/dev/null | { \ read tx; \ read txid; \ echo "upgrades: soroban config: install contract: $txid .. $(curl -sG 'http://localhost:11626/tx' --data-urlencode "blob=$tx" | jq -r '.status')"; \ From 5bbadc6eccb5d37fecb81fbfe86e2ec6ddfdf368 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Mon, 30 Oct 2023 13:54:15 -0700 Subject: [PATCH 24/26] upd --- .github/workflows/build-soroban-dev.yml | 4 +-- .github/workflows/build-testing.yml | 4 +-- Makefile | 4 +-- start | 44 +++++++++++++++---------- 4 files changed, 33 insertions(+), 23 deletions(-) diff --git a/.github/workflows/build-soroban-dev.yml b/.github/workflows/build-soroban-dev.yml index e1a9eaee..dd64708f 100644 --- a/.github/workflows/build-soroban-dev.yml +++ b/.github/workflows/build-soroban-dev.yml @@ -36,7 +36,7 @@ jobs: arch: amd64 tag: soroban-dev-amd64 core_repo: https://github.com/sisuresh/stellar-core.git - core_ref: 35edba32d29c47cd78eea736afa2fdb498b6ecd2 + core_ref: v20.0.0-rc.2.2 core_supports_enable_soroban_diagnostic_events: "true" go_ref: horizon-v2.27.0-rc1 soroban_tools_ref: v20.0.0-rc4 @@ -55,7 +55,7 @@ jobs: arch: arm64 tag: soroban-dev-arm64 core_repo: https://github.com/sisuresh/stellar-core.git - core_ref: 35edba32d29c47cd78eea736afa2fdb498b6ecd2 + core_ref: v20.0.0-rc.2.2 core_supports_enable_soroban_diagnostic_events: "true" core_build_runner_type: ubuntu-latest-16-cores go_ref: horizon-v2.27.0-rc1 diff --git a/.github/workflows/build-testing.yml b/.github/workflows/build-testing.yml index f7330ec8..e7532149 100644 --- a/.github/workflows/build-testing.yml +++ b/.github/workflows/build-testing.yml @@ -38,7 +38,7 @@ jobs: arch: amd64 tag: testing-amd64 core_repo: https://github.com/sisuresh/stellar-core.git - core_ref: 35edba32d29c47cd78eea736afa2fdb498b6ecd2 + core_ref: v20.0.0-rc.2.2 core_supports_enable_soroban_diagnostic_events: "true" go_ref: horizon-v2.27.0-rc1 soroban_tools_ref: v20.0.0-rc4 @@ -60,7 +60,7 @@ jobs: arch: arm64 tag: testing-arm64 core_repo: https://github.com/sisuresh/stellar-core.git - core_ref: 35edba32d29c47cd78eea736afa2fdb498b6ecd2 + core_ref: v20.0.0-rc.2.2 core_supports_enable_soroban_diagnostic_events: "true" core_build_runner_type: ubuntu-latest-16-cores go_ref: horizon-v2.27.0-rc1 diff --git a/Makefile b/Makefile index fb2ad7d9..5bda784d 100644 --- a/Makefile +++ b/Makefile @@ -27,7 +27,7 @@ build-latest: build-testing: $(MAKE) build TAG=testing \ CORE_REPO=https://github.com/sisuresh/stellar-core.git \ - CORE_REF=35edba32d29c47cd78eea736afa2fdb498b6ecd2 \ + CORE_REF=v20.0.0-rc.2.2 \ CORE_SUPPORTS_ENABLE_SOROBAN_DIAGNOSTIC_EVENTS=true \ HORIZON_REF=horizon-v2.27.0-rc1 \ SOROBAN_RPC_REF=v20.0.0-rc4 @@ -35,7 +35,7 @@ build-testing: build-soroban-dev: $(MAKE) build TAG=soroban-dev \ CORE_REPO=https://github.com/sisuresh/stellar-core.git \ - CORE_REF=35edba32d29c47cd78eea736afa2fdb498b6ecd2 \ + CORE_REF=v20.0.0-rc.2.2 \ CORE_SUPPORTS_ENABLE_SOROBAN_DIAGNOSTIC_EVENTS=true \ HORIZON_REF=horizon-v2.27.0-rc1 \ SOROBAN_RPC_REF=v20.0.0-rc4 diff --git a/start b/start index 1d5013d2..41e885c1 100644 --- a/start +++ b/start @@ -488,23 +488,33 @@ function upgrade_local() { # Upgrade local network's soroban config to match testnet if [ $PROTOCOL_VERSION -ge 20 ]; then echo "upgrades: soroban config" - echo $NETWORK_ROOT_SECRET_KEY | stellar-core get-settings-upgrade-txs "$NETWORK_ROOT_ACCOUNT_ID" 0 "$NETWORK_PASSPHRASE" --json $COREHOME/etc/config-settings-entries.json --signtxs 2>/dev/null | { \ - read tx; \ - read txid; \ - echo "upgrades: soroban config: install contract: $txid .. $(curl -sG 'http://localhost:11626/tx' --data-urlencode "blob=$tx" | jq -r '.status')"; \ - while [ "`curl -s http://localhost:11626/metrics | jq -r '.metrics."ledger.transaction.count".count'`" != "1" ]; do sleep 1; done - read tx; \ - read txid; \ - echo "upgrades: soroban config: deploy contract: $txid .. $(curl -sG 'http://localhost:11626/tx' --data-urlencode "blob=$tx" | jq -r '.status')"; \ - while [ "`curl -s http://localhost:11626/metrics | jq -r '.metrics."ledger.transaction.count".count'`" != "2" ]; do sleep 1; done - read tx; \ - read txid; \ - echo "upgrades: soroban config: upload config: $txid .. $(curl -sG 'http://localhost:11626/tx' --data-urlencode "blob=$tx" | jq -r '.status')"; \ - while [ "`curl -s http://localhost:11626/metrics | jq -r '.metrics."ledger.transaction.count".count'`" != "3" ]; do sleep 1; done - read key; \ - echo "upgrades: soroban config: set config with key: $key"; - curl -sG 'http://localhost:11626/upgrades?mode=set&upgradetime=1970-01-01T00:00:00Z' --data-urlencode "configupgradesetkey=$key"; \ - } + # 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 $COREHOME/etc/config-settings-entries.json \ + --signtxs \ + 2>/dev/null \ + | { \ + read tx; \ + read txid; \ + echo "upgrades: soroban config: install contract: $txid .. $(curl -sG 'http://localhost:11626/tx' --data-urlencode "blob=$tx" | jq -r '.status')"; \ + while [ "`curl -s http://localhost:11626/metrics | jq -r '.metrics."ledger.transaction.count".count'`" != "1" ]; do sleep 1; done + read tx; \ + read txid; \ + echo "upgrades: soroban config: deploy contract: $txid .. $(curl -sG 'http://localhost:11626/tx' --data-urlencode "blob=$tx" | jq -r '.status')"; \ + while [ "`curl -s http://localhost:11626/metrics | jq -r '.metrics."ledger.transaction.count".count'`" != "2" ]; do sleep 1; done + read tx; \ + read txid; \ + echo "upgrades: soroban config: upload config: $txid .. $(curl -sG 'http://localhost:11626/tx' --data-urlencode "blob=$tx" | jq -r '.status')"; \ + while [ "`curl -s http://localhost:11626/metrics | jq -r '.metrics."ledger.transaction.count".count'`" != "3" ]; do sleep 1; done + read key; \ + echo "upgrades: soroban config: set config with key: $key"; + curl -sG 'http://localhost:11626/upgrades?mode=set&upgradetime=1970-01-01T00:00:00Z' --data-urlencode "configupgradesetkey=$key"; \ + } echo "upgrades: soroban config done" fi From e60c7c70e017cc4de4fe16b36eb0baf816fe7983 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Mon, 30 Oct 2023 13:57:45 -0700 Subject: [PATCH 25/26] fix --- .github/workflows/build-soroban-dev.yml | 1 - .github/workflows/build-testing.yml | 2 -- Makefile | 2 -- 3 files changed, 5 deletions(-) diff --git a/.github/workflows/build-soroban-dev.yml b/.github/workflows/build-soroban-dev.yml index dd64708f..bda94970 100644 --- a/.github/workflows/build-soroban-dev.yml +++ b/.github/workflows/build-soroban-dev.yml @@ -35,7 +35,6 @@ jobs: with: arch: amd64 tag: soroban-dev-amd64 - core_repo: https://github.com/sisuresh/stellar-core.git core_ref: v20.0.0-rc.2.2 core_supports_enable_soroban_diagnostic_events: "true" go_ref: horizon-v2.27.0-rc1 diff --git a/.github/workflows/build-testing.yml b/.github/workflows/build-testing.yml index e7532149..a2a82ebb 100644 --- a/.github/workflows/build-testing.yml +++ b/.github/workflows/build-testing.yml @@ -37,7 +37,6 @@ jobs: with: arch: amd64 tag: testing-amd64 - core_repo: https://github.com/sisuresh/stellar-core.git core_ref: v20.0.0-rc.2.2 core_supports_enable_soroban_diagnostic_events: "true" go_ref: horizon-v2.27.0-rc1 @@ -59,7 +58,6 @@ jobs: with: arch: arm64 tag: testing-arm64 - core_repo: https://github.com/sisuresh/stellar-core.git core_ref: v20.0.0-rc.2.2 core_supports_enable_soroban_diagnostic_events: "true" core_build_runner_type: ubuntu-latest-16-cores diff --git a/Makefile b/Makefile index 5bda784d..e84b70cd 100644 --- a/Makefile +++ b/Makefile @@ -26,7 +26,6 @@ build-latest: build-testing: $(MAKE) build TAG=testing \ - CORE_REPO=https://github.com/sisuresh/stellar-core.git \ CORE_REF=v20.0.0-rc.2.2 \ CORE_SUPPORTS_ENABLE_SOROBAN_DIAGNOSTIC_EVENTS=true \ HORIZON_REF=horizon-v2.27.0-rc1 \ @@ -34,7 +33,6 @@ build-testing: build-soroban-dev: $(MAKE) build TAG=soroban-dev \ - CORE_REPO=https://github.com/sisuresh/stellar-core.git \ CORE_REF=v20.0.0-rc.2.2 \ CORE_SUPPORTS_ENABLE_SOROBAN_DIAGNOSTIC_EVENTS=true \ HORIZON_REF=horizon-v2.27.0-rc1 \ From e5bae801539bf7469c16ed5de006f1cfe02ec726 Mon Sep 17 00:00:00 2001 From: Leigh McCulloch <351529+leighmcculloch@users.noreply.github.com> Date: Mon, 30 Oct 2023 14:06:28 -0700 Subject: [PATCH 26/26] fix --- .github/workflows/build-soroban-dev.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/build-soroban-dev.yml b/.github/workflows/build-soroban-dev.yml index bda94970..13839e5e 100644 --- a/.github/workflows/build-soroban-dev.yml +++ b/.github/workflows/build-soroban-dev.yml @@ -53,7 +53,6 @@ jobs: with: arch: arm64 tag: soroban-dev-arm64 - core_repo: https://github.com/sisuresh/stellar-core.git core_ref: v20.0.0-rc.2.2 core_supports_enable_soroban_diagnostic_events: "true" core_build_runner_type: ubuntu-latest-16-cores