-
Notifications
You must be signed in to change notification settings - Fork 215
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: send-anywhere
pfm scenarios
#10591
Conversation
5b9326d
to
46e6875
Compare
Deploying agoric-sdk with Cloudflare Pages
|
46e6875
to
fc4e81a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
looks good.
the comments here are mostly thinking-out-loud.
Putting register-interchain-bank-assets.js
under packages/builders/scripts
seems pretty odd; it's not a script. So I hope you'll move that. But I can still get behind this if you don't.
multichain-testing/Makefile
Outdated
register-bank-assets: | ||
node_modules/.bin/tsx scripts/fetch-starship-chain-info.ts && \ | ||
node_modules/.bin/tsx scripts/deploy-cli.ts src/register-interchain-bank-assets.builder.js \ | ||
assets="$$(node_modules/.bin/tsx scripts/make-bank-asset-info.ts)" | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does it cost to get the scripts to know how to execute themselves?
register-bank-assets: | |
node_modules/.bin/tsx scripts/fetch-starship-chain-info.ts && \ | |
node_modules/.bin/tsx scripts/deploy-cli.ts src/register-interchain-bank-assets.builder.js \ | |
assets="$$(node_modules/.bin/tsx scripts/make-bank-asset-info.ts)" | |
register-bank-assets: | |
./scripts/fetch-starship-chain-info.ts && \ | |
./scripts/deploy-cli.ts src/register-interchain-bank-assets.builder.js \ | |
assets="$$(./scripts/make-bank-asset-info.ts)" | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll see where we land in #10605 and incorporate that approach
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah; don't worry about it for this PR
@@ -101,5 +106,5 @@ wait-for-pods: | |||
node_modules/.bin/tsx scripts/pod-readiness.ts | |||
|
|||
.PHONY: start | |||
start: install wait-for-pods port-forward fund-provision-pool override-chain-registry | |||
start: install wait-for-pods port-forward fund-provision-pool override-chain-registry register-bank-assets |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does deploy-cli.ts
know how to run multiple evals in one chain governance proposal? How about combining override-chain-registry
and register-bank-assets
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good idea. I won't tackle that here but I'll hope to make this update soon
const main = () => { | ||
if (!starshipChainInfo) { | ||
throw new Error( | ||
'starshipChainInfo not found. run `make override-chain-registry` or `node_modules/.bin/tsx scripts/fetch-starship-chain-info.ts` first.', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the node_modules/.bin/
again jumps out at me... it looks like we're peeking into the internals of something.
'starshipChainInfo not found. run `make override-chain-registry` or `node_modules/.bin/tsx scripts/fetch-starship-chain-info.ts` first.', | |
'starshipChainInfo not found. run `make override-chain-registry` or `./scripts/fetch-starship-chain-info.ts` first.', |
const fundAndTransfer = makeFundAndTransfer( | ||
t, | ||
retryUntilCondition, | ||
useChain, | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hoist this above return
?
@@ -0,0 +1,190 @@ | |||
/** | |||
* @file register-interchain-bank-assets.js |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This doesn't look like a builder script. It looks like on-chain core-eval code.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I adjusted the @file comment to mention this. Are you suggesting this should live in a different directory?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes. it doesn't seem to belong in builder/scripts/
not a hill I'd die on.
@@ -179,7 +179,7 @@ const ChainIdArgShape = M.or( | |||
const DefaultPfmTimeoutOpts = harden( | |||
/** @type {const} */ ({ | |||
retries: 3, | |||
timeout: '10min', | |||
timeout: /** @type {GoDuration} */ ('10m'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
odd... @type {const}
isn't enough?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good catch const
should be sufficient here
@@ -82,13 +81,32 @@ export const startSendAnywhere = async ( | |||
}), | |||
); | |||
|
|||
const safeLookup = async p => |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the name safeLookup
suggests that the .lookup(...)
call should be in this function. safeFulfill
maybe?
const parseAssets = () => { | ||
if (typeof assets !== 'string') { | ||
throw Error( | ||
'must provide --assets=JSON.stringify({ denom: Denom; keyword: string; decimalPlaces: number; }[])', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this really a keyword? Or is it a misnomer where we really mean issuerName
?
'must provide --assets=JSON.stringify({ denom: Denom; keyword: string; decimalPlaces: number; }[])', | |
'must provide --assets=JSON.stringify({ denom: Denom; issuerName: string; decimalPlaces: number; }[])', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I remember this comment in the add-vault proposal. I'll look to make the corresponding change in the builder so we don't continue to carry the tech debt
test.serial(sendAnywhereScenario, 'cosmoshub', 1); | ||
test.serial(sendAnywhereScenario, 'cosmoshub', 2); | ||
test.serial(sendAnywhereScenario, 'osmosis', 1, 'IST'); | ||
test.serial(sendAnywhereScenario, 'osmosis', 2, 'ATOM'); // exercises PFM (agoric -> cosmoshub -> osmosis) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it took me a while to grok what this test does, but I think I get it now.
For ref:
https://github.com/Agoric/agoric-sdk/actions/runs/12123427233/job/33798929261?pr=10591#step:13:3141
@@ -118,14 +119,14 @@ export const makeIBCTransferMsg = ( | |||
}; | |||
|
|||
export const createFundedWalletAndClient = async ( | |||
t: ExecutionContext, | |||
log: (...args: unknown[]) => void, | |||
chainName: string, | |||
useChain: MultichainRegistry['useChain'], | |||
) => { | |||
const { chain, creditFromFaucet, getRpcEndpoint } = useChain(chainName); | |||
const wallet = await createWallet(chain.bech32_prefix); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
createWallet(...)
seems to generate random key material using ambient authority.
ah... ok; it takes key material as a default arg, a la...
I'd rather see this test take advantage of that and pass in the key material, but I suppose we'll get there in due course.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agree, but none of these tests rely on a specific key currently. For now, I've made mnemonic
an optional parameter to createFundedWalletAndClient
.
2368fb7
to
94e4b37
Compare
fc4e81a
to
410f064
Compare
a1132f4
to
a706d28
Compare
095b0dd
to
d1ee50a
Compare
a706d28
to
a2d491f
Compare
d1ee50a
to
a117976
Compare
Base branch is changed to master. Please re-run the integration tests by adding 'force:integration' label. |
a117976
to
3c55dbb
Compare
788cb28
to
4399100
Compare
- create `register-interchain-bank-assets.js` for multichain-testing environment - allow users to submit offers using new brands like OSMO, ION - override existing brands like ATOM (ibc/toyatom) with starship denom - create `make-bank-asset-info.ts` to gather `InterchainAssetOptions` from starship env - update `make start` and ci `multichain-e2e-template.yaml` to call these scripts - deploy-cli.ts `deployBuilder` accepts `builderOpts`
- adds helper to fund agoric faucet with interchain tokens - allows callers to request `OSMO`, `ATOM`, etc, via `provisionSmartWallet`
4399100
to
748883d
Compare
closes: #9966
closes: #10445
Description
Adds multi-hop (PFM) scenarios to the
examples/send-anywhere.contract.js
multichain (e2e) test. To support this change, this PR also includes:fundFaucet
helper inmultichain-testing
so developers can request ATOM, OSMO, etc inprovisionSmartWallet
GoDuration
type in@agoric/orchestration
that captures basic Go time duration strings and an update toDefaultPfmTimeoutOpts
(10min -> 10m)Security Considerations
@agoric/builders/scripts/testing/register-interchain-bank-assets.js
allows callers overwrite assets invbank
andagoricNames
. It's only intended for testing, and shouldn't be used in production. A production version might guard against accidental overrides.Scaling Considerations
None, mostly test code. Adds a little CI time to
multichain-testing
for the extra CoreEval.Documentation Considerations
None
Testing Considerations
Includes an E2E to test in
multichain-testing
that leveragesregister-interchain-bank-assets.js
. Also includes the first E2E test of PFM functionality added in #10584 and #10571.Upgrade Considerations
None, library code an NPM orch or FUSDC release.