-
Notifications
You must be signed in to change notification settings - Fork 206
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
ZCF registerFeeMint fails reincarnation #7502
Comments
Here's the sequence of VRM
It looks like something in the I think the "check deserialize preceeding kind definitions" error message should cite If this test lends itself to a debugger, try putting a breakpoint on calls to |
(nevermind, I misread my logs) |
Ok, so I think there's an initialization inversion in
We have one Kind for the factory (of which there is only ever one instance), and another Kind for each mint/keyword (of which there is only one instance per keyword). So call those the 1+N Kinds Mints are created at runtime, some arbitrarily long time after the contract vat is first created. When the contract is upgraded, we must re-initialize (call The top-level export of
Each time someone calls
The end of for (const zcfMintBaggage of zcfMintBaggageSet.values()) {
provideDurableZcfMint(zcfMintBaggage);
} Baggage contents after ZCF initializationWhen
Baggage contents after first mint createdAfter someone calls
Baggage contents after second mint createdThen after someone calls it again for keyword B, we get:
Upgrde / Kind redefinitionNow an upgrade happens, and our loop wants to redefine everything: for (const zcfMintBaggage of zcfMintBaggageSet.values()) {
provideDurableZcfMint(zcfMintBaggage);
} The ProblemsBased on the name, I think async makeZCFMintInternal(keyword, zoeMint) {
const zcfMintBaggage = makeScalarBigMapStore('zcfMintBaggage', {
durable: true,
});
const zcfMint = await makeDurableZcfMint(
keyword,
zoeMint,
zcfMintBaggage,
);
zcfMintBaggageSet.add(zcfMint); // <-- HERE
return zcfMint;
}, to: zcfMintBaggageSet.add(zcfMintBaggage); // <-- HERE then the post-upgrade sequence would be:
Other Notes
|
Describe the bug
If a contract calls
registerFeeMint
then in its reincarnation (restartContract
) it will fail with the following error,To Reproduce
It works before restart,
but fails in restart,
Note the ZCF fix that makes this problem detected sooner: 7e3986a
Expected behavior
Contracts using registerFeeMint are restartable
The text was updated successfully, but these errors were encountered: