Skip to content

Commit

Permalink
Merge pull request #59 from loopholelabs/staging
Browse files Browse the repository at this point in the history
Release v0.3.6
  • Loading branch information
ShivanshVij authored Feb 21, 2023
2 parents 7389549 + 0ddd47c commit edf10ea
Show file tree
Hide file tree
Showing 17 changed files with 353 additions and 2,526 deletions.
1 change: 1 addition & 0 deletions .github/workflows/typescript-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ jobs:
run: npm run build
- name: Publish to npm
run: npm publish --access public
working-dir: ./dist
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}

6 changes: 3 additions & 3 deletions .github/workflows/typescript-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
key: ${{ runner.os }}-${{ hashFiles('*.json') }}
- name: Install dependencies with npm
run: npm install --legacy-peer-deps
- name: Build with npm
run: npm run build
- name: Test with npm
run: npm run test
run: npm run test
- name: Build with npm
run: npm run build
8 changes: 0 additions & 8 deletions .parcelrc

This file was deleted.

22 changes: 21 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,25 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

## [v0.3.6] - 2023-02-19

### Features

- In the `Go` runtime module actions are now cancellable via the given context

### Changes

- Removing `parcel.js` and using the `typescript` compiler directly to build typescript libraries
- Renaming `@loopholelabs/scale-ts` library to `@loopholelabs/scale`
- Bumping `wazero` to `1.0.0-pre.9`

### Fixes

- Fixing bugs in the `DisabledWASI` Polyfill implementation where the proper error codes would not be returned (`fd_write`, `fd_read`, `environ...`, `args...`)
- Fixing bug in the `DisabledWASI` Polyfill implementation where the proper clock time would not get returned
- Making sure the `client`, `registry`, and `storage` typescript packages get exported and packaged properly
- Making sure modules that return an error get thrown away properly instead of being recycled

## [v0.3.5] - 2023-02-17

### Fixes
Expand Down Expand Up @@ -101,7 +120,8 @@ to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

- Initial release of the Scale Runtime library.

[unreleased]: https://github.com/loopholelabs/scale/compare/v0.3.5...HEAD
[unreleased]: https://github.com/loopholelabs/scale/compare/v0.3.6...HEAD
[v0.3.6]: https://github.com/loopholelabs/scale/compare/v0.3.6
[v0.3.5]: https://github.com/loopholelabs/scale/compare/v0.3.5
[v0.3.4]: https://github.com/loopholelabs/scale/compare/v0.3.4
[v0.3.3]: https://github.com/loopholelabs/scale/compare/v0.3.3
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ require (
github.com/loopholelabs/scale-signature-http v0.3.4
github.com/loopholelabs/scalefile v0.1.7
github.com/stretchr/testify v1.8.1
github.com/tetratelabs/wazero v1.0.0-pre.8
github.com/tetratelabs/wazero v1.0.0-pre.9
)

require (
Expand Down
4 changes: 2 additions & 2 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk=
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
github.com/tetratelabs/wazero v1.0.0-pre.8 h1:Ir82PWj79WCppH+9ny73eGY2qv+oCnE3VwMY92cBSyI=
github.com/tetratelabs/wazero v1.0.0-pre.8/go.mod h1:u8wrFmpdrykiFK0DFPiFm5a4+0RzsdmXYVtijBKqUVo=
github.com/tetratelabs/wazero v1.0.0-pre.9 h1:2uVdi2bvTi/JQxG2cp3LRm2aRadd3nURn5jcfbvqZcw=
github.com/tetratelabs/wazero v1.0.0-pre.9/go.mod h1:wYx2gNRg8/WihJfSDxA1TIL8H+GkfLYm+bIfbblu9VQ=
github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4=
github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
github.com/xdg-go/pbkdf2 v1.0.0/go.mod h1:jrpuAogTd400dnrH08LKmI/xc1MbPOebTwRqcT5RDeI=
Expand Down
7 changes: 2 additions & 5 deletions go/function.go
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,6 @@ func (f *Function[T]) Run(ctx context.Context, i *Instance[T]) error {
}

module.init(i)
defer func() {
module.reset()
f.modulePool.Put(module)
}()

ctxBuffer := i.runtimeContext().Write()
ctxBufferLength := uint64(len(ctxBuffer))
writeBuffer, err := module.resize.Call(ctx, ctxBufferLength)
Expand Down Expand Up @@ -75,5 +70,7 @@ func (f *Function[T]) Run(ctx context.Context, i *Instance[T]) error {
return fmt.Errorf("error while running function '%s': %w", f.scaleFunc.Name, err)
}

module.reset()
f.modulePool.Put(module)
return nil
}
2 changes: 1 addition & 1 deletion go/runtime.go
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ func NewWithSignature[T signature.Signature](ctx context.Context, sig signature.
}

r := &Runtime[T]{
runtime: wazero.NewRuntime(ctx),
runtime: wazero.NewRuntimeWithConfig(ctx, wazero.NewRuntimeConfig().WithCloseOnContextDone(true)),
moduleConfig: wazero.NewModuleConfig().WithSysNanotime().WithSysWalltime().WithRandSource(rand.Reader),
modules: make(map[string]*Module[T]),
new: sig,
Expand Down
Loading

0 comments on commit edf10ea

Please sign in to comment.