-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(bundle-cost): lower cost by 100x as in mainnet 61
- Loading branch information
Showing
6 changed files
with
1,337 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
nodeLinker: node-modules |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,24 @@ | ||
# reverse-engineer Proposal 61: Lower bundle cost | ||
|
||
lower-bundle-cost.json: | ||
# `agd tx gov submit-proposal param-change` seems | ||
# to JSON.stringify the value in the proposal. | ||
# So we need to `fromjson` it before feeding it back to `agd`. | ||
lower-bundle-cost.json: tx-61.json | ||
jq '.tx.body.messages[0].content | .changes[0].value |= fromjson' tx-61.json >$@ | ||
|
||
# To get the hash of the tx for proposal 61, | ||
# we found the proposer (either using an explorer or | ||
# `agd --node $ARCHIVE_NODE query gov proposer 61`) | ||
# and looked at their transaction history. | ||
hash=6EA7B46DFDD0973338BB50781B33D651FE0E8EE8ABF4D7BCB1BF8235334AAFE0 | ||
ARCHIVE_NODE="https://main-a.rpc.agoric.net:443" | ||
tx-61.json: | ||
agd --node $(ARCHIVE_NODE) query tx $(hash) -o json >$@ | ||
|
||
# clean up locally computed files | ||
clean: | ||
rm -f lower-bundle-cost.json | ||
|
||
# clean up files cached from the network as well | ||
realclean: clean | ||
rm -f tx-61.json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
|
||
# Exit when any command fails | ||
set -e | ||
|
||
source /usr/src/upgrade-test-scripts/env_setup.sh | ||
|
||
GAS_ADJUSTMENT=1.2 | ||
SIGN_BROADCAST_OPTS="--keyring-backend=test --chain-id=$CHAINID \ | ||
--gas=auto --gas-adjustment=$GAS_ADJUSTMENT \ | ||
--yes -b block" | ||
|
||
agd tx gov submit-proposal param-change lower-bundle-cost.json \ | ||
$SIGN_BROADCAST_OPTS --from validator | ||
|
||
voteLatestProposalAndWait | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"agoricProposal": { | ||
"type": "/cosmos.params.v1beta1.ParameterChangeProposal" | ||
}, | ||
"type": "module", | ||
"license": "Apache-2.0", | ||
"dependencies": { | ||
"@agoric/synthetic-chain": "0.0.7" | ||
}, | ||
"scripts": { | ||
"agops": "yarn --cwd /usr/src/agoric-sdk/ --silent agops" | ||
}, | ||
"ava": { | ||
"timeout": "30s" | ||
}, | ||
"packageManager": "[email protected]" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
#!/bin/bash | ||
set -e | ||
|
||
expected=20000000 | ||
|
||
params="$(agd query swingset params -o json)" | ||
cost="$(echo $params | jq -r ".beans_per_unit | .[] | select(.key == \"storageByte\") | .beans" )" | ||
|
||
# fail if cost is not expected | ||
if [ "$cost" != "$expected" ]; then | ||
echo "Expected cost $expected, got $cost" | ||
exit 1 | ||
else | ||
echo "Cost is $cost" | ||
fi | ||
|
Oops, something went wrong.