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

add additional checks for gear stack end in Code::try_new #3735

Closed
grishasobol opened this issue Feb 14, 2024 · 0 comments · Fixed by #3811
Closed

add additional checks for gear stack end in Code::try_new #3735

grishasobol opened this issue Feb 14, 2024 · 0 comments · Fixed by #3811
Assignees
Labels
C2-refactoring Refactoring proposal

Comments

@grishasobol
Copy link
Member

File Location(s)

core/src/code/mod.rs
core-processor/src/execute.rs

Proposal

Check this cases in Code::try_new

#[derive(Encode, Decode, TypeInfo, Debug, PartialEq, Eq, PartialOrd, Ord, derive_more::Display)]
#[codec(crate = scale)]
pub enum ActorPrepareMemoryError {
/// Stack end page, which value is specified in WASM code, cannot be bigger than static memory size.
#[display(fmt = "Stack end page {_0:?} is bigger then WASM static memory size {_1:?}")]
StackEndPageBiggerWasmMemSize(WasmPage, WasmPage),
/// Stack is not aligned to WASM page size
#[display(fmt = "Stack end addr {_0:#x} must be aligned to WASM page size")]
StackIsNotAligned(u32),
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C2-refactoring Refactoring proposal
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant