Skip to content

Commit

Permalink
Update wazero dependency to v1.8.3 and refactor runtime configuration…
Browse files Browse the repository at this point in the history
… in WazeroRuntime initialization to use the interperter
  • Loading branch information
faddat committed Jan 17, 2025
1 parent 666a5de commit 46e0a04
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ require (
github.com/kilic/bls12-381 v0.1.0
github.com/shamaton/msgpack/v2 v2.2.0
github.com/stretchr/testify v1.8.1
github.com/tetratelabs/wazero v1.8.2
github.com/tetratelabs/wazero v1.8.3-0.20250117122819-451d3fb51fcc
golang.org/x/sys v0.16.0
)

Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKs
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/tetratelabs/wazero v1.8.2 h1:yIgLR/b2bN31bjxwXHD8a3d+BogigR952csSDdLYEv4=
github.com/tetratelabs/wazero v1.8.2/go.mod h1:yAI0XTsMBhREkM/YDAK/zNou3GoiAce1P6+rp/wQhjs=
github.com/tetratelabs/wazero v1.8.3-0.20250117122819-451d3fb51fcc h1:999ogLrC4VG/XOYmWPFQigpA9Y+ZPRxk+fWp3QQJjkQ=
github.com/tetratelabs/wazero v1.8.3-0.20250117122819-451d3fb51fcc/go.mod h1:yAI0XTsMBhREkM/YDAK/zNou3GoiAce1P6+rp/wQhjs=
golang.org/x/sys v0.0.0-20201101102859-da207088b7d1/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
golang.org/x/sys v0.16.0 h1:xWw16ngr6ZMtmxDyKyIgsE93KNKz5HKmMa3b8ALHidU=
golang.org/x/sys v0.16.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
Expand Down
10 changes: 5 additions & 5 deletions internal/runtime/wazeroruntime.go
Original file line number Diff line number Diff line change
Expand Up @@ -159,12 +159,12 @@ func (mm *memoryManager) writeToMemory(data []byte, printDebug bool) (uint32, ui

func NewWazeroRuntime() (*WazeroRuntime, error) {
// Create a new wazero runtime with memory configuration
runtimeConfig := wazero.NewRuntimeConfig().
WithMemoryLimitPages(1024). // Set max memory to 64 MiB (1024 * 64KB)
WithMemoryCapacityFromMax(true). // Eagerly allocate memory to ensure it's initialized
WithDebugInfoEnabled(true) // Enable debug info
// runtimeConfig := wazero.NewRuntimeConfig().
// WithMemoryLimitPages(1024). // Set max memory to 64 MiB (1024 * 64KB)
// WithMemoryCapacityFromMax(true). // Eagerly allocate memory to ensure it's initialized
// WithDebugInfoEnabled(true) // Enable debug info

r := wazero.NewRuntimeWithConfig(context.Background(), runtimeConfig)
r := wazero.NewRuntimeWithConfig(context.Background(), wazero.NewRuntimeConfigInterpreter())

// Create mock implementations
kvStore := &MockKVStore{}
Expand Down

0 comments on commit 46e0a04

Please sign in to comment.