-
Notifications
You must be signed in to change notification settings - Fork 105
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
refactor(core): commit family of syscalls does not keep state between executions #4304
base: master
Are you sure you want to change the base?
Conversation
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.
Also need to fix CI
None, | ||
Some("STORED COMMON"), | ||
Some("STORED REPLY"), | ||
// payload is not kept between executions so we get a panic here |
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.
tests for dedicated functionality should be removed
@@ -814,18 +814,13 @@ mod tests { | |||
Error::OutgoingMessagesBytesLimitExceeded, | |||
); | |||
} | |||
|
|||
#[test] | |||
/* #[test] |
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.
why?
@@ -583,7 +582,8 @@ impl MessageContext { | |||
} | |||
|
|||
/// Destructs context after execution and returns provided outcome and store. | |||
pub fn drain(self) -> (ContextOutcome, ContextStore) { | |||
pub fn drain(mut self) -> (ContextOutcome, ContextStore) { | |||
self.store.local_nonce += self.tmp_store.outgoing.len() as u32; |
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.
that's kind of dangerous, since we could adjust local nonce on each access, so I'd go this way
Some(Some(data)) => data, | ||
Some(None) => return Err(Error::LateAccess), | ||
None => return Err(Error::OutOfBounds), | ||
None => { | ||
// debug!("OOB: {:#?}", backtrace::Backtrace::new().frames()); |
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.
deadcode
@@ -141,33 +141,39 @@ impl ContextOutcome { | |||
} | |||
} | |||
} | |||
/// Store of current temporary message execution context. | |||
#[derive(Clone, Default, Debug, Eq, Hash, Ord, PartialEq, PartialOrd, Decode, Encode, TypeInfo)] | |||
pub struct TmpStore { |
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.
I'd consider other naming options. Could be "Payloads" or something like that
Otherwise, lgtm |
New PR based on #4288 but with cleaner code and solution that does not break a fuzzer. Still WIP but all that is left is write a migration and fix tests.
@breathx