-
Notifications
You must be signed in to change notification settings - Fork 12
feat!: napi-rs binding #149
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
142 commits
Select commit
Hold shift + click to select a range
9182d12
chore: add node 22 support
wemeetagain a72a898
chore: release v0.2.11
wemeetagain 56bc9f1
feat: explore napi-rs binding
wemeetagain 2ece252
feat: use signature sets in verifyMultipleAggregateSignatures
wemeetagain f9f386c
chore: fix batchVerify benchmark
wemeetagain f22a7c0
feat: simplify signature set handling, async functions
wemeetagain a74c710
wip
wemeetagain 596a302
err handling
ec2 68bea80
chore: more cleanup
wemeetagain 2b61c67
chore: use threads in blst crate
wemeetagain d9338a8
chore: add multithread benchmarks
wemeetagain 953cfe0
feat rough out sigVerify and perf test
matthewkeil f21ec91
chore: more cleanup
wemeetagain f2a0fbe
feat: add keyValidate
wemeetagain 4e294e9
chore: refresh index.d.ts
wemeetagain 573f500
feat: add eip 2333 fns
wemeetagain d66802c
feat: add aggregateSerialized fns
wemeetagain 6e2b25a
feat: add validation to from_bytes
wemeetagain 6c723ba
chore: refresh index.d.ts
wemeetagain 62021c5
chore: more cleanup
wemeetagain 5e56106
chore: fix blstOpts benchmark
wemeetagain bb8ac3a
chore: more cleanup
wemeetagain 0fd3570
feat: add hex helpers
wemeetagain 4913912
fix: validation in factories
wemeetagain 8b37df3
fix: default to sig_infcheck if sig_validate
wemeetagain 81080fa
chore: fmt
wemeetagain 223384d
feat: stringify BLST_ERROR
matthewkeil db1441c
feat: async aggregate* fns
wemeetagain 1df06d4
chore: remove stray comment
wemeetagain 8870f3e
feat: switch blst to matthewkeil fork for multiply_by
matthewkeil e408fe9
chore: update blst
matthewkeil d8ada41
chore: add settings.json so rust displays correctly
matthewkeil a8700e5
feat: add aggregate_with_randomness
matthewkeil cae50fd
chore: update blst
matthewkeil 208415c
refactor: change aggregate_with_randomness implementation
matthewkeil 2fa18b1
chore: use MultiPoint ops to do aggregate_with_randomness
wemeetagain bede4f0
chore: bench aggregation vs aggregate_with_randomness
wemeetagain e6c0d60
chore: add test aggregateWithMsm fn
wemeetagain 1e04885
chore: update blst
matthewkeil ae4db61
chore: use blst bindings
matthewkeil 5773a57
feat: implement to/from affine
matthewkeil f002234
feat: add verify_multiple_aggregate_signatures_same_message
wemeetagain 9ff0a1b
chore: cleanup
wemeetagain 8f97b71
chore: sig to Uint8Array everywhere
wemeetagain ba0ec86
chore: update napi-rs deps
wemeetagain 192de79
feat: add verify_multiple_signatures_same_message_with_retries
wemeetagain 0e4dd8f
fix: fix struct definition
wemeetagain 65d467d
feat: add verify_multiple_signatures_same_messages_with_retries
wemeetagain d2145c8
chore: change the shape of same message set
wemeetagain 0657730
fix: stray ref
wemeetagain 8057918
chore: tweak shape of same msg set
wemeetagain f6e3780
chore: add index.d.ts
wemeetagain 036a4c9
chore: update same msg shape
wemeetagain b266ea3
chore: use Signature instead of Uint8Array
wemeetagain 0beec38
chore: optimize aggregate fns
wemeetagain 6f0ff04
chore: update submodule
matthewkeil 301a304
Revert "chore: optimize aggregate fns"
wemeetagain 582a439
chore: fmt
wemeetagain 6faeec8
chore: move napi-rs bindings to root
wemeetagain 43f0e41
chore: replace tests
wemeetagain c9f725a
chore: start package.json cleanup
wemeetagain 3463ef2
chore: start fixing CI
wemeetagain d742cf5
chore: fix blst path
wemeetagain 709ed38
chore: get spec tests passing
wemeetagain e699baa
chore: remove experimental fns
wemeetagain f10063a
chore: better error codes
wemeetagain 05a4182
chore: cleanup
wemeetagain 8547d5a
chore: rebuild bindings
wemeetagain e6bc2cf
chore: simplify spec tests
wemeetagain d42bdf7
chore: comments
wemeetagain 34b75f6
chore: simplify
wemeetagain 23a5f46
chore: start fixing tests
wemeetagain aeac41d
chore: more test updates
wemeetagain e94c726
chore: pass unit tests
wemeetagain fc811de
chore: fix lint
wemeetagain 876fa3e
chore: fix perf test
wemeetagain 5a46596
chore: fix up package.json and CI
wemeetagain b6c7181
chore: more CI work
wemeetagain 1a5a1fe
chore: more ci
wemeetagain c513488
chore: more ci
wemeetagain adf4420
chore: add test console.log
wemeetagain 59c61f8
chore: update test
wemeetagain 9308878
chore: tweak test
wemeetagain 2ebe609
Merge branch 'cayman/napi-rs' into m
wemeetagain f059d58
chore: remove unused files
wemeetagain 80b65df
feat: add compress for to_bytes and to_hex
matthewkeil 5e2e290
test: add back tests for compressed/uncompressed
matthewkeil 2e41038
test: add bindings.test
matthewkeil c21a30c
test: add case for showing which aggregate index is invalid
matthewkeil 8a58bc7
chore: wip spec tests
wemeetagain 7f3e23d
Merge remote-tracking branch 'origin/cayman/napi-rs' into cayman/napi-rs
wemeetagain 4c96f1d
feat: build to_vec and fix to_hex
matthewkeil 9d996c7
chore: fix spec test functions
wemeetagain f2eb4bd
chore: fix spec tests
wemeetagain 5d6acac
chore: fix some unit tests
wemeetagain 659f047
chore: remove stray import
wemeetagain 5ef0c9a
test: check aggregateWithRandomness
matthewkeil 18aab68
test: add invalid test case to verifyMultipleAggregateSignatures.test
matthewkeil a74f894
test: fix fuzz tests to get working
matthewkeil 1259012
test: fix perf tests
matthewkeil 6bb9792
fix: remove Promise.all from runWorkRequest
matthewkeil d6a9ed7
chore: some cleanup
wemeetagain d7174dd
chore: add separate invalid hex error status
wemeetagain b4d9e34
chore: move fns
wemeetagain 10f761e
chore: remove verify_multiple_signatures_same_message
wemeetagain 44a14d6
chore: better hex error msgs
wemeetagain e0f3d06
fix: create_rand_slice
wemeetagain d5d16c7
fix: bindings test
wemeetagain 8b853d1
chore: revert license change
wemeetagain 7cbaa64
fix: add compress false in __fixtures__
matthewkeil e3398d5
Apply suggestions from code review
wemeetagain 22d0180
chore: remove yarn files
wemeetagain 1f2e538
chore: use napi8
wemeetagain 1d9b36e
chore: update yarn lock
wemeetagain b850568
chore: remove unused scripts
wemeetagain e921b82
chore: remove todo
wemeetagain a1be5a8
chore: refactor blst_error_to_reason
wemeetagain d5b3442
chore: cleanup spec test compatibility layer
wemeetagain cfcabfc
chore: remove default
wemeetagain 23031c4
chore: add check for unstaged changes
wemeetagain 5a47cc4
chore: pin node 22.4
wemeetagain bd3c889
chore: tweak workflow
wemeetagain 524c361
chore: use to_le_bytes
wemeetagain 52191be
chore: remove aggregate_with_randomness_native
wemeetagain fef413b
chore: update release workflow
wemeetagain f2c1ccb
chore: tweak workflow job names
wemeetagain 051bac9
fix: package.json engines node16+
matthewkeil 8bb18aa
chore: remove root utils folder
matthewkeil 53a858f
Merge branch 'cayman/napi-rs' of github.com:ChainSafe/blst-ts into ca…
matthewkeil 3bb0210
chore: cleanup .eslintrc.js
matthewkeil 4409af6
chore: touch up tsconfig.json
matthewkeil 3e7c221
docs: update CONTRIBUTING.md
matthewkeil 56280fa
Update README.md
wemeetagain 33b4e38
Update src/lib.rs
wemeetagain 31bb3da
chore: tweak aggregate_with
wemeetagain 03acbf8
chore: use to_ne_bytes
wemeetagain 8e3f9bb
Update src/lib.rs
wemeetagain 6da455b
chore: tweak comment
wemeetagain b867afb
chore: remove multithreading tests
wemeetagain 67971cf
chore: update index.d.ts
wemeetagain 92d643b
chore: fix lint error
wemeetagain bba7a0a
chore: update comment
wemeetagain File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,2 @@ | ||
| [target.x86_64-pc-windows-msvc] | ||
| rustflags = ["-C", "target-feature=+crt-static"] |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,284 @@ | ||
| name: CI | ||
| env: | ||
| DEBUG: napi:* | ||
| APP_NAME: blst | ||
| MACOSX_DEPLOYMENT_TARGET: '10.13' | ||
| permissions: | ||
| contents: write | ||
| id-token: write | ||
|
|
||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: | ||
| - master | ||
|
|
||
| jobs: | ||
| build: | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| settings: | ||
| - host: macos-latest | ||
| target: x86_64-apple-darwin | ||
| build: yarn build --target x86_64-apple-darwin | ||
| - host: windows-latest | ||
| build: yarn build --target x86_64-pc-windows-msvc | ||
| target: x86_64-pc-windows-msvc | ||
| - host: ubuntu-latest | ||
| target: x86_64-unknown-linux-gnu | ||
| docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian | ||
| build: yarn build --target x86_64-unknown-linux-gnu | ||
| - host: macos-latest | ||
| target: aarch64-apple-darwin | ||
| build: yarn build --target aarch64-apple-darwin | ||
| - host: ubuntu-latest | ||
| target: aarch64-unknown-linux-gnu | ||
| docker: ghcr.io/napi-rs/napi-rs/nodejs-rust:lts-debian-aarch64 | ||
| build: yarn build --target aarch64-unknown-linux-gnu | ||
| name: Build - ${{ matrix.settings.target }} - node@22 | ||
| runs-on: ${{ matrix.settings.host }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| with: | ||
| submodules: true | ||
| - name: Setup node | ||
| uses: actions/setup-node@v4 | ||
| if: ${{ !matrix.settings.docker }} | ||
| with: | ||
| node-version: '22.4.x' | ||
| cache: yarn | ||
| - name: Install | ||
| uses: dtolnay/rust-toolchain@stable | ||
| if: ${{ !matrix.settings.docker }} | ||
| with: | ||
| toolchain: stable | ||
| targets: ${{ matrix.settings.target }} | ||
| - name: Cache cargo | ||
| uses: actions/cache@v4 | ||
| with: | ||
| path: | | ||
| ~/.cargo/registry/index/ | ||
| ~/.cargo/registry/cache/ | ||
| ~/.cargo/git/db/ | ||
| .cargo-cache | ||
| target/ | ||
| key: ${{ matrix.settings.target }}-cargo-${{ matrix.settings.host }} | ||
| - uses: goto-bus-stop/setup-zig@v2 | ||
| if: ${{ matrix.settings.target == 'armv7-unknown-linux-gnueabihf' || matrix.settings.target == 'armv7-unknown-linux-musleabihf' }} | ||
| with: | ||
| version: 0.11.0 | ||
| - name: Setup toolchain | ||
| run: ${{ matrix.settings.setup }} | ||
| if: ${{ matrix.settings.setup }} | ||
| shell: bash | ||
| - name: Setup node x86 | ||
| if: matrix.settings.target == 'i686-pc-windows-msvc' | ||
| run: yarn config set supportedArchitectures.cpu "ia32" | ||
| shell: bash | ||
| - name: Install dependencies | ||
| run: yarn install | ||
| - name: Setup node x86 | ||
| uses: actions/setup-node@v4 | ||
| if: matrix.settings.target == 'i686-pc-windows-msvc' | ||
| with: | ||
| node-version: '22.4.x' | ||
| cache: yarn | ||
| architecture: x86 | ||
| - name: Build in docker | ||
| uses: addnab/docker-run-action@v3 | ||
| if: ${{ matrix.settings.docker }} | ||
| with: | ||
| image: ${{ matrix.settings.docker }} | ||
| options: '--user 0:0 -v ${{ github.workspace }}/.cargo-cache/git/db:/usr/local/cargo/git/db -v ${{ github.workspace }}/.cargo/registry/cache:/usr/local/cargo/registry/cache -v ${{ github.workspace }}/.cargo/registry/index:/usr/local/cargo/registry/index -v ${{ github.workspace }}:/build -w /build' | ||
| run: ${{ matrix.settings.build }} | ||
| - name: Build | ||
| run: ${{ matrix.settings.build }} | ||
| if: ${{ !matrix.settings.docker }} | ||
| shell: bash | ||
| - name: Upload artifact | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: bindings-${{ matrix.settings.target }} | ||
| path: ${{ env.APP_NAME }}.*.node | ||
| if-no-files-found: error | ||
| test-macOS-windows-binding: | ||
| name: Test - ${{ matrix.settings.target }} - node@${{ matrix.node }} | ||
| needs: | ||
| - build | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| settings: | ||
| - host: macos-latest | ||
| target: x86_64-apple-darwin | ||
| - host: windows-latest | ||
| target: x86_64-pc-windows-msvc | ||
| node: | ||
| - '18' | ||
| - '22.4.x' | ||
| runs-on: ${{ matrix.settings.host }} | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Setup node | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ matrix.node }} | ||
| cache: yarn | ||
| architecture: x64 | ||
| - name: Install dependencies | ||
| run: yarn install | ||
| - name: Download artifacts | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: bindings-${{ matrix.settings.target }} | ||
| path: . | ||
| - name: List packages | ||
| run: ls -R . | ||
| shell: bash | ||
| - name: Test bindings | ||
| run: yarn test:unit | ||
| - name: Download spec tests | ||
| run: yarn download-spec-tests | ||
| - name: Spec tests | ||
| run: yarn test:spec | ||
|
|
||
| test-linux-x64-gnu-binding: | ||
| name: Test - Linux-x64-gnu - node@${{ matrix.node }} | ||
| needs: | ||
| - build | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| node: | ||
| - '18' | ||
| - '22.4.x' | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Setup node | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: ${{ matrix.node }} | ||
| cache: yarn | ||
| - name: Install dependencies | ||
| run: yarn install | ||
| - name: Download artifacts | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: bindings-x86_64-unknown-linux-gnu | ||
| path: . | ||
| - name: List packages | ||
| run: ls -R . | ||
| shell: bash | ||
| - name: Lint project | ||
| run: yarn lint | ||
| - name: Run napi version | ||
| run: yarn run version | ||
| - name: Ensure there are no unstaged changes | ||
| run: git diff --exit-code | ||
| - name: Test bindings | ||
| run: yarn test:unit | ||
| - name: Download spec tests | ||
| run: yarn download-spec-tests | ||
| - name: Spec tests | ||
| run: yarn test:spec | ||
|
|
||
| test-linux-aarch64-gnu-binding: | ||
| name: Test - aarch64-unknown-linux-gnu - node@${{ matrix.node }} | ||
| needs: | ||
| - build | ||
| strategy: | ||
| fail-fast: false | ||
| matrix: | ||
| node: | ||
| - '18' | ||
| - 22.4 | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Download artifacts | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: bindings-aarch64-unknown-linux-gnu | ||
| path: . | ||
| - name: List packages | ||
| run: ls -R . | ||
| shell: bash | ||
| - name: Install dependencies | ||
| run: | | ||
| yarn config set supportedArchitectures.cpu "arm64" | ||
| yarn config set supportedArchitectures.libc "glibc" | ||
| yarn install | ||
| - name: Set up QEMU | ||
| uses: docker/setup-qemu-action@v3 | ||
| with: | ||
| platforms: arm64 | ||
| - run: docker run --rm --privileged multiarch/qemu-user-static --reset -p yes | ||
| - name: Setup and run tests | ||
| uses: addnab/docker-run-action@v3 | ||
| with: | ||
| image: node:${{ matrix.node }}-slim | ||
| options: '--platform linux/arm64 -v ${{ github.workspace }}:/build -w /build' | ||
| run: | | ||
| set -e | ||
| yarn test:unit | ||
| yarn download-spec-tests | ||
| yarn test:spec | ||
| ls -la | ||
| publish: | ||
| if: github.event_name != 'pull_request' && github.ref == 'refs/heads/master' | ||
| name: Publish | ||
| runs-on: ubuntu-latest | ||
| needs: | ||
| - test-macOS-windows-binding | ||
| - test-linux-x64-gnu-binding | ||
| - test-linux-aarch64-gnu-binding | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - name: Setup node | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: '22.4.x' | ||
| cache: yarn | ||
| - name: Create tag | ||
| id: tag | ||
| uses: butlerlogic/action-autotag@1.1.2 | ||
| with: | ||
| strategy: package | ||
| tag_prefix: "v" | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| - name: Exit if no version change | ||
| if: steps.tag.outputs.tagcreated == 'no' | ||
| uses: actions/github-script@v3 | ||
| with: | ||
| script: core.setFailed('The package.json version did not change. Workflow will not create a release.') | ||
| - name: Install dependencies | ||
| run: yarn install | ||
| - name: Download all artifacts | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| path: artifacts | ||
| - name: Move artifacts | ||
| run: yarn artifacts | ||
| - name: List packages | ||
| run: ls -R ./npm | ||
| shell: bash | ||
| - name: Publish | ||
| run: | | ||
| npm config set provenance true | ||
| if node -e "console.log(require('./package.json').version)" | grep "v[0-9]\+\.[0-9]\+\.[0-9]\+$"; | ||
| then | ||
| echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc | ||
| npm publish --access public | ||
| elif node -e "console.log(require('./package.json').version)" | grep "^[0-9]\+\.[0-9]\+\.[0-9]\+"; | ||
| then | ||
| echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >> ~/.npmrc | ||
| npm publish --tag next --access public | ||
| else | ||
| echo "Not a release, skipping publish" | ||
| fi | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.