-
Notifications
You must be signed in to change notification settings - Fork 229
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
feat(vats): implement "big hammer" governance #4642
Conversation
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 great!
where is the .proto thingy?
I should probably test this a bit.
@@ -32,6 +33,58 @@ const { keys } = Object; | |||
|
|||
const NUM_IBC_PORTS = 3; | |||
|
|||
/** | |||
* This is the code triggered by `agd tx gov submit-proposal swingset-core-eval |
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 is the code triggered by `agd tx gov submit-proposal swingset-core-eval | |
* This registers the code triggered by `agd tx gov submit-proposal swingset-core-eval |
const { evals } = obj; | ||
return Promise.all( | ||
evals.map(({ json_permits: permit, js_code: 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 can haz static type plz?
Or a comment cross-referencing a .proto file?
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.
Ah, that helped me catch a bug. The json_permits
needed parsing.
// Inspired by ../repl.js: | ||
const globals = harden({ | ||
...farExports, | ||
console, |
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.
console
... hm... I guess that's reasonable.
How about assert
while we're at it?
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.
How about
assert
while we're at it?
Added here and in repl.js
for the pleasure of the ag-solo REPL.
} | ||
}, | ||
}); | ||
await E(bridgeManager).register('core', handler); |
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 feel even more strongly about magic strings than I did before getting into this bootstrap stuff.
await E(bridgeManager).register('core', handler); | |
const CORE_BRIDGE_ID = 'core'; | |
await E(bridgeManager).register(CORE_BRIDGE_ID, handler); |
with the definition at the top. and exported.
Well... I dunno... Maybe I can stand to leave it alone until we have another piece of code that has to use the same string.
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.
Well... I dunno... Maybe I can stand to leave it alone until we have another piece of code that has to use the same string.
That day is today. I've created packages/vats/src/bridge-ids.js
.
packages/vats/src/core/manifest.js
Outdated
@@ -1,5 +1,6 @@ | |||
// @ts-check | |||
const SHARED_BOOTSTRAP_MANIFEST = harden({ | |||
makeCoreEval: true, |
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 makeCoreEval
useful on the sim-chain?
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've renamed it to bridgeCoreEval and moved it to just the chain manifest.
c6bdfc9
to
b1bfb16
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.
I verified that this works as advertised:
command[4] agoric.youAreGoverned
history[4] "agoric15ccjs5hmhrnsszd55npfr22gkfjeu4les90l4a"
I see the .proto was introduced in #4625 .
There I find discussion of documentation burden:
There will certainly be documentation, but this help string is not the place for it.
-- #4625 (comment)
I prefer that any such statements about the future come with references to issues by number, but I don't suppose that's critical to landing this PR.
I'm also a little hesitant that the bulk of the testing here is manual integration testing, but again, test-boot.js
does seem to cover it at least a little.
just realized: I should test starting the RUN protocol.
}); | ||
|
||
// Evaluate the code in the context of the globals. | ||
return new Compartment(globals).evaluate(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.
Let's have the evaluated code return a function and pass the powers to that function, so that the evaluated code can be organized according to POLA rather than having powerful globals available ambiently.
I was able to start the RUN protocol, though it's a little twisty. I'll be thinking about ways to straighten it out. |
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.
feel free to add powerless stuff such as utils
, bootBehaviors
, ... to the globals.
bc5dbc5
to
7b063db
Compare
closes: #4352
Description
Implement
'core'
bridge handler to enable governance to evaluate core boot code. Update solo to allow newhome
objects to be pushed.Remove "leftover actions" assertion, since it is fragile in the face of governance and has thus outlived its usefulness (all actions that make it through the
actionQueue
are precious, not just heuristically-determined ones).Drive-by update
faucet-helper.sh
not to give away so many assets.Demo
This is a demo of the end-to-end: passing a governance action to add something to every ag-solo's
home
:Security Considerations
No new security dependencies beyond what 2/3 validators could do anyway.
Documentation Considerations
Testing Considerations
Will be tested in earnest on the next Devnet.