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

refactor(core): commit family of syscalls does not keep state between executions #4304

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

playX18
Copy link
Member

@playX18 playX18 commented Oct 22, 2024

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

@playX18 playX18 marked this pull request as ready for review October 22, 2024 02:55
@playX18 playX18 requested a review from breathx October 22, 2024 03:29
@playX18 playX18 added the A0-pleasereview PR is ready to be reviewed by the team label Oct 22, 2024
Copy link
Member

@breathx breathx left a 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
Copy link
Member

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]
Copy link
Member

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;
Copy link
Member

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());
Copy link
Member

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 {
Copy link
Member

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

@breathx
Copy link
Member

breathx commented Nov 5, 2024

Otherwise, lgtm

@breathx breathx added A3-gotissues PR occurred to have issues after the review and removed A0-pleasereview PR is ready to be reviewed by the team labels Nov 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A3-gotissues PR occurred to have issues after the review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants