Run clang sanitizers in CI + workflow cleanup (#196)
* Run clang sanitizers in CI + workflow cleanup * Update makefile * Update workflow names * Simplify more * Run go benchmarks in CI * Fix indentation nits * Initialize variable in fr_is_one * Revert "Initialize variable in fr_is_one" This reverts commit f4c2749e410c68479f83d78c9a1780efe191c7fe. * Move .PHONY outside of condition
This commit is contained in:
parent
9b91f3b832
commit
4f0546af81
|
@ -1,4 +1,4 @@
|
||||||
name: CKZG tests
|
name: C
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
|
@ -8,12 +8,17 @@ on:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test-ckzg:
|
tests:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
||||||
with:
|
with:
|
||||||
submodules: recursive
|
submodules: recursive
|
||||||
|
- name: Check formatting
|
||||||
|
run: |
|
||||||
|
cd src
|
||||||
|
make format
|
||||||
|
git diff --exit-code
|
||||||
- name: Build
|
- name: Build
|
||||||
run: |
|
run: |
|
||||||
cd src
|
cd src
|
||||||
|
@ -23,6 +28,10 @@ jobs:
|
||||||
run: |
|
run: |
|
||||||
cd src
|
cd src
|
||||||
make test
|
make test
|
||||||
|
- name: Clang Sanitizers
|
||||||
|
run: |
|
||||||
|
cd src
|
||||||
|
make sanitize
|
||||||
- name: Clang Static Analyzer
|
- name: Clang Static Analyzer
|
||||||
run: |
|
run: |
|
||||||
cd src
|
cd src
|
|
@ -1,4 +1,4 @@
|
||||||
name: C# bindings test and build
|
name: C#
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
inputs:
|
inputs:
|
|
@ -1,21 +0,0 @@
|
||||||
name: Formatting tests
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- main
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
test-format:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: actions/checkout@v3
|
|
||||||
with:
|
|
||||||
submodules: recursive
|
|
||||||
- name: Check formatting
|
|
||||||
run: |
|
|
||||||
cd src
|
|
||||||
make format
|
|
||||||
git diff --exit-code
|
|
|
@ -1,4 +1,4 @@
|
||||||
name: Go bindings tests
|
name: Go
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
|
@ -8,7 +8,7 @@ on:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test-go-bindings:
|
tests:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Setup Go
|
- name: Setup Go
|
||||||
|
@ -22,7 +22,11 @@ jobs:
|
||||||
- name: Test
|
- name: Test
|
||||||
run: |
|
run: |
|
||||||
cd bindings/go
|
cd bindings/go
|
||||||
go test .
|
go test
|
||||||
|
- name: Benchmark
|
||||||
|
run: |
|
||||||
|
cd bindings/go
|
||||||
|
go test -bench=Benchmark
|
||||||
- name: Check headers
|
- name: Check headers
|
||||||
run: |
|
run: |
|
||||||
cmp blst/bindings/blst.h bindings/go/blst_headers/blst.h
|
cmp blst/bindings/blst.h bindings/go/blst_headers/blst.h
|
|
@ -1,4 +1,4 @@
|
||||||
name: Java bindings tests
|
name: Java
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
|
@ -9,7 +9,7 @@ on:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test-java-bindings:
|
tests:
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
os: [ubuntu-latest, macos-latest, windows-latest]
|
os: [ubuntu-latest, macos-latest, windows-latest]
|
|
@ -1,4 +1,4 @@
|
||||||
name: Nim bindings tests
|
name: Nim
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
|
@ -8,7 +8,7 @@ on:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test:
|
tests:
|
||||||
runs-on: ${{ matrix.os }}
|
runs-on: ${{ matrix.os }}
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
|
@ -1,4 +1,4 @@
|
||||||
name: NodeJS bindings tests
|
name: NodeJS
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
|
@ -8,7 +8,7 @@ on:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test-nodejs-bindings:
|
tests:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
|
@ -1,4 +1,4 @@
|
||||||
name: Python bindings tests
|
name: Python
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
|
@ -8,7 +8,7 @@ on:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test-python-bindings:
|
tests:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
|
@ -1,4 +1,4 @@
|
||||||
name: Rust bindings tests
|
name: Rust
|
||||||
on:
|
on:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
|
@ -8,7 +8,7 @@ on:
|
||||||
- main
|
- main
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
test-rust-bindings:
|
tests:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v3
|
24
src/Makefile
24
src/Makefile
|
@ -95,6 +95,30 @@ profile: \
|
||||||
profile_verify_blob_kzg_proof \
|
profile_verify_blob_kzg_proof \
|
||||||
profile_verify_blob_kzg_proof_batch
|
profile_verify_blob_kzg_proof_batch
|
||||||
|
|
||||||
|
.PHONY: sanitize_%
|
||||||
|
sanitize_%: test_c_kzg_4844.c c_kzg_4844.c
|
||||||
|
@echo Running sanitize=$*...
|
||||||
|
@$(CC) $(CFLAGS) $(NO_OPTIMIZE) -fsanitize=$* -o $@ $< $(BLST)
|
||||||
|
@ASAN_OPTIONS=allocator_may_return_null=1 \
|
||||||
|
LSAN_OPTIONS=allocator_may_return_null=1 \
|
||||||
|
./$@; rm $@
|
||||||
|
|
||||||
|
ifneq ($(OS),Windows_NT)
|
||||||
|
UNAME_S := $(shell uname -s)
|
||||||
|
.PHONY: sanitize
|
||||||
|
ifeq ($(UNAME_S),Darwin)
|
||||||
|
sanitize: \
|
||||||
|
sanitize_address \
|
||||||
|
sanitize_undefined
|
||||||
|
else
|
||||||
|
sanitize: \
|
||||||
|
sanitize_address \
|
||||||
|
sanitize_leak \
|
||||||
|
sanitize_safe-stack \
|
||||||
|
sanitize_undefined
|
||||||
|
endif
|
||||||
|
endif
|
||||||
|
|
||||||
.PHONY: analyze
|
.PHONY: analyze
|
||||||
analyze: c_kzg_4844.c
|
analyze: c_kzg_4844.c
|
||||||
@$(CC) --analyze -Xanalyzer -analyzer-output=html \
|
@$(CC) --analyze -Xanalyzer -analyzer-output=html \
|
||||||
|
|
|
@ -259,7 +259,7 @@ static void test_fr_pow__test_inverse_on_root_of_unity(void) {
|
||||||
|
|
||||||
blst_fr_from_uint64(&a, SCALE2_ROOT_OF_UNITY[31]);
|
blst_fr_from_uint64(&a, SCALE2_ROOT_OF_UNITY[31]);
|
||||||
|
|
||||||
fr_pow(&r, &a, 1 << 31);
|
fr_pow(&r, &a, 1ULL << 31);
|
||||||
|
|
||||||
bool ok = fr_equal(&r, &FR_ONE);
|
bool ok = fr_equal(&r, &FR_ONE);
|
||||||
ASSERT_EQUALS(ok, true);
|
ASSERT_EQUALS(ok, true);
|
||||||
|
|
Loading…
Reference in New Issue