Skip to content

Commit

Permalink
Separate wasmi and wasmer sandbox implementations into their own modu…
Browse files Browse the repository at this point in the history
…les (paritytech#10563)

* Moves wasmi specific `ImportResolver` and `MemoryTransfer` impls to submodule

* Splits context store environmental, moves impl `Externals` to wasmi backend

* Adds wasmer sandbox backend stub module

* Move sandbox impl code to backend specific modules

* Moves wasmi stuff

* Fixes value conversion

* Makes it all compile

* Remove `with_context_store`

* Moves `WasmerBackend` to the impl

* Reformat the source

* Moves wasmer MemoryWrapper

* Reformats the source

* Fixes mutability

* Moves backend impls to a submodule

* Fix visibility

* Reformat the source

* Feature gate wasmer backend module

* Moves wasmi memory allocation to backend module

* Rename WasmerBackend to Backend

* Refactor dispatch result decoding, get rid of Wasmi types in common sandbox code

* Reformat the source

* Remove redundant prefixes in backend functions

* Remove wasmer-sandbox from default features

* Post-review changes

* Add conversion soundness proof

* Remove redundant prefix

* Removes now redundant clone_inner

* Add `Error::SandboxBackend`, refactor invoke result

* Fix comments

* Rename `Error::SandboxBackend` to `Sandbox`

* Simplifies logic in `wasmer_backend::invoke`

* Fixes memory management
  • Loading branch information
0x7CFE authored and grishasobol committed Mar 28, 2022
1 parent 27653ee commit 499f78e
Show file tree
Hide file tree
Showing 7 changed files with 788 additions and 713 deletions.
3 changes: 3 additions & 0 deletions client/executor/common/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,9 @@ pub enum Error {
#[error(transparent)]
Wasmi(#[from] wasmi::Error),

#[error("Sandbox error: {0}")]
Sandbox(String),

#[error("Error calling api function: {0}")]
ApiError(Box<dyn std::error::Error + Send + Sync>),

Expand Down
Loading

0 comments on commit 499f78e

Please sign in to comment.