-
Notifications
You must be signed in to change notification settings - Fork 212
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
replace ROLE with 3 bootstrap modules; audit contents #7049
Conversation
6aa1dde
to
a57cc44
Compare
b43084f
to
3194c47
Compare
b2d2f00
to
37c10aa
Compare
Datadog ReportBranch report: ✅ |
@michaelfig in Is that what you would expect? Is this where the trick with the old wallet package comes in somehow? I'm looking at |
@warner this PR includes a unit test to audit bundles similar to our Jan discussion. There's more to do: currently the prohibition on
It checks every module in each bundle for a
This does enumerate all the bundles, both directly in the swingset config and indirectly via
@michaelfig @turadg please take a look. I wonder about breaking it into pieces, but I've been smushing the parts around for so long that I think I need other eyes on it to make useful progress. |
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.
Support the motivation. Reducing deep imports looks good. Poison pill is clever and helpful. Glad to have the visualization tool become part of CI.
Won't approve because I don't know what to expect for testing the sim-chain changes.
@@ -345,7 +347,7 @@ export const PSM_GOV_MANIFEST = { | |||
}; | |||
|
|||
export const INVITE_PSM_COMMITTEE_MANIFEST = harden( | |||
/** @type {import('@agoric/vats/src/core/manifest.js').BootstrapManifest} */ | |||
/** @type {import('@agoric/vats/src/core/lib-boot.js').BootstrapManifest} */ |
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.
defined up top
/** @type {import('@agoric/vats/src/core/lib-boot.js').BootstrapManifest} */ | |
/** @type {BootstrapManifest} */ |
export const PSM_MANIFEST = harden({ | ||
/** @type {import('@agoric/vats/src/core/manifest.js').BootstrapManifestPermit} */ | ||
/** @type {import('@agoric/vats/src/core/lib-boot.js').BootstrapManifestPermit} */ |
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.
implied by being a property of BootstrapManifest
/** @type {import('@agoric/vats/src/core/lib-boot.js').BootstrapManifestPermit} */ |
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 like the BootstrapManifest
declaration has to go inside harden()
too.
import { makeAgoricNamesAccess } from '@agoric/vats/src/core/utils.js'; | ||
import { makePromiseSpace } from '@agoric/vats'; |
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.
import { makeAgoricNamesAccess } from '@agoric/vats/src/core/utils.js'; | |
import { makePromiseSpace } from '@agoric/vats'; | |
import { makeAgoricNamesAccess, makePromiseSpace } from '@agoric/vats'; |
makeAgoricNamesAccess, | ||
makePromiseSpace, | ||
} from '@agoric/vats/src/core/utils.js'; | ||
import { makeAgoricNamesAccess } from '@agoric/vats/src/core/utils.js'; |
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.
top-level now
|
||
/** @type {import('./lib-boot').BootstrapManifest} */ | ||
export const BASIC_BOOTSTRAP_PERMITS = harden({ | ||
/** @type {import('./lib-boot').BootstrapManifestPermit} */ |
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.
type is implied I think
packages/vats/src/core/boot-chain.js
Outdated
const { | ||
BASIC_BOOTSTRAP_PERMITS: _5, | ||
PowerFlags: _3, | ||
makeMyAddressNameAdminKit: _4, | ||
...basicBehaviors | ||
} = basicBehaviorsPlus; |
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.
the numbers seem significant but aren't. consider:
const { | |
BASIC_BOOTSTRAP_PERMITS: _5, | |
PowerFlags: _3, | |
makeMyAddressNameAdminKit: _4, | |
...basicBehaviors | |
} = basicBehaviorsPlus; | |
const { | |
BASIC_BOOTSTRAP_PERMITS: _B, | |
PowerFlags: _P, | |
makeMyAddressNameAdminKit: _m, | |
...basicBehaviors | |
} = basicBehaviorsPlus; |
/** | ||
* WARNING: not for production use | ||
* |
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.
the import and the line below seem sufficient:
notForProductionUse();
- misc static types - note TODO ideas - make executable
- toward test for non-upgradeable vats
No change to the runtime names, for now: vatParams.argv
- test: sim/demo config launches Vaults as expected by loadgen - demo-config: add missing proposals: - add-collateral-core for IbcATOM - price-feed-core - test: fill out expected home properties - installSimEgress: make hardcodedClientAddresses optional - type: prune governanceActions (obsolete in favor of coreProposals) - type: prune bootstrapManifest from BootstrapVatParams - no longer dynamic - rename USDC -> DAI in connectFaucet() - add missing harden()s in nameHub, connectFaucet() - factor out makeHomeFor()
- move makeMyAddressNameAdminKit to utils - bonus: avoids importing all of basic-behaviors into places such as provisionPool.js - move PowerFlags to walletFlags.js - avoid redundant imports in boot-chain.js, -sim, -client
refs: #6687, #7044
Description
boot.js
included everything for production chain, sim, and solo and dispatched at runtime based onROLE
arg. Instead, we choose betweenboot-chain.js
,boot-sim.js
,boot-solo.js
modules in the swingset config, so thatboot-chain.js
has only production code.This introduces a
notForProductionUse()
"poison pill" and any bundle that includes its module is flagged.Tasks
Some items in the list of non-upgradeable vats are commented out; follow-on PRs should address them.
Security Considerations
Eliminates need to evaluate bootstrap logic to determine that test code is never run.
Scaling Considerations
Small code size reduction in production?
Documentation Considerations
Documentation about which bootstrap config files are used for what is still pretty messy.
Testing Considerations
Figuring out all the constraints on bootstrap and all the different bootstrap configs is challenging. I added tests for some of them, I think.