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

test(a3p-integration): Update "swap into IST" to force the default gas limit #10451

Merged

Conversation

gibson042
Copy link
Member

Description

Extracted from #10165 and extends #10447.

  • 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)

Security Considerations

None known.

Scaling Considerations

None known.

Documentation Considerations

The CLI is self-documenting:

$ 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.

@gibson042 gibson042 added the force:integration Force integration tests to run on PR label Nov 12, 2024
@gibson042 gibson042 requested a review from a team as a code owner November 12, 2024 00:03
// Export these from synthetic-chain?
const USDC_DENOM = NonNullish(process.env.USDC_DENOM);
const PSM_PAIR = NonNullish(process.env.PSM_PAIR).replace('.', '-');

const runCommand = makeRunCommand({ Buffer, Readable, setImmediate, spawn });
Copy link
Member

Choose a reason for hiding this comment

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

I'm reluctant to make a new API for what Execa offers. Can you make the case for this? (Or convert to use Execa?)

Execa has ambient authority, but I think that's acceptable in testing libs. Pretty sure that's in our guidelines.

Copy link
Member Author

@gibson042 gibson042 Nov 12, 2024

Choose a reason for hiding this comment

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

Yeah, it looks like execa can handle everything we care about. I'll see about refactoring on top of it after CI passes with this.

a3p-integration/proposals/z:acceptance/test-lib/psm-lib.js Outdated Show resolved Hide resolved
Copy link

cloudflare-workers-and-pages bot commented Nov 12, 2024

Deploying agoric-sdk with  Cloudflare Pages  Cloudflare Pages

Latest commit: 58272b4
Status: ✅  Deploy successful!
Preview URL: https://6a291a1e.agoric-sdk.pages.dev
Branch Preview URL: https://gibson-2024-11-cli-gas-estim.agoric-sdk.pages.dev

View logs

@gibson042 gibson042 force-pushed the gibson-2024-11-cli-gas-estimation branch 2 times, most recently from 6adae43 to 5faf4dc Compare November 12, 2024 18:09
Copy link
Member

@turadg turadg left a comment

Choose a reason for hiding this comment

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

I have some requests but not blocking since you're just merging this into the base.

I'm fine reviewing the base after this is in there. If you land the base and this goes on top of master instead, please address before merge.

Comment on lines 407 to 410
...[`--node=${rpcAddrs[0]}`, `--chain-id=${chainName}`],
...[`--keyring-backend=test`, `--from=${address}`],
...['tx', 'swingset', 'wallet-action', '--allow-spend', offer],
...['-ojson', '-bblock'],
Copy link
Member

Choose a reason for hiding this comment

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

why the dots? If it's for grouping, I think comment lines would be clearer

Suggested change
...[`--node=${rpcAddrs[0]}`, `--chain-id=${chainName}`],
...[`--keyring-backend=test`, `--from=${address}`],
...['tx', 'swingset', 'wallet-action', '--allow-spend', offer],
...['-ojson', '-bblock'],
// chain
`--node=${rpcAddrs[0]}`, `--chain-id=${chainName}`,
// account
`--keyring-backend=test`, `--from=${address}`,
// transaction
'tx', 'swingset', 'wallet-action', '--allow-spend', offer,
// output
'-ojson', '-bblock',

Copy link
Member Author

Choose a reason for hiding this comment

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

Updated to use concat in alignment with execSwingsetTransaction. The above style doesn't work because our lint configuration prohibits array literals in which some but not all elements share a line.

packages/agoric-cli/src/helpers.js Show resolved Hide resolved
packages/agoric-cli/src/lib/chain.js Outdated Show resolved Hide resolved
@gibson042 gibson042 force-pushed the gibson-2024-11-cli-gas-estimation branch from 5faf4dc to 58272b4 Compare November 12, 2024 19:25
@gibson042 gibson042 merged commit 3f76987 into gibson-2024-11-ci-improvements Nov 12, 2024
79 checks passed
@gibson042 gibson042 deleted the gibson-2024-11-cli-gas-estimation branch November 12, 2024 20:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
force:integration Force integration tests to run on PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants