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

Bootstrap ocaps are stored durably in vat-bootstrap #4548

Closed
7 tasks done
Tracked by #6553
Tartuffo opened this issue Feb 14, 2022 · 10 comments · Fixed by #7641
Closed
7 tasks done
Tracked by #6553

Bootstrap ocaps are stored durably in vat-bootstrap #4548

Tartuffo opened this issue Feb 14, 2022 · 10 comments · Fixed by #7641
Assignees
Labels
cosmic-swingset package: cosmic-swingset enhancement New feature or request vaults_triage DO NOT USE
Milestone

Comments

@Tartuffo
Copy link
Contributor

Tartuffo commented Feb 14, 2022

Problem to be solved

Bootstrap is not upgradable yet holds precious state in closure.

Description of design

Either make the bootstrap vat upgradable or move its (non-copyable) precious state into upgradable vats.

We're opting for the latter so that if necessary we can make a new bootstrap vat and have it retrieve everything precious from the space. (This requires that everything precious is created in some other vat than the original bootstrap).

Tasks

Goals (optional)

  • make bridge manager facets into a space?
  • make vats into a space (likewise bundles?)
  • move client/home stuff to new file, out of chain-behaviors?

Testing plan

demonstrate upgrading the bootstrap vat don't need to because with the precious state secured elsewhere the bootstrap vat can be blown away

If times allows, write a test that creates a new bootstrap and core-eval can provide it with everything it needs from the space.

@Tartuffo Tartuffo added cosmic-swingset package: cosmic-swingset enhancement New feature or request restival to be done before RUN Protocol Purple Team festival labels Feb 14, 2022
@Tartuffo
Copy link
Contributor Author

Tartuffo commented Feb 14, 2022

Per @dckc: Uncertainty in estimate: (1) I conservatively assume this is the first time I'm doing virtual / durable conversion. (2) bootstrap is kinda hairy and touches lots of stuff. (3) @dtribble talked about a significant redesign in bootstrap when we make it durable.

@Tartuffo Tartuffo removed the restival to be done before RUN Protocol Purple Team festival label Feb 14, 2022
@Tartuffo
Copy link
Contributor Author

Don't need to impl this for Restival. For Restival, need it to be clear how the world boots. Starting RUN Protocol is separate from bootstrap. How can we add things to bootstrap after launch, how do we fix them? We don't want accumulated non-durable stuff that will complicate this.

@dckc
Copy link
Member

dckc commented Apr 27, 2022

Also audit for objects that are allowed to go out of scope.

  • admin facets
    • design idea: capture the whole return from startInstance, not just the creatorFacet
  • runStakeGovernor instance

@dckc
Copy link
Member

dckc commented May 7, 2022

@dtribble and I agreed to postpone this:

He had proposed that it stored all of it state in a baggage and then go away each time so that each invcation of the big Javasript hammer starts only from baggage. This would ensure that any limitations in our current bootstrap are irrelevant because we could load a different contractor bootstrap.

I don't know how to deliver the JavaScript big hammer messages into a vat that went away. It's not obvious how that would work.

@dckc
Copy link
Member

dckc commented Feb 25, 2023

@michaelfig and I broke ground on this today: 4d5a81e

@dckc
Copy link
Member

dckc commented Apr 20, 2023

@turadg re testing plan: a test that shows no unexpected exports from the bootstrap vat would be cool.

I hope that's straightforward to do. I hope to get a clue from @gibson042 or the like.

@turadg turadg changed the title Bootstrap should use virtual objects / durable collections Bootstrap should not have precious state Apr 24, 2023
@ivanlei ivanlei added the vaults_triage DO NOT USE label Apr 27, 2023
@ivanlei ivanlei added this to the Vaults EVP milestone Apr 27, 2023
@dckc
Copy link
Member

dckc commented Apr 27, 2023

substantial progress today, though things still feel a bit all-over-the-floor.

fd083b1 * 4548-boot-no-precious-state WIP: lots of progress on test-vaults-integration.js

next challenge:

TypeError#1: myAddressNameAdmin.reserve is not a function
  at publishDepositFacet (.../smart-wallet/src/walletFactory.js:47:20)
  at maker (.../smart-wallet/src/walletFactory.js:257:6)

@dckc
Copy link
Member

dckc commented May 2, 2023

I thought I moved namesByAddress to the provisioning vat, but now (3e8e09f) I'm back to wallet races:

~/projects/agoric-sdk/packages/vats
18:58 connolly@bldbox$ yarn test test/bootstrapTests/test-vaults-integration.js


  Error {
    message: 'no invitation match (1 description and 0 instance)',
  }

  › kunser (packages/swingset-liveslots/test/kmarshal.js:74:51)
  › getResult (packages/vats/test/bootstrapTests/supports.js:89:17)
  › packages/vats/test/bootstrapTests/supports.js:100:14

cc @turadg @michaelfig

@dckc
Copy link
Member

dckc commented May 2, 2023

bootstrap exports 14 objects

We'd like to minimize bootstrap exports. Here's hoping to inventory these a bit closer...

[
  [ 'ko21', 'v1', 1, 1 ],
  [ 'ko45', 'v1', 7, 7 ],
  [ 'ko62', 'v1', 1, 1 ],
  [ 'ko70', 'v1', 1, 1 ],
  [ 'ko74', 'v1', 1, 1 ],
  [ 'ko75', 'v1', 1, 1 ],
  [ 'ko80', 'v1', 1, 1 ],
  [ 'ko110', 'v1', 2, 2 ],
  [ 'ko129', 'v1', 1, 1 ],
  [ 'ko161', 'v1', 6, 6 ],
  [ 'ko162', 'v1', 1, 1 ],
  [ 'ko187', 'v1', 2, 2 ],
  [ 'ko319', 'v1', 3, 3 ],
  [ 'ko320', 'v1', 3, 3 ]
]

mapping to in-vat oids:

[
  [ 'ko21', 'v1', 'o+0' ],
  [ 'ko45', 'v1', 'o+d10/1' ],
  [ 'ko62', 'v1', 'o+15' ],
  [ 'ko70', 'v1', 'o+16' ],
  [ 'ko74', 'v1', 'o+17' ],
  [ 'ko75', 'v1', 'o+18' ],
  [ 'ko80', 'v1', 'o+19' ],
  [ 'ko110', 'v1', 'o+20' ],
  [ 'ko129', 'v1', 'o+21' ],
  [ 'ko161', 'v1', 'o+d22/1' ],
  [ 'ko162', 'v1', 'o+d27/1' ],
  [ 'ko187', 'v1', 'o+32' ],
  [ 'ko319', 'v1', 'o+33' ],
  [ 'ko320', 'v1', 'o+34' ]
]

messages to v1 bearing one of these oids, either as the target or an arg slot:

[2,["message","o+0",{"methargs":{"body":"#[\"bootstrap\",[{\"bootstrap\":\"$0.Alleged: root\",\"comms\":\"$1.Alleged: root\",\"timer\":\"$2.Alleged: root\",\"vatAdmin\":\"$3.Alleged: root\",\"vattp\":\"$4.Alleged: root\"},{\"bridge\":\"$5.Alleged: device\",\"mailbox\":\"$6.Alleged: device\",\"timer\":\"$7.Alleged: device\",\"vatAdmin\":\"$8.Alleged: device\"}]]","slots":["o+0","o-50","o-51","o-52","o-53","d-70","d-71","d-72","d-73"]},"result":"p-60"}]]
[55,["message","o+17",{"methargs":{"body":"#[\"onCreate\",[\"$0.Alleged: ProtocolImpl\",\"$1.Alleged: ProtocolHandler\"]]","slots":["o-106","o+17"]},"result":"p-61"}]]
[74,["message","o+18",{"methargs":{"body":"#[\"downcall\",[\"bindPort\",{\"packet\":{\"source_port\":\"echo\"}}]]","slots":[]},"result":"p-62"}]]
[77,["message","o+20",{"methargs":{"body":"#[\"onListen\",[\"$0.Alleged: Port\",\"$1.Alleged: listener\"]]","slots":["o-116","o+20"]},"result":"p-63"}]]
[93,["message","o+21",{"methargs":{"body":"#[\"update\",[\"ubld\",{\"brand\":\"$0.Alleged: BLD brand\",\"denom\":\"ubld\",\"displayInfo\":{\"assetKind\":\"nat\",\"decimalPlaces\":6},\"issuer\":\"$1.Alleged: BLD issuer\",\"issuerName\":\"BLD\",\"proposedName\":\"Agoric staking token\"}]]","slots":["o-126","o-125"]},"result":"p-64"}]]
[96,["message","o+21",{"methargs":{"body":"#[\"update\",[\"uist\",{\"brand\":\"$0.Alleged: IST brand\",\"denom\":\"uist\",\"displayInfo\":{\"assetKind\":\"nat\",\"decimalPlaces\":6},\"issuer\":\"$1.Alleged: IST issuer\",\"issuerName\":\"IST\",\"proposedName\":\"Agoric stable token\"}]]","slots":["o-110","o-100"]},"result":"p-65"}]]
[418,["message","o+21",{"methargs":{"body":"#[\"update\",[\"ibc/toyusdc\",{\"brand\":\"$0.Alleged: USDC_axl brand\",\"denom\":\"ibc/toyusdc\",\"displayInfo\":{\"assetKind\":\"nat\",\"decimalPlaces\":6},\"issuer\":\"$1.Alleged: USDC_axl issuer\",\"issuerName\":\"USDC_axl\",\"proposedName\":\"USD Coin\"}]]","slots":["o-198","o-176"]},"result":"p-69"}]]
[419,["message","o+21",{"methargs":{"body":"#[\"update\",[\"ibc/usdc5678\",{\"brand\":\"$0.Alleged: USDC_grv brand\",\"denom\":\"ibc/usdc5678\",\"displayInfo\":{\"assetKind\":\"nat\",\"decimalPlaces\":6},\"issuer\":\"$1.Alleged: USDC_grv issuer\",\"issuerName\":\"USDC_grv\",\"proposedName\":\"USC Coin\"}]]","slots":["o-199","o-180"]},"result":"p-70"}]]
[420,["message","o+21",{"methargs":{"body":"#[\"update\",[\"ibc/usdt1234\",{\"brand\":\"$0.Alleged: USDT_axl brand\",\"denom\":\"ibc/usdt1234\",\"displayInfo\":{\"assetKind\":\"nat\",\"decimalPlaces\":6},\"issuer\":\"$1.Alleged: USDT_axl issuer\",\"issuerName\":\"USDT_axl\",\"proposedName\":\"Tether USD\"}]]","slots":["o-200","o-184"]},"result":"p-71"}]]
[421,["message","o+21",{"methargs":{"body":"#[\"update\",[\"ibc/toyollie\",{\"brand\":\"$0.Alleged: USDT_grv brand\",\"denom\":\"ibc/toyollie\",\"displayInfo\":{\"assetKind\":\"nat\",\"decimalPlaces\":6},\"issuer\":\"$1.Alleged: USDT_grv issuer\",\"issuerName\":\"USDT_grv\",\"proposedName\":\"Tether USD\"}]]","slots":["o-201","o-188"]},"result":"p-72"}]]
[422,["message","o+21",{"methargs":{"body":"#[\"update\",[\"ibc/toyellie\",{\"brand\":\"$0.Alleged: AUSD brand\",\"denom\":\"ibc/toyellie\",\"displayInfo\":{\"assetKind\":\"nat\",\"decimalPlaces\":6},\"issuer\":\"$1.Alleged: AUSD issuer\",\"issuerName\":\"AUSD\",\"proposedName\":\"Anchor USD\"}]]","slots":["o-202","o-192"]},"result":"p-73"}]]
[423,["message","o+32",{"methargs":{"body":"#[\"getAssetSubscription\",[]]","slots":[]},"result":"p-74"}]]
[583,["message","o+21",{"methargs":{"body":"#[\"update\",[\"ibc/toyatom\",{\"brand\":\"$0.Alleged: ATOM brand\",\"denom\":\"ibc/toyatom\",\"displayInfo\":{\"assetKind\":\"nat\",\"decimalPlaces\":6},\"issuer\":\"$1.Alleged: ATOM issuer\",\"issuerName\":\"ATOM\",\"proposedName\":\"ATOM\"}]]","slots":["o-197","o-172"]},"result":"p-75"}]]
[614,["message","o+0",{"methargs":{"body":"#[\"messageVat\",[{\"args\":[\"vaultFactoryKit\"],\"methodName\":\"consumeItem\",\"name\":\"bootstrap\"}]]","slots":[]},"result":"p-76"}]]
[615,["message","o+0",{"methargs":{"body":"#[\"messageVat\",[{\"args\":[\"walletFactoryStartResult\"],\"methodName\":\"consumeItem\",\"name\":\"bootstrap\"}]]","slots":[]},"result":"p-77"}]]
[616,["message","o+0",{"methargs":{"body":"#[\"messageVat\",[{\"args\":[\"bankManager\"],\"methodName\":\"consumeItem\",\"name\":\"bootstrap\"}]]","slots":[]},"result":"p-78"}]]
[617,["message","o+0",{"methargs":{"body":"#[\"messageVat\",[{\"args\":[\"namesByAddressAdmin\"],\"methodName\":\"consumeItem\",\"name\":\"bootstrap\"}]]","slots":[]},"result":"p-79"}]]

@dckc
Copy link
Member

dckc commented May 2, 2023

Bootstrap export audit results

8c6d63e

test('audit bootstrap exports', async t => {
  const expectedIfaces = [
    // in bridgeCoreEval()
    // TODO(#7576): support unregister
    'coreHandler',
    // in bridgeProvisioner()
    // TODO(#7576): support unregister
    'provisioningHandler',
    // makePrioritySendersManager() TODO(#7576): support unregister
    'prioritySenders manager',
    // TODO? move to provisioning vat?
    'clientCreator',
    // in registerNetworkProtocols(). TODO: outboard #7044
    'ProtocolHandler', // in makeLoopbackProtocolHandler()
    'callbacks',
    'listener',
    // TODO(#7563): disable stakeFactory in test-vaults-config
    'stakeReporter',
  ];

see also scheduled work:

and not yet scheduled:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cosmic-swingset package: cosmic-swingset enhancement New feature or request vaults_triage DO NOT USE
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants