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

fix(runtime): support new wasm opcodes by removing unused memory limit setting #299

Merged
merged 1 commit into from
Mar 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
503 changes: 246 additions & 257 deletions Cargo.lock

Large diffs are not rendered by default.

3 changes: 0 additions & 3 deletions core/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ it-memory-traits = { workspace = true }
bytesize = "1.1.0"

multimap = "0.8.3"
boolinator = "2.4.0"
parity-wasm = "0.45.0"
pwasm-utils = "0.19.0"
once_cell = "1.16.0"
semver = "1.0.14"
serde = "1.0.147"
Expand Down
2 changes: 0 additions & 2 deletions core/src/marine_core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,8 +108,6 @@ impl<WB: WasmBackend> MarineCore<WB> {
wasm_bytes: &[u8],
config: MModuleConfig<WB>,
) -> MResult<()> {
let _prepared_wasm_bytes =
crate::misc::prepare_module(wasm_bytes, config.max_heap_pages_count)?;
let module = MModule::new(
&name,
self.store.get_mut(),
Expand Down
19 changes: 0 additions & 19 deletions core/src/misc/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,6 @@ use thiserror::Error as ThisError;

#[derive(Debug, ThisError)]
pub enum PrepareError {
/// Error that raises on a Wasm module validation.
#[error("validation error: {0}, probably module is malformed")]
ParseError(#[from] parity_wasm::elements::Error),

#[error(transparent)]
HeapBaseInvalidOrMissing(#[from] HeapBaseError),

#[error("overflow was happened while summation globals size '{globals_pages_count}' and heap size '{max_heap_pages_count}'")]
MemSizesOverflow {
globals_pages_count: u32,
Expand Down Expand Up @@ -57,15 +50,3 @@ pub enum PrepareError {
provided: semver::Version,
},
}

#[derive(Debug, ThisError)]
pub enum HeapBaseError {
#[error("a Wasm module doesn't expose __heap_base entry")]
ExportNotFound,

#[error("__heap_base is initialized not by i32.const, but by a different set of instructions, that's unsupported")]
InitializationNotI32Const,

#[error("__heap_base has not a i32 type")]
WrongType,
}
3 changes: 0 additions & 3 deletions core/src/misc/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,9 @@
*/

mod errors;
mod prepare;
mod version_checker;

pub(crate) use errors::HeapBaseError;
pub(crate) use errors::PrepareError;
pub(crate) use prepare::prepare_module;
pub(crate) use version_checker::check_sdk_version;
pub(crate) use version_checker::check_it_version;

Expand Down
101 changes: 0 additions & 101 deletions core/src/misc/prepare.rs

This file was deleted.

80 changes: 0 additions & 80 deletions core/src/misc/prepare/heap_base.rs

This file was deleted.

2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[toolchain]
channel = "nightly-2022-12-01"
channel = "nightly-2023-03-12"
targets = [
"x86_64-unknown-linux-gnu",
"x86_64-unknown-linux-musl",
Expand Down