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

Pass baggage in ZCF through buildRootObject to start() #5658

Closed
wants to merge 18 commits into from

Conversation

Chris-Hibbert
Copy link
Contributor

refs: #5593
refs: #5635

Description

Pass the baggage provided to buildRootObject() to startContract(), which calls start(), to make it available to the zoe contract.

Security Considerations

contract has its own sub-baggage.

Documentation Considerations

When we write up durability, the Zoe contract interface needs to mention that the baggage comes in a separate argument after privateArgs.

Testing Considerations

We'll need a test showing upgrade of a contract, but we already knew that.

@Chris-Hibbert Chris-Hibbert added Zoe package: Zoe Zoe Contract Contracts within Zoe labels Jun 23, 2022
@Chris-Hibbert Chris-Hibbert added this to the Mainnet 1 milestone Jun 23, 2022
@Chris-Hibbert Chris-Hibbert requested a review from erights June 23, 2022 17:43
@Chris-Hibbert Chris-Hibbert self-assigned this Jun 23, 2022
@Chris-Hibbert Chris-Hibbert marked this pull request as draft June 23, 2022 21:54
Copy link
Member

@erights erights left a comment

Choose a reason for hiding this comment

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

LGTM

Comment on lines +51 to +53
const contractBaggage = provide(baggage, 'contractBaggage', () =>
makeScalarBigMapStore('zoeContract'),
);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
const contractBaggage = provide(baggage, 'contractBaggage', () =>
makeScalarBigMapStore('zoeContract'),
);
const contractBaggage = provideDurableMapStore(baggage, 'contractBaggage');

@@ -11,5 +11,6 @@
* instanceRecordFromZoe: InstanceRecord,
* issuerStorageFromZoe: IssuerRecords,
* privateArgs?: object,
* baggage?: MapStore<string,any>,
Copy link
Member

Choose a reason for hiding this comment

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

Also the startContract implementation in zcfZygote, right?

@Chris-Hibbert Chris-Hibbert force-pushed the cth-durable-zoe branch 4 times, most recently from bf46bdb to 3333d60 Compare June 28, 2022 23:48
@Chris-Hibbert
Copy link
Contributor Author

#5635 will include what's necessary.

@Chris-Hibbert Chris-Hibbert deleted the cth-zcfStartContracts branch October 5, 2022 20:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Zoe Contract Contracts within Zoe Zoe package: Zoe
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants