Agoric / testnet-load-generator

A dapp that generates somewhat realistic loads for testnet
Apache License 2.0
7 stars 7 forks source link

Plan for Load Testing #1

Open katelynsills opened 3 years ago

katelynsills commented 3 years ago

@warner would like to set up load testing on our testnet, automating some typical actions that a user would take. The important thing is to test things that 1) we think the users will definitely do a lot, and 2) which may affect the system. Testing different code that doesn't fit either 1 or 2 is not the goal here.

Below are some discrete stages for testing:

Delayed until @katelynsills or @michaelfig has more time but still important:

Bonus: An extra fun load test that will probably show up on-chain but which may break things: create a chain of covered call options, where the covered call option (aka invitation) from the previous contract is used as the escrowed asset in the next contract.

Note: The above testing will start at the Zoe API level only (and look like contract unit tests), and will not try to simulate user actions in the UI, nor the dapp communication with the wallet. Wallet API calls will be made sparingly. So for instance, E(zoe).offer will be called rather than E(wallet).addOffer. Eventually we will want to load test the wallet calls, but the API is not currently mature enough until @katelynsills or @michaelfig has more time.

Helpful starting points:

  1. Fungible Faucet Dapp:
  2. Trade on multipool autoswap:
  3. Create covered call instances

For later:

  1. Send tokens to other users.
    • Use the walletAdmin (E(wallet).getAdminFacet()) to add a contact (addContact) and then send them money. This may only be doable through the wallet UI (dapp-svelte-wallet in agoric-sdk) currently, but needs to be available through the wallet API (see https://github.com/Agoric/agoric-sdk/issues/2121).
warner commented 3 years ago

I've pushed the basic fungible-faucet worker ("task") and the code that initiates a new instance (a "cycle") on a periodic basis (the "loop"). There's code to let you configure the rate over HTTP.

warner commented 3 years ago

We've landed the AMM swap, and also a Treasury loan/redeem cycle.