Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
…0447) ## Description Extracted from #10165. When the `agoric wallet send` transaction inside [`psmSwap`](https://github.com/Agoric/agoric-sdk/blob/e7af58fe25a802d23283633416d0900aa06a2127/a3p-integration/proposals/z%3Aacceptance/test-lib/psm-lib.js#L391) failed because the default gas limit was insufficient, the following [`waitUntilOfferResult`](https://github.com/Agoric/agoric-sdk/blob/e7af58fe25a802d23283633416d0900aa06a2127/packages/client-utils/src/sync-tools.js#L205) never settled because the `agoric follow -lF :published.wallet.${addr}` inside its `queryWallet` was waiting forever. This PR fixes the root issue by updating `agoric wallet send` to use `--gas=auto` (while still preserving a3p-integration test coverage of the "default gas with automatic wallet provisioning" scenario), and also updates `retryUntilCondition` to [Promise.race](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise/race) its operation against the interval timeout rather than just naïvely `await`ing it and possibly getting hung up on permanent unsettlement, while still allowing the original promise to persist (specifically for such `agoric follow` applications). It also incidentally cleans up `tryISTBalances`, which is used by `checkSwapSucceeded` after the vulnerable `psmSwap` calls. * fix(client-utils): Retry at least every other interval (even when a backing operation hangs, e.g. `follow` of an unprovisioned wallet) * chore(a3p-integration): Increase the verbosity of psmSwap * feat(agoric-cli): Block agoric wallet send on tx inclusion (`-bblock`) * test(a3p-integration): Update "swap into IST" to force the default gas limit * feat(agoric-cli): Add agoric wallet send gas limit options (defaulting to `--gas=auto --gas-adjustment=1.2`) ### Security Considerations None known. ### Scaling Considerations None known. ### Documentation Considerations The CLI is self-documenting: ```console $ agoric wallet send --help Usage: agoric wallet send [options] send a prepared offer Options: --home <dir> agd application home directory --keyring-backend <os|file|test> keyring's backend (os|file|test) (default "os") --from [address] address literal or name --offer [filename] path to file with prepared offer --dry-run spit out the command instead of running it --gas gas limit; "auto" [default] to calculate automatically --gas-adjustment factor by which to multiply the limit calculated from --gas=auto [default 1] --verbose print command output -h, --help display help for command ``` ### Testing Considerations The new `--gas=auto` default is used every *except* "swap into IST", which is now explicitly responsible for covering the "default gas with automatic wallet provisioning" scenario. ### Upgrade Considerations This will now detect any future change that pushes PSM swap gas consumption beyond the default limit.
- Loading branch information