-
Notifications
You must be signed in to change notification settings - Fork 11.4k
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
[FastX adapter/verifier] Implement Move module initializers #337
Changes from all commits
ce41193
b7c085b
fda1c07
c11f64f
1d9f823
29f6f79
69f77fd
56efb2f
02347ec
d471a59
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -198,11 +198,14 @@ impl Storage for AuthorityTemporaryStore { | |
} | ||
|
||
fn read_object(&self, id: &ObjectID) -> Option<Object> { | ||
match self.objects.get(id) { | ||
match self.written.get(id) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is changing the behavior of this function from "read the state of the object before executing the tx" to "read the state of the object after executing the tx, but before committing to persistent storage". This may very well be ok, but CC @lxfind @gdanezis to double check on this. Also, I think we should add a comment explaining what this does (pre-existing issue, but will help avoid some future confusion). There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wonder if we should return nothing if the object is in the There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think we need to clearly define (with comments) what the current new assumptions are and what could happen. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Even the original set of assumptions (e.g., why we expected only either a write or an update to the same object but not both) are a bit unclear to me, so I was not sure what is needed here. Perhaps we should go for the most general spec? That is:
Though I am not sure if we even need 1 if we have 2. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Based on the current need (i.e. module initializers), I think we only have:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. SG |
||
Some(x) => Some(x.clone()), | ||
None => match self.object_store.get_object(id) { | ||
Ok(o) => o, | ||
Err(e) => panic!("Could not read object {}", e), | ||
None => match self.objects.get(id) { | ||
Some(x) => Some(x.clone()), | ||
None => match self.object_store.get_object(id) { | ||
Ok(o) => o, | ||
Err(e) => panic!("Could not read object {}", e), | ||
}, | ||
}, | ||
} | ||
} | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Still wondering about this--do we have any tests that try publishing from the wallet? I'd expect them to fail unless they explicitly pass a nonzero gas budget, but perhaps I'm wrong on that...