-
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.
Merge pull request #75 from Agoric/dc-bundle-cost
feat(bundle-cost): reduce by 100x as in mainnet 61
- Loading branch information
Showing
11 changed files
with
1,797 additions
and
2 deletions.
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
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
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,2 @@ | ||
proposer-61.json | ||
tx-hist-proposer-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 @@ | ||
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
# reverse-engineer Proposal 61: Lower bundle cost | ||
|
||
# `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 >$@ | ||
|
||
PROPOSAL=61 | ||
proposer-61.json: | ||
agd --node $(ARCHIVE_NODE) query gov proposer $(PROPOSAL) -o json >$@ | ||
|
||
tx-hist-proposer-61.json: proposer-61.json | ||
PROPOSER="$$(jq -r .proposer proposer-61.json)"; \ | ||
agd --node $(ARCHIVE_NODE) query txs --events="message.sender=$$PROPOSER" -o json >$@ | ||
|
||
tx-61.json: tx-hist-proposer-61.json | ||
jq '.txs | .[] | select(.tx.body.messages[0].content["@type"] == "/cosmos.params.v1beta1.ParameterChangeProposal")' \ | ||
tx-hist-proposer-61.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 proposer-61.json tx-hist-proposer-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,49 @@ | ||
{ | ||
"@type": "/cosmos.params.v1beta1.ParameterChangeProposal", | ||
"title": "Lower Bundle Cost ", | ||
"description": "As developers we continue to build upon Agoric blockchain's capabilities; however, one pressing challenge that our community faces is the high cost associated with installing bundles on-chain.\n\nCurrently, the cost stands at approximately 0.002 IST/byte or $2 per kilobyte (KB) (see [DefaultBeansPerStorageByte parameter](https://github.com/Agoric/agoric-sdk/blob/ac9f916a844f06db1c43e9cc69a948d9c3528a4e/golang/cosmos/x/swingset/types/default-params.go#L51)), a rate that significantly restricts participation and innovation, particularly for developers and projects that require deploying large or numerous smart contracts and applications on Agoric blockchain.\n\nTo address the outlined issues and foster a more inclusive and innovative environment, we’d like to propose reducing the cost of installing a bundle on-chain from $2/KB to $0.02/KB.", | ||
"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" | ||
} | ||
] | ||
} | ||
] | ||
} |
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.