Skip to content

Commit

Permalink
refactor(lib/runtime): remove wasmer runtime.Instance implementation (
Browse files Browse the repository at this point in the history
  • Loading branch information
timwu20 authored Aug 16, 2023
1 parent 344461d commit 0b06742
Show file tree
Hide file tree
Showing 16 changed files with 1 addition and 6,907 deletions.
17 changes: 0 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,23 +81,6 @@ make install

To install Gossamer

#### Troubleshooting for Apple Silicon users

Apple Silicon users may encounter these errors:

```sh
undefined: cWasmerImportObjectT
undefined: cWasmerImportFuncT
undefined: cWasmerValueTag
```

If so, set the following
[Golang environment variables](https://pkg.go.dev/cmd/go#hdr-Environment_variables):

```sh
GOARCH="amd64"
```

## Use Gossamer

A comprehensive guide to
Expand Down
3 changes: 1 addition & 2 deletions config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import (
"github.com/ChainSafe/gossamer/lib/common"
"github.com/ChainSafe/gossamer/lib/genesis"
"github.com/ChainSafe/gossamer/lib/os"
"github.com/ChainSafe/gossamer/lib/runtime/wasmer"
wazero "github.com/ChainSafe/gossamer/lib/runtime/wazero"
)

Expand Down Expand Up @@ -279,7 +278,7 @@ func (c *CoreConfig) ValidateBasic() error {
if c.WasmInterpreter == "" {
return fmt.Errorf("wasm-interpreter cannot be empty")
}
if c.WasmInterpreter != wasmer.Name && c.WasmInterpreter != wazero.Name {
if c.WasmInterpreter != wazero.Name {
return fmt.Errorf("wasm-interpreter is invalid")
}

Expand Down
17 changes: 0 additions & 17 deletions dot/services.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ import (
"github.com/ChainSafe/gossamer/lib/grandpa"
"github.com/ChainSafe/gossamer/lib/keystore"
"github.com/ChainSafe/gossamer/lib/runtime"
"github.com/ChainSafe/gossamer/lib/runtime/wasmer"
wazero_runtime "github.com/ChainSafe/gossamer/lib/runtime/wazero"
)

Expand Down Expand Up @@ -149,22 +148,6 @@ func createRuntime(config *cfg.Config, ns runtime.NodeStorage, st *state.Service
return nil, fmt.Errorf("failed to parse wasmer log level: %w", err)
}
switch config.Core.WasmInterpreter {
case wasmer.Name:
rtCfg := wasmer.Config{
Storage: ts,
Keystore: ks,
LogLvl: wasmerLogLevel,
NodeStorage: ns,
Network: net,
Role: config.Core.Role,
CodeHash: codeHash,
}

// create runtime executor
rt, err = wasmer.NewInstance(code, rtCfg)
if err != nil {
return nil, fmt.Errorf("failed to create runtime executor: %s", err)
}
case wazero_runtime.Name:
rtCfg := wazero_runtime.Config{
Storage: ts,
Expand Down
37 changes: 0 additions & 37 deletions lib/runtime/wasmer/config.go

This file was deleted.

35 changes: 0 additions & 35 deletions lib/runtime/wasmer/config_test.go

This file was deleted.

Loading

0 comments on commit 0b06742

Please sign in to comment.