Repository navigation
build/depends: commit dashpay/bls-signatures@66ee820f to source tree as vendored - #5077
Merged
Merged
Conversation
kwvg
force-pushed
the
vendor_bls
branch
8 times, most recently
from
November 15, 2022 03:34
ada6f8b to
d431b52
Compare
kwvg
marked this pull request as ready for review
November 15, 2022 06:23
Member
|
Starting Gitian-Build |
git-subtree-dir: src/dashbls git-subtree-split: 66ee820fbc9e3b97370db8c164904af48327a124
PastaPastaPasta
approved these changes
Nov 21, 2022
PastaPastaPasta
left a comment
Member
There was a problem hiding this comment.
ACK for squash merge
I have done local builds and gitian-builds
UdjinM6
approved these changes
Nov 22, 2022
UdjinM6
left a comment
There was a problem hiding this comment.
I'm a little bit concerned about dashpay/bls-signatures#54 (but can't reproduce it locally) and this PR LGTM otherwise so ACK.
UdjinM6
added a commit
to UdjinM6/dash
that referenced
this pull request
Dec 6, 2022
…ce tree as vendored (dashpay#5077)" This reverts commit 305abe9.
|
This broke develop unfortunately... testnet: Reverting these changes (6a9bf06) fixes the issue. |
4 of 5 tasks
3 tasks done
PastaPastaPasta
added a commit
that referenced
this pull request
Nov 17, 2026
80f4dcd test: suppress blst's implicit-conversion UBSan reports (pasta) ee33a22 build: compile blst from src/blst instead of depends (pasta) 65b1b9b Squashed 'src/blst/' changes from a14feeb96e..a5fd18802b (pasta) 8fd9779 Squashed 'src/blst/' content from commit a14feeb96e (Konstantin Akimov) Pull request description: ## Issue being fixed or feature implemented Resolves #8144. blst, the BLS12-381 backend of `src/dashbls`, was pinned in two places. One was `depends/packages/blst.mk` (plus a patch). The other was a copy of the same version, checksum and build flags in `contrib/containers/ci/ci.Dockerfile`, added by #8106 because no distribution packages blst and `linux64_asan` builds against system libraries. If one pin is bumped without the other, the CI image and depends silently build different blst revisions or flags. ## What was done? blst now lives in the tree as a squashed `git subtree` at `src/blst`, and the CMake build compiles it, so the source tree is the only pin. dashbls made the same move from depends to a subtree in #5077. - **Subtree:** `src/blst` comes from the `dash-subtree` branch of the dashpay/blst fork of supranational/blst. That branch is v0.3.17 with the language bindings, MSVC/CHERI assembly, perl generators and upstream CI removed. This follows the leveldb and crc32c pattern: where the tree has to differ from upstream, it is taken from a fork branch, and `test/lint/git-subtree-check.sh -r src/blst` still passes. The first two commits add it at a14feeb96e, and the next two pull in a5fd18802b. - **Local change, carried by the fork:** in `src/vect.h`, `__BLST_NO_ASM__` now selects blst's C implementation with 32-bit limbs on x86_64, aarch64 and Win64 too. Upstream picks 64-bit limbs there, and its C code does not compile with them. The MSan build needs the C path, because MSan cannot see through assembly. This replaces `depends/patches/blst/no_asm_limbs.patch`, which covered x86_64/aarch64 only and missed 64-bit MinGW. - **Build:** `cmake/blst.cmake` builds a static `blst` library next to dashbls and mimalloc. It mirrors blst's `build.sh`: - sources are `server.c` (which `#include`s the rest of the C sources) and `build/assembly.S`; - `-fno-builtin`; - `__BLST_PORTABLE__`, so ADX is chosen at runtime rather than from the builder's CPU. `assembly.S` is compiled as C with `-x assembler-with-cpp`. That way it gets the target flags the depends toolchain puts in the C compiler and its flags, which CMake's ASM language would not pick up, for example in the darwin cross builds. - **Assembly on/off:** the C implementation is used, with `assembly.S` left out, on targets other than x86_64 and aarch64, or with the new `-DENABLE_BLST_ASM=OFF`. The MSan job now passes that option next to `SECP256K1_ASM=OFF`, instead of defining `__BLST_NO_ASM__` through depends. - **Sanitizers:** blst is now built with the sanitizers that `core_interface` carries. The UBSan suppressions gain `blst/` entries for the unsigned wraparound, shifts and sign-changing masks (such as `& -64` on a `size_t`) that blst does by design, matching the existing dashbls and secp256k1 entries: `unsigned-integer-overflow`, `shift-base`, `implicit-integer-sign-change`, and the two implicit-truncation checks. - **Removed:** - the depends package and its patch; - `cmake/module/FindBLST.cmake` and `find_package(BLST)`; - the blst build in the CI image; - the blst row in `doc/dependencies.md`. - **Exclusions and docs:** `src/blst` is excluded from lints, coverage and the copyright script like the other subtrees, and is listed in `contrib/debian/copyright`. `doc/developer-notes.md` and `test/lint/README.md` name the fork branch as its upstream. `src/blst/README.md` (in the fork) describes how to update it. ## How Has This Been Tested? On macOS arm64 against a depends prefix with no blst in it: - **Default build (assembly):** `dashd`, `test_dash`, `dashbls_runtest`, `dashbls_runbench` and `libdashconsensus` build. `libdashconsensus` contains blst. `dashbls_runtest` passes (1843 assertions), and so does `test_dash --run_test='bls_tests,evo_*,llmq_*'`. - **C-only build** (`-DENABLE_BLST_ASM=OFF -DSECP256K1_ASM=OFF`): no assembly object is built and `server.c` gets `-D__BLST_NO_ASM__`. `libdashconsensus` links, and `dashbls_runtest` and `bls_tests` pass. - **Sanitizers:** - On macOS, with the ASan job's `-DSANITIZERS=address,float-divide-by-zero,integer,undefined` and its `UBSAN_OPTIONS` (`halt_on_error=1`, the in-tree suppressions), `dashbls_runtest` and `test_dash --run_test='bls_tests,evo_*,llmq_*'` pass. Clang on arm64 macOS does not run the implicit-conversion checks. - On x86_64 Linux with clang-19, the CI compiler, a keygen/hash/sign/verify/serialize driver over blst, with and without assembly, runs clean under `halt_on_error=1` and the in-tree suppressions. Without the `blst/` entries it reports unsigned overflow, shift-base and implicit sign changes. - **Other targets:** - The `assembly.S` compile line (`-x c ... -x assembler-with-cpp`) assembles with clang for x86_64 ELF, COFF and Mach-O and for aarch64, and with GCC for x86_64 and aarch64. - `server.c` with `__BLST_NO_ASM__` compiles for x86_64 and aarch64 MinGW; before the `vect.h` change it failed with 21 errors. - **Lints:** `test/lint/all-lint.py` passes, apart from a `lint-shell` finding in `ci/dash/build_src.sh`, which this PR does not touch. CI covers the Linux, Windows, cross and sanitizer jobs. ## Breaking Changes Builds no longer use a system or depends `libblst`. blst is always built from `src/blst`. ## Checklist: - [x] I have performed a self-review of my own code - [x] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone _(if you have permission to set one)_ 🤖 Generated with [Claude Code](https://claude.com/claude-code) ACKs for top commit: knst: utACK 80f4dcd Tree-SHA512: 3fad4d48de8713884ca0d787fde7cb298161a863baa0110b30542959597253ba614c7bb35d16f8595b1371e001048953131bfa672530d222e2fd6f5322128bf6
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Issue being fixed or feature implemented
Commit dashpay/bls-signatures@66ee820f to source tree as vendored. Resolves #5025.
What was done?
See above. Implement build system changes needed to supported subtree vendored copy. Remove build-generated file from tracking.
How Has This Been Tested?
Running
make checkBreaking Changes
Will force a depends rebuild. Will need to add back removed build-generated file before updating subtree.
Checklist:
I have commented my code, particularly in hard-to-understand areasN/AI have made corresponding changes to the documentationN/AFor repository code-owners and collaborators only