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

feat(cosmic-swingset): Add chainStorage interface #5385

Merged
merged 20 commits into from
Jun 4, 2022
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
028e7b6
feat(cosmic-swingset): Add chainStorage interface
gibson042 May 17, 2022
487f208
refactor(cosmic-swingset): Move makeChainStorageNode into a vat
gibson042 May 19, 2022
fcbd424
chore(cosmic-swingset): Respond to PR feedback
gibson042 May 19, 2022
7e45396
refactor(cosmic-swingset): Move chainStorage logic into a library
gibson042 May 20, 2022
61e05d1
chore: Improve child key checks and explanations
gibson042 May 23, 2022
8f7ed49
test: Add tests for chainStorage
gibson042 May 23, 2022
c40cc45
chore: Allow "-" in chain storage key segments
gibson042 May 23, 2022
53d9543
chore: Try to appease TypeScript
gibson042 May 26, 2022
02ba962
chore: Try harder to appease TypeScript
gibson042 May 26, 2022
db67d1e
style: Use a better TypeScript-compatible map initialization
gibson042 May 26, 2022
ac504dd
refactor: Create Go and JS constants for top-level chain storage paths
gibson042 May 31, 2022
9898385
refactor: Replace chain storage "key" with "path"
gibson042 Jun 2, 2022
265cd52
refactor: Move chain-storage-paths.js to avoid a module cycle
gibson042 Jun 2, 2022
69d8d4f
chore: Appease eslint
gibson042 Jun 2, 2022
3c7c270
fix: Try adding a delay to fix CI
gibson042 Jun 3, 2022
e718f25
chore: Include relevant lines from failing CI log
gibson042 Jun 3, 2022
fbd45fb
Merge branch 'master' into gibson-4558-chainStorage
mergify[bot] Jun 3, 2022
af35399
fix(swingset): louder anachrophobio
michaelfig Jun 4, 2022
14612b2
Merge remote-tracking branch 'origin/master' into gibson-4558-chainst…
michaelfig Jun 4, 2022
f22b8f8
ci(vats): correct `chainStorage` bundle in decentral configs
michaelfig Jun 4, 2022
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion packages/vats/src/core/chain-behaviors.js
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,13 @@ harden(makeBridgeManager);
* }} powers
*/
export const makeChainStorage = async ({
consume: { bridgeManager: bridgeManagerP, loadVat },
consume: {
bridgeManager: bridgeManagerP,
loadVat,
// provisioning is here to attempt delaying execution for avoiding failures like
// https://github.com/Agoric/agoric-sdk/runs/6728088019?check_suite_focus=true
Copy link
Member

Choose a reason for hiding this comment

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

copy 1 or 2 of the most relevant lines, please? ci log URLs have a limited lifetime.

Suggested change
// https://github.com/Agoric/agoric-sdk/runs/6728088019?check_suite_focus=true
// Error#1: historical inaccuracy in replay of v2 [vatAdmin]
// https://github.com/Agoric/agoric-sdk/runs/6728088019?check_suite_focus=true

provisioning: _provisioning,
},
produce: { chainStorage: chainStorageP },
}) => {
const bridgeManager = await bridgeManagerP;
Expand Down
3 changes: 3 additions & 0 deletions packages/vats/src/core/manifest.js
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,9 @@ const SHARED_CHAIN_BOOTSTRAP_MANIFEST = harden({
consume: {
bridgeManager: true,
loadVat: true,
// provisioning is here to attempt delaying execution for avoiding failures like
// https://github.com/Agoric/agoric-sdk/runs/6728088019?check_suite_focus=true
provisioning: true,
},
produce: {
chainStorage: true,
Copy link
Member Author

Choose a reason for hiding this comment

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

This produces chainStorage, but there is not currently anything to consume it. The biggest open question is "how should a derived capability be made available to vats—what makes new child nodes, and where do they get sent?" Neither @warner nor I could find an existing analog, but perhaps the board comes closest?

Some possible answers:

  • Zoe has access to the root node, and issues a child node of a common parent to contract instances that are somehow marked as privileged.
  • Something in the bootstrap code has access to the root node, and issues descendant nodes as directed by manifest data (either as part of startInstance or after the fact).
  • Other post-chain-initialization code has access to the root node, and issues descandant nodes as remoteables to already-running contract instances.

Copy link
Member

Choose a reason for hiding this comment

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

Summarising what I understood from the most recent conversation:

  • We start by bootstrap having access to the root node, as you have now, on which we will publish (via this publication mechanism) a name-to-storage-path mapping.
  • Governance "core eval" code will issue descendants to certain contracts via Zoe private arguments and update the name-to-storage path mapping.
  • We will use explicit ocap introduction patterns to obtain descendants and descendants of descendants outside bootstrap.
  • There's no pressing need for automatic allocation of descendants. Indeed, that's probably an antipattern until we're certain of performance characteristics.

Expand Down