Skip to content
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

fix: lower bundle storage cost to 0.02 IST / Kb like mainnet #24

Merged
merged 2 commits into from
Jan 10, 2024

Conversation

dckc
Copy link
Member

@dckc dckc commented Dec 23, 2023

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.

Considering this dapp is our first example, this code is hardly exemplary.
It's more make/shell code with poor error handling and incomplete/manual synchronization.
It's a short-cut instead of waiting for Agoric/agoric-3-proposals#28

Is it worth landing anyway?

Is it fair to say:
fixes: #3

Or should we keep #3 open until we land better code?

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.
Comment on lines 30 to 32
# 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 \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the overall approach, but it's difficult to comprehend scripts/lower-bundle-cost.json because there's so much extraneous detail. Suggestion: construct it dynamically to make clear what is changing.

Suggested change
# 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 \
/tmp/lower-bundle-cost.json: .PHONY
# Read current swingset params JSON,
# extract beans_per_unit,
# replace the "storageByte" value per https://agoric.explorers.guru/proposal/61 ,
# and wrap the result in a proposal.
agd query swingset params -o json | awk '!in_json { sub(/^[^{]*/, ""); in_json=$$0; } in_json' | \
jq '.beans_per_unit | map(if .key == "storageByte" then .beans |= "20000000" else . end)' | \
jq \
--arg title 'Lower Bundle Cost to 0.02 IST/Kb (a la mainnet 61)' \
--arg description '0.02 IST/Kb' \
--arg deposit 10000000ubld \
--argjson change '{ "subspace": "swingset", "key": "beans_per_unit", "value": "..." }' \
'. as $$newVal | { title: $$title, description: $$description, deposit: $$deposit, changes: [$$change | .value |= $$newVal] }' \
> /tmp/lower-bundle-cost.json
lower-bundle-cost: /tmp/lower-bundle-cost.json
agd tx gov submit-proposal param-change /tmp/lower-bundle-cost.json \

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll see what it looks like to do that in js.

@dckc dckc merged commit 853c415 into main Jan 10, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

obsolete mint4k step in favor of mainnet proposal 61
2 participants