Skip to content

Commit

Permalink
remove BOOTSTRAP_MODE
Browse files Browse the repository at this point in the history
It only tested toy denoms, which we don't need to do
  • Loading branch information
turadg committed Oct 23, 2023
1 parent d46e671 commit fb9bdbd
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 63 deletions.
33 changes: 13 additions & 20 deletions upgrade-test/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Defaults
ARG DEST_IMAGE=ghcr.io/agoric/agoric-sdk:dev
ARG BOOTSTRAP_MODE=main

# TODO different naming scheme for upgrade handler (in app.go) and the image name

Expand All @@ -15,10 +14,8 @@ ARG BOOTSTRAP_MODE=main
## START
# on agoric-uprade-7-2, with upgrade to agoric-upgrade-8
FROM ghcr.io/agoric/ag0:agoric-upgrade-7-2 as agoric-upgrade-7-2
ARG BOOTSTRAP_MODE
ARG UPGRADE_INFO_8
ENV UPGRADE_TO=agoric-upgrade-8 UPGRADE_INFO=${UPGRADE_INFO_8} THIS_NAME=agoric-upgrade-7-2 BOOTSTRAP_MODE=${BOOTSTRAP_MODE}
RUN echo "${BOOTSTRAP_MODE}"
ENV UPGRADE_TO=agoric-upgrade-8 UPGRADE_INFO=${UPGRADE_INFO_8} THIS_NAME=agoric-upgrade-7-2
RUN mkdir -p /usr/src/agoric-sdk/upgrade-test-scripts
WORKDIR /usr/src/agoric-sdk/
COPY ./start_ag0.sh ./upgrade-test-scripts/
Expand All @@ -30,8 +27,7 @@ RUN . ./upgrade-test-scripts/start_ag0.sh
## UPGRADE+TEST
## this is agoric-upgrade-8 aka pismoA
FROM ghcr.io/agoric/agoric-sdk:29 as agoric-upgrade-8
ARG BOOTSTRAP_MODE
ENV THIS_NAME=agoric-upgrade-8 BOOTSTRAP_MODE=${BOOTSTRAP_MODE}
ENV THIS_NAME=agoric-upgrade-8
# copy from previous build
COPY --from=agoric-upgrade-7-2 /root/.agoric /root/.agoric

Expand All @@ -47,8 +43,8 @@ RUN . ./upgrade-test-scripts/start_to_to.sh
ARG DEST_IMAGE
#this is agoric-upgrade-8-1 aka pismoB
FROM ghcr.io/agoric/agoric-sdk:30 as agoric-upgrade-8-1
ARG BOOTSTRAP_MODE UPGRADE_INFO_9
ENV THIS_NAME=agoric-upgrade-8-1 UPGRADE_TO=agoric-upgrade-9 UPGRADE_INFO=${UPGRADE_INFO_9} BOOTSTRAP_MODE=${BOOTSTRAP_MODE}
ARG UPGRADE_INFO_9
ENV THIS_NAME=agoric-upgrade-8-1 UPGRADE_TO=agoric-upgrade-9 UPGRADE_INFO=${UPGRADE_INFO_9}
WORKDIR /usr/src/agoric-sdk/
COPY ./env_setup.sh ./start_to_to.sh ./upgrade-test-scripts/
COPY ./${THIS_NAME} ./upgrade-test-scripts/${THIS_NAME}/
Expand All @@ -61,8 +57,8 @@ RUN . ./upgrade-test-scripts/start_to_to.sh
ARG DEST_IMAGE
# this is agoric-upgrade-9 / pismoC with upgrade to agoric-upgrade-10
FROM ghcr.io/agoric/agoric-sdk:31 as agoric-upgrade-9
ARG BOOTSTRAP_MODE UPGRADE_INFO_10
ENV THIS_NAME=agoric-upgrade-9 UPGRADE_TO=agoric-upgrade-10 UPGRADE_INFO=${UPGRADE_INFO_10} BOOTSTRAP_MODE=${BOOTSTRAP_MODE}
ARG UPGRADE_INFO_10
ENV THIS_NAME=agoric-upgrade-9 UPGRADE_TO=agoric-upgrade-10 UPGRADE_INFO=${UPGRADE_INFO_10}

WORKDIR /usr/src/agoric-sdk/
COPY ./env_setup.sh ./start_to_to.sh ./upgrade-test-scripts/
Expand All @@ -77,8 +73,7 @@ RUN . ./upgrade-test-scripts/start_to_to.sh
ARG DEST_IMAGE
#this is agoric-upgrade-10 / vaults
FROM ghcr.io/agoric/agoric-sdk:35 as agoric-upgrade-10
ARG BOOTSTRAP_MODE
ENV THIS_NAME=agoric-upgrade-10 USE_JS=1 BOOTSTRAP_MODE=${BOOTSTRAP_MODE}
ENV THIS_NAME=agoric-upgrade-10 USE_JS=1

WORKDIR /usr/src/agoric-sdk/
COPY ./env_setup.sh ./start_to_to.sh ./package.json ./*.js ./upgrade-test-scripts/
Expand All @@ -96,8 +91,8 @@ ARG DEST_IMAGE
#this is agoric-upgrade-10 upgrading to 11
#it's a separate target because agoric-upgrade-10 takes so long to test
FROM ghcr.io/agoric/agoric-sdk:35 as propose-agoric-upgrade-11
ARG BOOTSTRAP_MODE UPGRADE_INFO_11
ENV THIS_NAME=propose-agoric-upgrade-11 UPGRADE_TO=agoric-upgrade-11 UPGRADE_INFO=${UPGRADE_INFO_11} BOOTSTRAP_MODE=${BOOTSTRAP_MODE}
ARG UPGRADE_INFO_11
ENV THIS_NAME=propose-agoric-upgrade-11 UPGRADE_TO=agoric-upgrade-11 UPGRADE_INFO=${UPGRADE_INFO_11}
WORKDIR /usr/src/agoric-sdk/
COPY ./env_setup.sh ./start_to_to.sh ./upgrade-test-scripts/
RUN cd upgrade-test-scripts && yarn
Expand All @@ -113,8 +108,7 @@ RUN . ./upgrade-test-scripts/start_to_to.sh
#this is agoric-upgrade-11 / vaults+1
ARG DEST_IMAGE
FROM ghcr.io/agoric/agoric-sdk:36 as agoric-upgrade-11
ARG BOOTSTRAP_MODE
ENV THIS_NAME=agoric-upgrade-11 BOOTSTRAP_MODE=${BOOTSTRAP_MODE} USE_JS=1
ENV THIS_NAME=agoric-upgrade-11 USE_JS=1
# start-chain boilerplate
WORKDIR /usr/src/agoric-sdk/
COPY ./env_setup.sh ./start_to_to.sh ./package.json ./*.js ./upgrade-test-scripts/
Expand All @@ -131,8 +125,8 @@ RUN . ./upgrade-test-scripts/start_to_to.sh
ARG DEST_IMAGE
FROM ghcr.io/agoric/agoric-sdk:36 as propose-agoric-upgrade-12
# TODO: Replace with actual Zoe core proposal for upgrade 12 (MCS, Kread, Zoe, restart-contracts, etc)
ARG BOOTSTRAP_MODE UPGRADE_INFO_12='{"coreProposals":["@agoric/builders/scripts/vats/init-network.js"]}'
ENV THIS_NAME=propose-agoric-upgrade-12 UPGRADE_TO=agoric-upgrade-12 UPGRADE_INFO=${UPGRADE_INFO_12} BOOTSTRAP_MODE=${BOOTSTRAP_MODE}
ARG UPGRADE_INFO_12='{"coreProposals":["@agoric/builders/scripts/vats/init-network.js"]}'
ENV THIS_NAME=propose-agoric-upgrade-12 UPGRADE_TO=agoric-upgrade-12 UPGRADE_INFO=${UPGRADE_INFO_12}
COPY --from=agoric-upgrade-11 /root/.agoric /root/.agoric
# start-chain boilerplate
WORKDIR /usr/src/agoric-sdk/
Expand All @@ -149,8 +143,7 @@ RUN . ./upgrade-test-scripts/start_to_to.sh
#this is agoric-upgrade-12 / multi-collateral, etc.
ARG DEST_IMAGE
FROM ${DEST_IMAGE} as agoric-upgrade-12
ARG BOOTSTRAP_MODE
ENV THIS_NAME=agoric-upgrade-12 BOOTSTRAP_MODE=${BOOTSTRAP_MODE}
ENV THIS_NAME=agoric-upgrade-12
COPY --from=propose-agoric-upgrade-12 /root/.agoric /root/.agoric
# start-chain boilerplate
WORKDIR /usr/src/agoric-sdk/
Expand Down
12 changes: 1 addition & 11 deletions upgrade-test/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
REPOSITORY = agoric/upgrade-test
# use :dev (latest prerelease image) unless we build local sdk
DEST_IMAGE ?= $(if $(findstring local_sdk,$(MAKECMDGOALS)),ghcr.io/agoric/agoric-sdk:latest,ghcr.io/agoric/agoric-sdk:dev)
BOOTSTRAP_MODE?=main
ifeq ($(BOOTSTRAP_MODE),main)
TAG_SUFFIX=
else
TAG_SUFFIX=-$(BOOTSTRAP_MODE)
endif
TARGET?=agoric-upgrade-12
dockerLabel?=$(TARGET)
@echo target: $(TARGET)
Expand All @@ -15,7 +9,7 @@ local_sdk:
(cd ../ && make docker-build-sdk)

BUILD = docker build --progress=plain $(BUILD_OPTS) \
--build-arg BOOTSTRAP_MODE=$(BOOTSTRAP_MODE) --build-arg DEST_IMAGE=$(DEST_IMAGE) \
--build-arg DEST_IMAGE=$(DEST_IMAGE) \
-f Dockerfile upgrade-test-scripts

agoric-upgrade-7-2:
Expand Down Expand Up @@ -48,10 +42,6 @@ agoric-upgrade-12: propose-agoric-upgrade-12
# build main bootstrap
build: $(TARGET)

# build test bootstrap
build_test: BOOTSTRAP_MODE=test
build_test: $(TARGET)

DEBUG ?= SwingSet:ls,SwingSet:vat
RUN = docker run --rm -it \
-p 26656:26656 -p 26657:26657 -p 1317:1317 \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
GOV1ADDR,
GOV2ADDR,
GOV3ADDR,
BOOTSTRAP_MODE,
PSM_PAIR,
} from '../constants.js';
import { openVault } from '../econHelpers.js';
Expand Down Expand Up @@ -99,12 +98,7 @@ test('Validate PSM denoms', async t => {

t.not(psmISTChildren.children.legnth, 0);

let denoms = ['USDC_axl', 'DAI_axl', 'DAI_grv'];
if (BOOTSTRAP_MODE === 'main') {
denoms = [...denoms, 'USDC_grv', 'USDT_axl', 'USDT_grv'];
} else {
denoms = [...denoms, 'ToyUSD'];
}
const denoms = ['USDC_axl', 'DAI_axl', 'DAI_grv', 'USDC_grv', 'USDT_axl', 'USDT_grv'];

for (const denom of denoms) {
t.truthy(psmISTChildren.children.includes(denom));
Expand Down
9 changes: 2 additions & 7 deletions upgrade-test/upgrade-test-scripts/agoric-upgrade-9/test.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
#!/bin/bash
. ./upgrade-test-scripts/env_setup.sh
# provision pool has right balance
# provision pool has right balance
test_val $(agd query bank balances agoric1megzytg65cyrgzs6fvzxgrcqvwwl7ugpt62346 -o json | jq -r '.balances | first | .amount') "19000000"

# ensure PSM IST has only ToyUSD
expnum=4
if [[ "$BOOTSTRAP_MODE" == "test" ]]; then
expnum=1
fi
test_val $(agd q vstorage children published.psm.IST -o json | jq -r '.children | length') "$expnum"
test_val $(agd q vstorage children published.psm.IST -o json | jq -r '.children | length') 4
test_val $(agd q vstorage children published.psm.IST -o json | jq -r '.children | first') ${PSM_PAIR//IST./}

# Gov params
Expand Down
1 change: 0 additions & 1 deletion upgrade-test/upgrade-test-scripts/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ export const GOV3ADDR = process.env.GOV3ADDR;
export const USER1ADDR = process.env.USER1ADDR;
export const VALIDATORADDR = process.env.VALIDATORADDR;

export const BOOTSTRAP_MODE = process.env.BOOTSTRAP_MODE;
export const PSM_PAIR = process.env.PSM_PAIR;
export const ATOM_DENOM = process.env.ATOM_DENOM;

Expand Down
12 changes: 3 additions & 9 deletions upgrade-test/upgrade-test-scripts/env_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -239,15 +239,9 @@ printKeys() {
}


export USDC_DENOM="ibc/toyusdc"
# Recent transfer to Emerynet
export ATOM_DENOM="ibc/06362C6F7F4FB702B94C13CD2E7C03DEC357683FD978936340B43FBFBC5351EB"
export PSM_PAIR="IST.ToyUSD"
if [[ "$BOOTSTRAP_MODE" == "main" ]]; then
export USDC_DENOM="ibc/295548A78785A1007F232DE286149A6FF512F180AF5657780FC89C009E2C348F"
export ATOM_DENOM="ibc/BA313C4A19DFBF943586C0387E6B11286F9E416B4DD27574E6909CABE0E342FA"
export PSM_PAIR="IST.USDC_axl"
fi
export USDC_DENOM="ibc/295548A78785A1007F232DE286149A6FF512F180AF5657780FC89C009E2C348F"
export ATOM_DENOM="ibc/BA313C4A19DFBF943586C0387E6B11286F9E416B4DD27574E6909CABE0E342FA"
export PSM_PAIR="IST.USDC_axl"

# additional env specific to a version
if test -f ./upgrade-test-scripts/$THIS_NAME/env_setup.sh; then
Expand Down
3 changes: 0 additions & 3 deletions upgrade-test/upgrade-test-scripts/start_ag0.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ waitForBlock 2
voting_period_s=10
latest_height=$(ag0 status | jq -r .SyncInfo.latest_block_height)
height=$(( $latest_height + $voting_period_s + 10 ))
if [[ "$BOOTSTRAP_MODE" == "test" ]]; then
UPGRADE_TO=${UPGRADE_TO//agoric-/agorictest-}
fi

info=${UPGRADE_INFO-"{}"}
if echo "$info" | jq .; then :
Expand Down
5 changes: 0 additions & 5 deletions upgrade-test/upgrade-test-scripts/start_to_to.sh
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,6 @@ if [[ "$DEST" != "1" ]]; then
exit 0
fi

if [[ "$BOOTSTRAP_MODE" == "test" ]]; then
UPGRADE_TO=${UPGRADE_TO//agoric-/agorictest-}
fi


voting_period_s=10
latest_height=$(agd status | jq -r .SyncInfo.latest_block_height)
height=$(( $latest_height + $voting_period_s + 10 ))
Expand Down

0 comments on commit fb9bdbd

Please sign in to comment.