Loadgen vault close causes `amountGiven or amountWanted must be greater than 0`
See original GitHub issueDescribe the bug
After https://github.com/Agoric/agoric-sdk/pull/4026 landed, the chain started to print errors in the stderr (in verbose mode) when the loadgen’s create-vault task performs a vault close.
To Reproduce
Steps to reproduce the behavior:
- Checkout
agoric-sdkon revisionb605a6aor more recent, yarn && yarn build && make -C packages/cosmic-swingset- make sure
agoricis in the $PATH (yarn link-cli) - Checkout the
mhofman/report-stage-resultsbranch of https://github.com/Agoric/testnet-load-generator/tree/mhofman/report-stage-results. The following all takes place in thetestnet-load-generatordirectory. agoric install- In first terminal:
agoric start local-chain --verbose - In second terminal, after chain reaches a few blocks in height:
agoric start local-solo 8000 --verbose - In a third terminal, after the client shows
Deployed Wallet!in the output:yarn loadgen - In a fourth terminal, after the loadgen is ready:
curl -X PUT --data '{"vault":{"interval":600}}' http://127.0.0.1:3352/config - During the vault task, the following error is thrown and printed in the chain output:
amountGiven or amountWanted must be greater than 0: {"brand":"[Alleged: RUN brand]","value":"[0n]"} {"brand":"[Alleged: BLD brand]","value":"[0n]"}
Expected behavior
No error in output
Platform Environment
- Debian based Docker image under WSL2
- Not an usual environment it’s not relevant to this bug
agoric-sdkrevisionb605a6a
Additional context
Strangely the close offer succeeds, and the error is never surfaced to the client making requests.
This is the relevant create-vault code: https://github.com/Agoric/testnet-load-generator/blob/834421d023adb036f09eeb5500326b6fe9ff2499/loadgen/contract/agent-create-vault.js#L91-L105
Screenshots
The relevant output of 2 cycles run before and after the PR landed: https://gist.github.com/mhofman/a07bc58efccd7cb42f9fb31814df8fe4
This is the deliveries resulting from the relevant loadgen code above:
[
[ 211, '211:194:deliver:ro+85:makeCloseInvitation:rp-229;[]' ],
[
212,
'212:194:deliver:ro+51:withdraw:rp-230:ro+48;[{"brand":{"@qclass":"slot","iface":"Alleged: RUN brand","index":0},"value":{"@qclass":"bigint","digits":"76708106"}}]'
],
[
213,
'213:194:deliver:ro+32:offer:rp-231:rp-229:ro+48:ro+46:rp-230;[{"@qclass":"slot","index":0},{"give":{"RUN":{"brand":{"@qclass":"slot","iface":"Alleged: RUN brand","index":1},"value":{"@qclass":"bigint","digits":"76708106"}}},"want":{"Collateral":{"brand":{"@qclass":"slot","iface":"Alleged: BLD brand","index":2},"value":{"@qclass":"bigint","digits":"0"}}}},{"RUN":{"@qclass":"slot","index":3}}]'
],
[ 214, '214:194:deliver:rp-231:getPayout:rp-232;["RUN"]' ],
[ 215, '215:194:deliver:rp-231:getPayout:rp-233;["Collateral"]' ]
]
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (8 by maintainers)
Top Results From Across the Web
No results found
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

closeHook()callsupdateUiState().updateUiState()callsgetCollateralizationRatio(), which asks the priceAuthority for the current value of the collateral (even when the collateral has been reduced to zero.) As I mentioned above,swapno longer gives a helpful answer when asked for the price of zero of the collateral. grumbleThis is a bug in the AMM that is affecting loadgen.