Agoric / agoric-sdk

monorepo for the Agoric Javascript smart contract platform
Apache License 2.0
327 stars 208 forks source link

production bootstrap does not provide trading assets needed by loadgen #4634

Closed dckc closed 2 years ago

dckc commented 2 years ago

Describe the bug

The loadgen uses the local-chain / local-solo scenario; as of addressing #4165, this no longer provides the demo USDC that the loadgen expects to have available for trading.

To Reproduce

We discovered this in ci:

Tue, 22 Feb 2022 03:30:46 GMT
stage-0: loadgen: RemoteError(error:captp:[http://127.0.0.1#20001)#1:](http://127.0.0.1/#20001)#1:) "petname" not found: (a string)

-- https://github.com/Agoric/agoric-sdk/runs/5282602699?check_suite_focus=true#step:10:4824

I reproduced it locally, so we can see the obscured petname is USDC:

2022-02-22T16:07:56.589Z SwingSet: ls: v10: Error#1: petname not found: IE:"USDC"

Expected behavior

loadgen can trade USDC on the AMM.

In particular, it can get the USDC issuer and brand via its wallet:

https://github.com/Agoric/testnet-load-generator/blob/8939609fd21151858cdff16bc83f684dedfb60fd/loadgen/contract/agent-trade-amm.js#L19-L21

Meanwhile, production bootstrap code paths remain free of mechanisms that we don't want in production.

Platform Environment

Additional context

This is evidently a consequence of the BREAKING CHANGE in 2cbf293f4d5f #4541

mhofman commented 2 years ago

When integrating against the draft change in https://github.com/Agoric/agoric-sdk/pull/4641, I realized that environment variables needed at first launch are not saved when doing an "init only" aka agoric start local-chain --no-restart (see https://github.com/Agoric/agoric-sdk/commit/f2a011537d9d44489d6ad705f45b6c392537f985), and need to be provided the first time cosmic-swingset is started.

I believe there is an options mechanism to save such environment at init (e.g. how CHAIN_PORT is saved)

dckc commented 2 years ago

@michaelfig it looks like when we added CHAIN_BOOTSTRAP_VAT_CONFIG in #4247 , we didn't arrange for it to persist between init and start the way CHAIN_PORT does. :-/