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

RUN protocol governance to start PSM, runStake, etc. #5165

Merged
merged 7 commits into from
Apr 22, 2022

Conversation

dckc
Copy link
Member

@dckc dckc commented Apr 20, 2022

obsoletes #4953
closes: #3788
refs: #5010

  • would close it but for governance, which should have its own ticket, but does not, yet

Description

Break the default run-protocol governance proposal used in sim-chain / loadgen down into parts:

  • the economic committee
  • runStake
  • AMM, vaults, reward distributor
  • PSM

Security Considerations

The manifests / permits are an enforced security policy. (We have visualizations, but maintenance is a little iffy.)

Documentation Considerations

#5062 is a plan to launch the RUN protocol contracts on devnet by vote of BLD holders.

@rowgraus I'd like to brainstorm a bit about how we explain this stuff to the voters. devnet: proposal to deploy RUNstake passed was an post-facto explanation of an earlier episode to our commonwealth forum.

We're inviting not just our devnet validators but all our keplr users to participate in this preview of governance: Agoric/documentation#668

Testing Considerations

I'd like someone else to reproduce my results; I'm working with @samsiegart .

Instructions (sketch) so far:

branch: dc-boot-psm-runStake

start local chain:

~/projects/agoric/agoric-sdk/packages/cosmic-swingset
12:46 connolly@jambox$ make scenario2-setup scenario2-run-chain >,chain.log 2>&1 &

start local solo:

~/projects/agoric/agoric-sdk/packages/cosmic-swingset
12:46 connolly@jambox$ make scenario2-run-client >,client.log 2>&1 &

deploy contracts; make proposals:

cd packages/run-protocol
yarn deploy

then...
(I used a different terminal...)

cd ../cosmic-swingset
make start-committee VOTE_PROPOSAL=1 # salt to taste
make start-runStake VOTE_PROPOSAL=2
make gov-q

@dckc dckc changed the title Dc boot psm run stake RUN protocol governance to start PSM, runStake, etc. Apr 20, 2022
Copy link
Member

@michaelfig michaelfig left a comment

Choose a reason for hiding this comment

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

Looks pretty good! Please don't merge until the psm/installations/runStake thing is sorted.

// @ts-check
import { E } from '@endo/far';
import { ZipReader } from '@endo/zip';
import { encodeBase64, decodeBase64 } from '@endo/base64';
import { importBundle } from '@endo/import-bundle';
Copy link
Member

Choose a reason for hiding this comment

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

As lint says, it's necessary to add @endo/import-bundle to packages/deploy-script-support/package.json.dependencies.

Comment on lines 63 to 64
const [mod0, bundle0] = installKeyGroups.econCommittee.binaryVoteCounter;
await install(mod0, bundle0, { persist: true });
Copy link
Member

Choose a reason for hiding this comment

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

Would this create the first of two separate Zoe installations? Should the below publishGroup avoid doing an install for group === 'econCommittee' && mod === 'binaryVoteCounter'?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yes, it makes a throw-away installation, but I didn't think it was worth fixing. Will do.

return {
manifest: PSM_MANIFEST,
installations: {
runStake: restoreRef(installKeys.runStake),
Copy link
Member

Choose a reason for hiding this comment

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

Looks like this shouldn't be runStake?

@dckc dckc marked this pull request as ready for review April 20, 2022 21:13
@dckc dckc requested a review from turadg as a code owner April 20, 2022 21:13
@dckc
Copy link
Member Author

dckc commented Apr 20, 2022

@samsiegart when you can get home.attMaker, please approve this.

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.

No concerns from me.

@dckc dckc force-pushed the dc-boot-psm-runStake branch 2 times, most recently from 8b45701 to 22f08bc Compare April 21, 2022 02:41
@dckc dckc marked this pull request as draft April 21, 2022 02:43
@dckc
Copy link
Member Author

dckc commented Apr 21, 2022

missing lienBridge

@samsiegart
Copy link
Contributor

I'm able to get home.attMaker on 22f08bc

@dckc dckc marked this pull request as ready for review April 21, 2022 04:37
Copy link
Contributor

@samsiegart samsiegart left a comment

Choose a reason for hiding this comment

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

command[4]
E(home.attMaker).getAccountState()
history[4]
{"bonded":{"brand":[Object Alleged: BLD brand]{},"value":0n},"currentTime":1650555791n,"liened":{"brand":[Object Alleged: BLD brand]{},"value":0n},"locked":{"brand":[Object Alleged: BLD brand]{},"value":0n},"total":{"brand":[Object Alleged: BLD brand]{},"value":13000000n},"unbonding":{"brand":[Object Alleged: BLD brand]{},"value":0n}}

@dckc dckc added the automerge:no-update (expert!) Automatically merge without updates label Apr 21, 2022
After adding any number of entries, caller can call .persist()
to save them to a cache, keyed by hash, that persists between
calls to .makeBundler().

Then call .preFilter(hashes) to get the hashes that are already
in the cache. For any such cache hits, call .addByRef(hash)
instead of .add().

Performance measurement: combined with splitting some contracts out of
a proposal, caching reduced runtime from 526.05s.  to 236.89s.

WARNING: Currently, since xsnap lacks efficient hashing, we trust the
client to compute hashes. Since the endo-pieces-contract is
not typically shared between clients, this is a moderate risk.

 - skip importBundle check
   doesn't work outside SwingSet
 - fix: hoist mutext
 - more logging
 - refactor: prepare to break init-core into parts
 - separate proposal for startEconomicCommittee
 - separate core proposals for psm, runStake
 - avoid duplicate installation
 - omit PSM proposal unless ANCHOR_DENOM is set
 - makeAnchorAsset for PSM bootstrap
 - connect lienBridge to runStake
@mergify mergify bot merged commit 2d0ce6b into master Apr 22, 2022
@mergify mergify bot deleted the dc-boot-psm-runStake branch April 22, 2022 00:27
@@ -191,7 +191,7 @@ export default async function deployMain(progname, rawArgs, powers, opts) {
paths: [...paths, path.dirname(moduleFile)],
});
} catch (e) {
return path.resolve(...paths, fileName);
return path.resolve(path.dirname(moduleFile), ...paths, fileName);
Copy link
Member

Choose a reason for hiding this comment

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

Why was path.dirname(moduleFile) added before ...paths ?

Copy link
Member

Choose a reason for hiding this comment

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

Nmv, this is correct and it's the paths for require.resolve above that isn't correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
automerge:no-update (expert!) Automatically merge without updates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RUNstake: borrow RUN against staked BLD
5 participants