diff --git a/.gitignore b/.gitignore index c685c55c63..d5d719704f 100644 --- a/.gitignore +++ b/.gitignore @@ -26,5 +26,3 @@ tmp # node_modules used by polkadot.js/api tests tests/polkadotjs_test/node_modules !tests/polkadotjs_test/test/*.wasm - -*.json diff --git a/go.mod b/go.mod index 72a4e12c88..1590f63255 100644 --- a/go.mod +++ b/go.mod @@ -200,6 +200,6 @@ require ( go 1.21 -replace github.com/tetratelabs/wazero => github.com/ChainSafe/wazero v0.0.0-20240306154750-130c2d1dc80b +replace github.com/tetratelabs/wazero => github.com/ChainSafe/wazero v0.0.0-20240319130522-78b21a59bd5f replace github.com/centrifuge/go-substrate-rpc-client/v4 => github.com/timwu20/go-substrate-rpc-client/v4 v4.0.0-20231110032757-3d8e441b7303 diff --git a/go.sum b/go.sum index 18f3d3eb15..9432b70c26 100644 --- a/go.sum +++ b/go.sum @@ -10,8 +10,8 @@ git.apache.org/thrift.git v0.0.0-20180902110319-2566ecd5d999/go.mod h1:fPE2ZNJGy github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU= github.com/ChainSafe/go-schnorrkel v1.1.0 h1:rZ6EU+CZFCjB4sHUE1jIu8VDoB/wRKZxoe1tkcO71Wk= github.com/ChainSafe/go-schnorrkel v1.1.0/go.mod h1:ABkENxiP+cvjFiByMIZ9LYbRoNNLeBLiakC1XeTFxfE= -github.com/ChainSafe/wazero v0.0.0-20240306154750-130c2d1dc80b h1:EqM7+3eUCn0aKpB4Zr9527/D8xt6LAxHPZoaJMIr25I= -github.com/ChainSafe/wazero v0.0.0-20240306154750-130c2d1dc80b/go.mod h1:ytl6Zuh20R/eROuyDaGPkp82O9C/DJfXAwJfQ3X6/7Y= +github.com/ChainSafe/wazero v0.0.0-20240319130522-78b21a59bd5f h1:TUrrP3YSwSv2TB3Q02dWJD7A3VQoCzEQ2LNhX9sb0Jo= +github.com/ChainSafe/wazero v0.0.0-20240319130522-78b21a59bd5f/go.mod h1:ytl6Zuh20R/eROuyDaGPkp82O9C/DJfXAwJfQ3X6/7Y= github.com/DataDog/zstd v1.4.1/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= github.com/DataDog/zstd v1.4.5 h1:EndNeuB0l9syBZhut0wns3gV1hL8zX8LIu6ZiVHWLIQ= github.com/DataDog/zstd v1.4.5/go.mod h1:1jcaCB/ufaK+sKp1NBhlGmpz41jOoPQ35bpF36t7BBo= diff --git a/lib/runtime/allocator/freeing_bump.go b/lib/runtime/allocator/freeing_bump.go index 8f1b74bf46..380f64a5be 100644 --- a/lib/runtime/allocator/freeing_bump.go +++ b/lib/runtime/allocator/freeing_bump.go @@ -513,7 +513,7 @@ func bump(bumper *uint32, size uint32, mem runtime.Memory) (uint32, error) { currentPages, ok := pagesFromSize(mem.Size()) if !ok { - panic(fmt.Sprintf("cannot calculate current number of pages, current size: %d", mem.Size())) + panic(fmt.Sprintf("page size cannot fit into uint32, current memory size: %d", mem.Size())) } if currentPages >= requiredPages { @@ -556,7 +556,7 @@ func bump(bumper *uint32, size uint32, mem runtime.Memory) (uint32, error) { // pagesFromSize convert the given `size` in bytes into the number of pages. // The returned number of pages is ensured to be big enough to hold memory // with the given `size`. -// Returns false if the number of pages do not fit into `uint32` +// Returns false if the number of pages does not fit into `uint32` func pagesFromSize(size uint64) (uint32, bool) { value := (size + uint64(PageSize) - 1) / uint64(PageSize)