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

SPIKE: factor out Orch contract core-eval boilerplate #10695

Draft
wants to merge 21 commits into
base: master
Choose a base branch
from

Conversation

dckc
Copy link
Member

@dckc dckc commented Dec 16, 2024

refs:

Description

Drive most of the core-eval code from ContractMeta and permit.

  • generic Issuer / Brand handling
    • issuerKeywordRecord: derive from permit.issuer.consume
    • issuer / brand publishing: drive from permit.issuer.produce
    • extra BootstrapPowers: derive from meta.name, permit.issuer.produce, permit.brand.produce
  • meta.adminRoles generalizes sending oracle invitations
  • ContractMeta: move to a new .meta file so both contract and core-eval can get it without swallowing the other whole
    • likewise: FastUSDCConfigShape -> meta.deployConfigShape
    • contractName = meta.name
  • permit: move to fast-usdc.meta file to separate it from orch.start code
    • factor out typical permit stuff: orchPermit,
  • makePrivateArgs() remains custom code, though only for stuff beyond orchestrationPowers
  • finishDeploy() remains custom code: for publishFeedPolicy and calling creatorFacet methods

permit is down to ~15 LOC:

/** @satisfies {BootstrapManifestPermit} */
export const permit = /** @type {const} */ ({
produce: { [`${meta.name}Kit`]: true },
consume: { ...orchPermit, ...adminPermit },
instance: { produce: { [meta.name]: true } },
installation: { consume: { [meta.name]: true } },
issuer: {
consume: { USDC: true },
produce: { FastLP: true }, // UNTIL #10432
},
brand: {
produce: { FastLP: true }, // UNTIL #10432
},
});
harden(permit);

In order to keep it type-safe, meta and permit are imported. Maybe there's a way to parameterize the types or something so that the custom code can call the boilerplate. hm.

DRAFT until:

Security Considerations

This contributes somewhat to...

Scaling Considerations

n/a

Documentation Considerations

should simplify Writing a Core Eval Script to Deploy a Contract

Testing Considerations

For Fast USDC, existing tests should do it. It's essentially a pure refactor, but some of the filenames have runtime impact in builders and such, so it's possible that the changes are visible from tests.

Upgrade Considerations

This could / should make it less likely to mess up saving admin facets.

@dckc dckc force-pushed the pc/fusdc-multichain-macro branch from e084cac to 4a1e603 Compare December 16, 2024 03:25
@0xpatrickdev 0xpatrickdev force-pushed the pc/fusdc-multichain-macro branch from 295e818 to 4ce1540 Compare December 17, 2024 00:16
Base automatically changed from pc/fusdc-multichain-macro to master December 17, 2024 05:05
Copy link

cloudflare-workers-and-pages bot commented Dec 17, 2024

Deploying agoric-sdk with  Cloudflare Pages  Cloudflare Pages

Latest commit: 5d5d1eb
Status: ✅  Deploy successful!
Preview URL: https://e8b9266c.agoric-sdk.pages.dev
Branch Preview URL: https://dc-fu-autostart.agoric-sdk.pages.dev

View logs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant