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

Objects flushed before archiving #268

Open
ReedOei opened this issue Jul 24, 2019 · 1 comment
Open

Objects flushed before archiving #268

ReedOei opened this issue Jul 24, 2019 · 1 comment

Comments

@ReedOei
Copy link
Collaborator

ReedOei commented Jul 24, 2019

Suppose we run the following code:

A a = new A();
B b = new B();
a.f();

Suppose that $B$ has the default initializer, which calls __flushEntries();. In this case, a will get flushed, but it has not yet been archived. Then when we run a.f(), it will attempt to load from the archive, even though it is not there. This can result in several issues: in particular, it will make a's GUID the empty string.

We could save the state every time we flush: not sure if this is safe or the best solution.

@mcoblenz
Copy link
Owner

We might be able to fix this by restricting flushing to the end of the main contract's constructor (as opposed to all of them).

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

No branches or pull requests

2 participants