From 80320abb98555ccd668261156f05a26483d028bb Mon Sep 17 00:00:00 2001 From: Dan Connolly Date: Fri, 22 Dec 2023 18:56:49 -0600 Subject: [PATCH] fix: lower bundle storage cost to 0.02 IST / Kb like mainnet Minting IST can't be skipped altogether; we still need _some_. But we can mint just 100 and only 1 time, rather than 4k several times. --- contract/Makefile | 15 ++++++ contract/scripts/install-bundles.sh | 4 -- contract/scripts/lower-bundle-cost.json | 49 +++++++++++++++++++ contract/scripts/run-chain.sh | 3 +- contract/scripts/voteLatestProposalAndWait.sh | 5 ++ 5 files changed, 71 insertions(+), 5 deletions(-) create mode 100644 contract/scripts/lower-bundle-cost.json create mode 100755 contract/scripts/voteLatestProposalAndWait.sh diff --git a/contract/Makefile b/contract/Makefile index ab99344..31d865d 100644 --- a/contract/Makefile +++ b/contract/Makefile @@ -21,6 +21,21 @@ SIGN_BROADCAST_OPTS=--keyring-backend=test --chain-id=$(CHAINID) \ --gas=auto --gas-adjustment=$(GAS_ADJUSTMENT) \ --yes -b block +mint100: + make FUNDS=1000$(ATOM) fund-acct + cd /usr/src/agoric-sdk && \ + yarn --silent agops vaults open --wantMinted 100 --giveCollateral 100 >/tmp/want-ist.json && \ + yarn --silent agops perf satisfaction --executeOffer /tmp/want-ist.json --from user1 --keyring-backend=test + +# https://agoric.explorers.guru/proposal/61 +lower-bundle-cost: scripts/lower-bundle-cost.json ./scripts/voteLatestProposalAndWait.sh + agd tx gov submit-proposal param-change scripts/lower-bundle-cost.json \ + $(SIGN_BROADCAST_OPTS) \ + --from user1 + ./scripts/voteLatestProposalAndWait.sh + # agd query swingset params + +# Keep mint4k around a while for compatibility mint4k: make FUNDS=1000$(ATOM) fund-acct cd /usr/src/agoric-sdk && \ diff --git a/contract/scripts/install-bundles.sh b/contract/scripts/install-bundles.sh index edf04f9..6736aa6 100755 --- a/contract/scripts/install-bundles.sh +++ b/contract/scripts/install-bundles.sh @@ -16,10 +16,6 @@ install_bundle() { # exit fail if bundle-list is emtpy [ -s bundles/bundle-list ] || exit 1 -# TODO: avoid needing so much IST -# https://github.com/agoric-labs/dapp-game-places/issues/3 -make mint4k -make mint4k make balance-q # do we have enough IST? for b in $(cat bundles/bundle-list); do diff --git a/contract/scripts/lower-bundle-cost.json b/contract/scripts/lower-bundle-cost.json new file mode 100644 index 0000000..5b4d931 --- /dev/null +++ b/contract/scripts/lower-bundle-cost.json @@ -0,0 +1,49 @@ +{ + "title": "Lower Bundle Cost to 0.02 IST/Kb (a la mainnet 61)", + "description": "0.02 IST/Kb", + "deposit": "10000000ubld", + "changes": [ + { + "subspace": "swingset", + "key": "beans_per_unit", + "value": [ + { + "key": "blockComputeLimit", + "beans": "6500000000" + }, + { + "key": "feeUnit", + "beans": "1000000000000" + }, + { + "key": "inboundTx", + "beans": "10000000000" + }, + { + "key": "message", + "beans": "1000000000" + }, + { + "key": "messageByte", + "beans": "20000000" + }, + { + "key": "minFeeDebit", + "beans": "200000000000" + }, + { + "key": "vatCreation", + "beans": "30000000" + }, + { + "key": "xsnapComputron", + "beans": "100" + }, + { + "key": "storageByte", + "beans": "20000000" + } + ] + } + ] +} \ No newline at end of file diff --git a/contract/scripts/run-chain.sh b/contract/scripts/run-chain.sh index b0a14b1..6534eae 100755 --- a/contract/scripts/run-chain.sh +++ b/contract/scripts/run-chain.sh @@ -63,7 +63,8 @@ waitForBlock 2 # Approve any proposals forever in the background. approveProposals & -make -C /workspace/contract mint4k +make -C /workspace/contract mint100 +make -C /workspace/contract lower-bundle-cost # bring back chain process to foreground wait diff --git a/contract/scripts/voteLatestProposalAndWait.sh b/contract/scripts/voteLatestProposalAndWait.sh new file mode 100755 index 0000000..dd303f4 --- /dev/null +++ b/contract/scripts/voteLatestProposalAndWait.sh @@ -0,0 +1,5 @@ +#!/bin/bash +set -ueo pipefail + +. /usr/src/upgrade-test-scripts/env_setup.sh +voteLatestProposalAndWait