question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Loadgen vault close causes `amountGiven or amountWanted must be greater than 0`

See original GitHub issue

Describe 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:

  1. Checkout agoric-sdk on revision b605a6a or more recent,
  2. yarn && yarn build && make -C packages/cosmic-swingset
  3. make sure agoric is in the $PATH (yarn link-cli)
  4. Checkout the mhofman/report-stage-results branch of https://github.com/Agoric/testnet-load-generator/tree/mhofman/report-stage-results. The following all takes place in the testnet-load-generator directory.
  5. agoric install
  6. In first terminal: agoric start local-chain --verbose
  7. In second terminal, after chain reaches a few blocks in height: agoric start local-solo 8000 --verbose
  8. In a third terminal, after the client shows Deployed Wallet! in the output: yarn loadgen
  9. In a fourth terminal, after the loadgen is ready: curl -X PUT --data '{"vault":{"interval":600}}' http://127.0.0.1:3352/config
  10. 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-sdk revision b605a6a

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:closed
  • Created 2 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
Chris-Hibbertcommented, Jan 5, 2022

closeHook() calls updateUiState(). updateUiState() calls getCollateralizationRatio(), which asks the priceAuthority for the current value of the collateral (even when the collateral has been reduced to zero.) As I mentioned above, swap no longer gives a helpful answer when asked for the price of zero of the collateral. grumble

0reactions
Chris-Hibbertcommented, Feb 7, 2022

This is a bug in the AMM that is affecting loadgen.

Read more comments on GitHub >

github_iconTop Results From Across the Web

No results found

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found