-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(bundle-cost): reduce by 100x as in mainnet 61 #75
Changes from all commits
0a63204
1198b67
f9aa2fa
bc6dac6
2691d42
9df5b42
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
proposer-61.json | ||
tx-hist-proposer-61.json |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
nodeLinker: node-modules |
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 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why two cleans? please comment for naming, it's odd to imply that the other isn't real. consider but I'd prefer to have There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The difference in this case is: re-fetching from the network is expensive / wasteful while I was rapidly iterating on the Will comment... |
||
rm -f tx-61.json proposer-61.json tx-hist-proposer-61.json |
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 | ||
|
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" | ||
} | ||
] | ||
} | ||
] | ||
} |
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]" | ||
} |
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 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On first read I thought this was able to build dynamically from the ARCHIVE_NODE.
Please comment how this Makefile is intended to be used.
Incidentally, I suggest that
lower-bundle-cost.json
be produced during the build since it's a fast local operation to create fromtx-61.json
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added some comments. I don't think I quite covered this though. Feel free to add more or discuss it or something.
I don't have a good sense of how the work should be partitioned in EVAL vs other stuff, so I'll leave this to you.