Skip to content

Commit

Permalink
fixup! feat(cosmos): Next upgrade is 13
Browse files Browse the repository at this point in the history
  • Loading branch information
mhofman committed Nov 29, 2023
1 parent ec8afeb commit 30970d8
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 29 deletions.
16 changes: 8 additions & 8 deletions packages/deployment/upgrade-test/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
# Defaults
ARG BASE_IMAGE=ghcr.io/agoric/agoric-3-proposals@sha256:ac10c09b5927d759d37b1525b5a0bc4aeb3034df8d0f0fbb15b51203555ffb1b
ARG BASE_IMAGE=ghcr.io/agoric/agoric-3-proposals:pr-33
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

# UPGRADE
FROM ${BASE_IMAGE} as propose-agoric-upgrade-12
ARG BOOTSTRAP_MODE UPGRADE_INFO_12
ENV THIS_NAME= UPGRADE_TO=agoric-upgrade-12 UPGRADE_INFO=${UPGRADE_INFO_12} BOOTSTRAP_MODE=${BOOTSTRAP_MODE}
FROM ${BASE_IMAGE} as propose-agoric-upgrade-13
ARG BOOTSTRAP_MODE UPGRADE_INFO_13
ENV THIS_NAME= UPGRADE_TO=agoric-upgrade-13 UPGRADE_INFO=${UPGRADE_INFO_13} BOOTSTRAP_MODE=${BOOTSTRAP_MODE}

WORKDIR /usr/src/agoric-sdk/
COPY --chmod=755 ./env_setup.sh ./start_to_to.sh ./upgrade-test-scripts/
SHELL ["/bin/bash", "-c"]
RUN . ./upgrade-test-scripts/start_to_to.sh

# DEST (TEST)
#this is agoric-upgrade-12 / multi-collateral, etc.
#this is agoric-upgrade-13
ARG DEST_IMAGE
FROM ${DEST_IMAGE} as agoric-upgrade-12
FROM ${DEST_IMAGE} as agoric-upgrade-13
ARG BOOTSTRAP_MODE
ENV THIS_NAME=agoric-upgrade-12 BOOTSTRAP_MODE=${BOOTSTRAP_MODE} USE_JS=1
COPY --from=propose-agoric-upgrade-12 /root/.agoric /root/.agoric
ENV THIS_NAME=agoric-upgrade-13 BOOTSTRAP_MODE=${BOOTSTRAP_MODE} USE_JS=1
COPY --from=propose-agoric-upgrade-13 /root/.agoric /root/.agoric
# start-chain boilerplate
WORKDIR /usr/src/agoric-sdk/
COPY ./env_setup.sh ./start_to_to.sh ./package.json ./*.js ./upgrade-test-scripts/
Expand Down
12 changes: 6 additions & 6 deletions packages/deployment/upgrade-test/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ 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
TARGET?=agoric-upgrade-12
TARGET?=agoric-upgrade-13
dockerLabel?=$(TARGET)
@echo target: $(TARGET)

Expand All @@ -13,11 +13,11 @@ BUILD = docker build --progress=plain $(BUILD_OPTS) \
--build-arg BOOTSTRAP_MODE=$(BOOTSTRAP_MODE) --build-arg DEST_IMAGE=$(DEST_IMAGE) \
-f Dockerfile upgrade-test-scripts

propose-agoric-upgrade-12:
$(BUILD) --target propose-agoric-upgrade-12 -t $(REPOSITORY):propose-agoric-upgrade-12$(TAG_SUFFIX)
propose-agoric-upgrade-13:
$(BUILD) --target propose-agoric-upgrade-13 -t $(REPOSITORY):propose-agoric-upgrade-13$(TAG_SUFFIX)

agoric-upgrade-12: propose-agoric-upgrade-12
$(BUILD) --target agoric-upgrade-12 -t $(REPOSITORY):agoric-upgrade-12$(TAG_SUFFIX)
agoric-upgrade-13: propose-agoric-upgrade-13
$(BUILD) --target agoric-upgrade-13 -t $(REPOSITORY):agoric-upgrade-13$(TAG_SUFFIX)

# build main bootstrap
build: $(TARGET)
Expand All @@ -43,4 +43,4 @@ run_test:
shell:
docker exec -it `docker ps --latest --format json | jq -r .Names` bash

.PHONY: local_sdk agoric-upgrade-7-2 agoric-upgrade-8 agoric-upgrade-8-1 agoric-upgrade-9 agoric-upgrade-10 agoric-upgrade-11 agoric-upgrade-12 build build_test run
.PHONY: local_sdk agoric-upgrade-13 build build_test run
8 changes: 4 additions & 4 deletions packages/deployment/upgrade-test/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,12 @@ To make the wallet ui talk to your local chain, set the network config to
1. Update the upgrade handler in app.go
2. Duplicate the last pair of UPGRADE and TEST blocks
3. Update their number from the UPGRADE / DEST block at the end
4. Make directory for tests (e.g. `agoric-upgrade-12`)
4. Make directory for ugprade (e.g. `propose-agoric-upgrade-12` with a `.keep`)
4. Make directory for tests (e.g. `agoric-upgrade-13`)
4. Make directory for ugprade (e.g. `propose-agoric-upgrade-13` with a `.keep`)
5. Update the UPGRADE/DEST pair to be your new upgrade (THIS_NAME matching the upgrade handler string in app.go)
6. Update the `Makefile`
- the two targets to `Makefile` (e.g. `propose-agoric-upgrade-12` and `agoric-upgrade-12`)
- set the default TARGET (e.g. `agoric-upgrade-12`)
- the two targets to `Makefile` (e.g. `propose-agoric-upgrade-13` and `agoric-upgrade-13`)
- set the default TARGET (e.g. `agoric-upgrade-13`)
- add the DEST target to the `.phony` in `Makefile`
7. Test with `make local_sdk build run`

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,3 @@ test(`Ensure Zoe Vat is at 0`, async t => {
const incarnation = await getIncarnation('zoe');
t.is(incarnation, 0);
});

test('Ensure MaxBytes param was updated', async t => {
const { value: rawParams } = await agd.query(
'params',
'subspace',
'baseapp',
'BlockParams',
);
const blockParams = JSON.parse(rawParams);
t.is(blockParams.max_bytes, '5242880');
});

0 comments on commit 30970d8

Please sign in to comment.