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

Install RUN Protocol Preview release in devnet on April 22 #5062

Closed
17 tasks done
Tartuffo opened this issue Apr 11, 2022 · 15 comments
Closed
17 tasks done

Install RUN Protocol Preview release in devnet on April 22 #5062

Tartuffo opened this issue Apr 11, 2022 · 15 comments
Assignees
Labels
enhancement New feature or request Inter-protocol Overarching Inter Protocol
Milestone

Comments

@Tartuffo
Copy link
Contributor

Tartuffo commented Apr 11, 2022

What is the Problem Being Solved?

We have committed on our public roadmap to deploy RUN Protocol RC0 (aka preview) in April, 2022.

See also:

Description of the Design

Goal: support...

Initial launch of 10 contracts:

Follow-on proposal(s) enable collateral in vaults:

Security Considerations

Test Plan

  • set up a stage network with a very short voting period
  • try out the runbook
  • vote artificially
  • in the REPL, check E(E(home.agoricNames).lookup('instance')).getEntries() and look for details TBD. Move these details to the runbook?
@Tartuffo Tartuffo added enhancement New feature or request Inter-protocol Overarching Inter Protocol labels Apr 11, 2022
@dckc
Copy link
Member

dckc commented Apr 12, 2022

#4348 has some documentation on starting part of RUN protocol, but it includes several reasons why we don't want to do it that way going forward; in particular, #5029 .

@dckc
Copy link
Member

dckc commented Apr 21, 2022

@arirubinstein and I just did a dry run:

OK:

  • AMM, VaultFactory seem to work as usual
  • runStake works as designed too
  • supporting governance contracts seem to work as design

not OK:

image

some details:

The Makefile in packages/cosmic-swingset that we have been using for (manual) testing doesn't work because

  • it assumes a localhost node
  • it assumes the keys and such are in a t1/bootstrap directory

So we made some one-off shell scripts in a dc-stage-gov-wip branch. Here's hoping we replace them with JS that uses cosmjs to submit governance transactions.

@dckc dckc mentioned this issue Apr 22, 2022
2 tasks
@dckc dckc self-assigned this Apr 22, 2022
@dckc
Copy link
Member

dckc commented Apr 22, 2022

at least one reason PSM didn't work was the following; that fix wouldn't solve it, though, so I'll leave it for later...

modified   packages/run-protocol/src/core-proposal.js
@@ -334,7 +334,7 @@ export const getManifestForPSM = ({ restoreRef }, { installKeys, denom }) => {
   return {
     manifest: PSM_MANIFEST,
     installations: {
-      runStake: restoreRef(installKeys.runStake),
+      psm: restoreRef(installKeys.psm),
     },
     options: {
       denom,

@dckc
Copy link
Member

dckc commented Apr 22, 2022

IBC connected between cosmos testnet and Agoric stage

I'm not sure this IBC denom is suitable for ATOM; that might need to be connected to Oracle stuff. @michaelfig ?

But we could use this (or the equivalent on devnet) for USDC:

@arirubinstein got a relayer working; we see 1000uphoton were transferred to agoricstage-22 network:

% agd query bank balances agoric1yumvyl7f5nkalss7w59gs6n3jtqv5gmarudx55 --node http://35.184.159.154:26657 
balances:
- amount: "10000"
  denom: ibc/949E954E05CE9E63E072ABD13A7DAAAB338A1E57FFBC148C50D74451AB5067D1
pagination:
  next_key: null
  total: "0"

For reference, the command to do a transfer is:

gaiad tx ibc-transfer transfer transfer channel-17 agoric1yumvyl7f5nkalss7w59gs6n3jtqv5gmarudx55 10000uphoton --from ibc2 --keyring-backend=test --node https://rpc.testnet.cosmos.network:443 --chain-id cosmoshub-testnet

https://github.com/arirubinstein/ibc-lab e60ef64

cc @dtribble @rowgraus

@dckc
Copy link
Member

dckc commented Apr 22, 2022

@dtribble found a problem; I marked it as a blocker above:

  • contractGovernor / committee / binaryVoteCounter
    • Error#1: value for LiquidationInstall must be an Installation, was Object [Alleged: Installation] {}

@dckc
Copy link
Member

dckc commented Apr 23, 2022

@dtribble , @jessysaurusrex , @arirubinstein and I reviewed status yesterday evening.

@arirubinstein made good progress on IBC, but I had not managed to do as much testing in stage as we planned. @dtribble was still working on liquidation. @michaelfig reported good progress on Oracles. So it seemed just as likely that all the parts would be ready at once.

We agreed to use the developer's interpretation of "Friday", that is: before Monday.

I notified #devnet-announce.

@dckc
Copy link
Member

dckc commented Apr 24, 2022

Launch in stage worked!

Launching the 10 contracts to agoricstage-23 worked!

@dtribble and I made a recording. Passcode: QAMPK2!b

It did involve some code that is not on master.

https://github.com/Agoric/agoric-sdk/wiki/Runbook:-RUN-Protocol-Preview#send-the-governance-proposal-to-the-blockchain

agoric-sdk/packages/run-protocol$ make submit-proposal
git describe --tags --always
@agoric/sdk@16-106-gc847d7e0f
agd --node=http://34.135.132.162:26657 --chain-id=agoricstage-23 \
  --home=/tmp/stage23/ag-cosmos-helper-statedir --keyring-backend=test \
  tx gov submit-proposal swingset-core-eval \
  gov-econ-committee-permit.json gov-econ-committee.js gov-amm-vaults-etc-permit.json gov-amm-vaults-etc.js ./scripts/gov-startPSM-permit.json ./scripts/gov-startPSM.js \
  --title="Start RUN Protocol Preview on agoricstage-23" --description="$(cat ./docs/run-protocol-preview.md)" \
  --deposit=1000000ubld \
  --gas=auto --gas-adjustment=1.2 \
  --yes --from=ag-solo -b block
gas estimate: 2861922
...
txhash: B7CD04310EA03676E0F4B7912D6EA1688F5629C0C1248E13EE1E4194C631B33B

agoric-sdk/packages/run-protocol$ make gov-q
agd --node=http://34.135.132.162:26657 --chain-id=agoricstage-23 query gov proposals --output json | \
        jq -c '.proposals[] | [.proposal_id,.voting_end_time,.status]';
["1","2022-04-24T20:08:50.908097963Z","PROPOSAL_STATUS_REJECTED"]
["2","2022-04-24T20:15:24.648671791Z","PROPOSAL_STATUS_VOTING_PERIOD"]

Then in the REPL:

command[12] E(E(home.agoricNames).lookup('instance')).entries()
history[12] [["economicCommittee",[Object Alleged: InstanceHandle]{}],["amm",[Object Alleged: InstanceHandle]{}],["ammGovernor",[Object Alleged: InstanceHandle]{}],["VaultFactory",[Object Alleged: InstanceHandle]{}],["Treasury",[Object Alleged: InstanceHandle]{}],["VaultFactoryGovernor",[Object Alleged: InstanceHandle]{}],["runStake",[Object Alleged: InstanceHandle]{}],["runStakeGovernor",[Promise]],["Pegasus",[Promise]],["reserve",[Object Alleged: InstanceHandle]{}],["reserveGovernor",[Object Alleged: InstanceHandle]{}]]

in particular, re runStake:

command[13] home.attMaker
history[13] [Object Alleged: AttestationTool]{}
command[14] E(home.attMaker).getAccountState()
history[14] {"bonded":{"brand":[Object Alleged: BLD brand]{},"value":0n},"currentTime":1650831572n,"liened":{"brand":[Object Alleged: BLD brand]{},"value":0n},"locked":{"brand":[Object Alleged: BLD brand]{},"value":0n},"total":{"brand":[Object Alleged: BLD brand]{},"value":74000000n},"unbonding":{"brand":[Object Alleged: BLD brand]{},"value":0n}}

@dckc
Copy link
Member

dckc commented Apr 24, 2022

I used the following changes from master, and master from a few days ago, for the launch above.

p.s. I reviewed these and separated them into:

  • fix(run-protocol): complete permits for startRewardDistributor, makeAnchorAsset #5213

  • feat(run-protocol): preview launch support, PSM work-around #5215

  • 244b71f 24 Apr 16:05 build(run-protocol): Makefile tweaks for agoricstage-23 (WIP)

  • 6af8a78 24 Apr 16:04 docs(run-protocol): preview docs, WIP

  • c847d7e 24 Apr 02:11 build(run-protocol): regenerate psm eval, permit

  • d894055 24 Apr 01:48 fixup: writePsmScript produceIt

  • af1a44f 24 Apr 01:25 fixup: declare BASIS_POINTS too

  • d243d88 24 Apr 00:53 WIP: exclude PSM_MANIFEST from MAIN for now

  • 56ffa2e 24 Apr 00:53 fix: include RUN_STAKE_MANIFEST in MAIN_MANIFEST

  • 0096c56 24 Apr 00:52 fix(run-protocol): makeAnchorAsset needs installation.mintHolder

  • 46e2076 24 Apr 00:19 fix(run-protocol): makeAnchorAsset needs zoe

  • fc4bc04 23 Apr 23:50 chore(run-protocol): regen gov-startPSM.js

  • efd8ab5 23 Apr 23:49 fix(run-protocol): startRewardDistributor needs runStakeCreatorFacet

  • 0a14632 23 Apr 23:17 fixup(Makefile): CHAIN_OPTS tweaks

  • 15cfcf7 23 Apr 23:17 fixup(init-core): save the install cache!

  • 3156f4e 23 Apr 23:16 fix(startPSM): RATIO params

  • a97ce68 23 Apr 23:16 fixup: re-export from startPSM since moving from econ-behaviors

  • bfc8652 23 Apr 22:38 refactor(init-core): thingy -> tool

  • cd92605 23 Apr 22:31 fixup(Makefile): relative paths after move

  • 39ca816 23 Apr 22:30 fixup(Makefile): clean-core-eval no longer needed

  • 5712540 23 Apr 22:30 fixup(run-protocol): Makefile / shell quoting for description

  • 7758cec 23 Apr 22:29 fix(run-protocol): startPSM: include Electorate in terms

  • fa7e796 23 Apr 22:11 chore(run-protocol): move Makefile out of scripts/

  • cb5739a 23 Apr 22:08 build(run-protocol): deploy:contracts, build:eval:main

  • 4abf3b9 23 Apr 22:07 chore(run-protocol): write 2 proposals: econ-committee, main

  • 1497739 23 Apr 22:06 fixup(writePsmScript): clean up logging

  • 46a7c8b 23 Apr 22:06 feat(run-protocol): add all contracts to deploy-contracts

  • 5da53bd 23 Apr 22:05 feat(deploy-contracts): add path to cache detail

  • 8126fd8 23 Apr 22:05 chore(deploy-contracts): never mind previous design (SQUASHME)

  • 3e78a3c 23 Apr 20:44 WIP(writePsmScript.js): debug logging

  • 7573378 23 Apr 20:43 chore: regen gov-startPSM.js

  • 846f19c 23 Apr 20:43 chore(run-protocol): psm Makefile for local-chain

  • bbfd9d7 23 Apr 20:42 fixup(deploy-contracts): include sha32 info

  • 4d3785e 23 Apr 20:41 fixup(startPSM): mintHolder takes keyword, not name

  • 8d1410d 23 Apr 20:39 feat(vats): export AssetTerms type from mintHolder.js

  • 97eb12d 23 Apr 16:39 build(run-protocol): Makefile for agd tx gov submit-proposal for PSM

  • 5e5e213 23 Apr 16:18 build(run-protocol): generated gov-startPSM-permit.json

  • 10a9e8a 23 Apr 10:09 chore(run-protocol): generated gov-startPSM.js script

  • 5784ab4 23 Apr 16:08 build(run-protocol): PSM build scripts

  • edc13b8 23 Apr 14:23 feat(run-protocol): deploy-contracts script for PSM

  • 0ec1da5 23 Apr 10:08 feat(run-protocol): writePsmScript for bootstrap version skew

  • ecce120 23 Apr 09:29 chore(run-protocol): use mintHolder for psm anchor asset

  • c711538 23 Apr 09:28 chore(run-protocol): fix optionality of startPSM config

  • 2c82193 23 Apr 09:21 refactor(run-protocol): move startPSM() to src/psm/startPSM.js

  • 19bbbfd 23 Apr 09:16 fix(run-protocol): typo in psm config

$ git log  master.. --pretty=format:" - %h %ad %s" --date=format:"%d %b %H:%M"

@dckc
Copy link
Member

dckc commented Apr 25, 2022

VaultFactory, Liquidation ready as of 2b2c966

For vaultFactory, @dtribble @Chris-Hibbert and @turadg all show:
0d5984b0b8f67d6107c29a47a1f1cfe8eaff1cc2355e5f5c91ae3ea49f82cf8dc7ba5a7ceb914b1c90a1be9b76ce9dfd0b9c5691d726c31e39ae4b3ccbf1bc80

For liquidateIncrementally, @Chris-Hibbert got: 90f61ad6b9aa9e7d945d795f592f74c6d3b013232e97638e0234f526f8afae59fe001020aaaa8216e7976f4b553db44d5715bd3edd3c82c64a99137f4af323de

@turadg was building from git version 2b2c966

I'm struggling to confirm.

@dckc
Copy link
Member

dckc commented Apr 25, 2022

We'll use these hashes, all derived from the same git commit above, 2b2c966:

  • vaultFactory: 07265cbf224ff0c3d0d9c09b308c51b1e4162ba24814020a523c325c429eb8286d8e5d0ac6fa4e71c2de8699d7522e1c666be380b4ab8483069b8dcd9e824ad0
  • liquidateIncrementally: d050e98359ff70dae725708933ffa02527ec3fbe75e2640416c23dc096816cf088b79b87ec4d332a5078560b3a2854f88318c7d0da703c8fc9193a463f9f4e52

@turadg , @kriskowal and I were all able to compute these, after zapping node_modules and such. The differences from the hashes above are evidently due to our bundling process not being robust in the face of variations in yarn behavior. In particular, compartment-map.json that differ in their @types/node versions are computed.

@dckc
Copy link
Member

dckc commented Apr 26, 2022

PSM smoke test passed on agoricstage-24

with @michaelfig ... re-launched the PSM with a real IBC denom ibc/287EE075B7AADDEB240AFE74FA2108CDACA50A7CCD013FA4C1FCD142AFA9CA9A

traded 25 IBC AUSD for...

command[113] E(RUN.purse).deposit(history[111])
history[113] {"brand":[Object Alleged: RUN brand]{},"value":24997500n}

full transcript: https://gist.github.com/dckc/0e0e917728a774b3f55e5d0ea4f40a18

@dckc
Copy link
Member

dckc commented Apr 26, 2022

https://devnet.explorer.agoric.net/proposals/2 is out for votes.

txhash: 7C3336CC6BE3F013B2BD3A1D7C8FAC85DC72CB89807920705AE5A58CF5529B45

@dckc
Copy link
Member

dckc commented Apr 27, 2022

the proposal passed! the contracts are running:

command[6] E(E(home.agoricNames).lookup('instance')).entries()
history[6] [["economicCommittee",[Object Alleged: InstanceHandle]{}],["amm",[Object Alleged: InstanceHandle]{}],["ammGovernor",[Object Alleged: InstanceHandle]{}],["VaultFactory",[Object Alleged: InstanceHandle]{}],["Treasury",[Object Alleged: InstanceHandle]{}],["VaultFactoryGovernor",[Object Alleged: InstanceHandle]{}],["runStake",[Object Alleged: InstanceHandle]{}],["runStakeGovernor",[Promise]],["Pegasus",[Promise]],["reserve",[Object Alleged: InstanceHandle]{}],["reserveGovernor",[Object Alleged: InstanceHandle]{}],["ATOM-USD priceAggregator",[Object Alleged: InstanceHandle]{}],["psm",[Object Alleged: InstanceHandle]{}],["psmGovernor",[Object Alleged: InstanceHandle]{}]]

command[8] home.attMaker
history[8] [Object Alleged: AttestationTool]{}

runStakeGovernor isn't saved by startRunStake. I'm tracking that as #4548 (comment)

oracle stuff seems connected:

command[7] home.priceAuthority
history[7] [Object Alleged: fake price authority]{}

@dckc
Copy link
Member

dckc commented Apr 28, 2022

to get past "no collateral types":

moved to #3924 (comment)

@dckc
Copy link
Member

dckc commented Apr 29, 2022

Let's track the remaining work

and close this.

@dckc dckc closed this as completed Apr 29, 2022
@Tartuffo Tartuffo added this to the Mainnet 1 milestone May 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Inter-protocol Overarching Inter Protocol
Projects
None yet
Development

No branches or pull requests

2 participants