forked from bitcoin/bitcoin
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge commit 'f90c4547ec40653bb64c5fdb7867db70f5be2190' into 2024-02-…
…batch-validation-updated
- Loading branch information
Showing
40 changed files
with
2,623 additions
and
80 deletions.
There are no files selected for viewing
This file contains 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 |
---|---|---|
|
@@ -12,6 +12,7 @@ ecdsa_example | |
schnorr_example | ||
ellswift_example | ||
musig_example | ||
batch_example | ||
*.exe | ||
*.so | ||
*.a | ||
|
This file contains 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 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 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 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 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,82 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
set -x | ||
|
||
export LC_ALL=C | ||
|
||
# Start persistent wineserver if necessary. | ||
# This speeds up jobs with many invocations of wine (e.g., ./configure with MSVC) tremendously. | ||
case "$WRAPPER_CMD" in | ||
*wine*) | ||
# This is apparently only reliable when we run a dummy command such as "hh.exe" afterwards. | ||
wineserver -p && wine hh.exe | ||
;; | ||
esac | ||
|
||
env >> test_env.log | ||
|
||
$CC -v || true | ||
valgrind --version || true | ||
$WRAPPER_CMD --version || true | ||
|
||
./autogen.sh | ||
|
||
./configure \ | ||
--enable-experimental="$EXPERIMENTAL" \ | ||
--with-test-override-wide-multiply="$WIDEMUL" --with-asm="$ASM" \ | ||
--with-ecmult-window="$ECMULTWINDOW" \ | ||
--with-ecmult-gen-precision="$ECMULTGENPRECISION" \ | ||
--enable-module-ecdh="$ECDH" --enable-module-recovery="$RECOVERY" \ | ||
--enable-module-schnorrsig="$SCHNORRSIG" \ | ||
--enable-module-batch="$BATCH" \ | ||
--enable-examples="$EXAMPLES" \ | ||
--with-valgrind="$WITH_VALGRIND" \ | ||
--host="$HOST" $EXTRAFLAGS | ||
|
||
# We have set "-j<n>" in MAKEFLAGS. | ||
make | ||
|
||
# Print information about binaries so that we can see that the architecture is correct | ||
file *tests* || true | ||
file bench* || true | ||
file .libs/* || true | ||
|
||
# This tells `make check` to wrap test invocations. | ||
export LOG_COMPILER="$WRAPPER_CMD" | ||
|
||
make "$BUILD" | ||
|
||
if [ "$BENCH" = "yes" ] | ||
then | ||
# Using the local `libtool` because on macOS the system's libtool has nothing to do with GNU libtool | ||
EXEC='./libtool --mode=execute' | ||
if [ -n "$WRAPPER_CMD" ] | ||
then | ||
EXEC="$EXEC $WRAPPER_CMD" | ||
fi | ||
{ | ||
$EXEC ./bench_ecmult | ||
$EXEC ./bench_internal | ||
$EXEC ./bench | ||
} >> bench.log 2>&1 | ||
fi | ||
|
||
if [ "$CTIMETEST" = "yes" ] | ||
then | ||
./libtool --mode=execute valgrind --error-exitcode=42 ./valgrind_ctime_test > valgrind_ctime_test.log 2>&1 | ||
fi | ||
|
||
# Rebuild precomputed files (if not cross-compiling). | ||
if [ -z "$HOST" ] | ||
then | ||
make clean-precomp | ||
make precomp | ||
fi | ||
|
||
# Shutdown wineserver again | ||
wineserver -k || true | ||
|
||
# Check that no repo files have been modified by the build. | ||
# (This fails for example if the precomp files need to be updated in the repo.) | ||
git diff --exit-code |
This file contains 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 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,15 @@ | ||
# Schnorrsig Batch Verification Speedup | ||
|
||
![Speedup over single verification](speedup-batch/schnorrsig-speedup-batch.png) | ||
|
||
# Tweak Pubkey Check Batch Verification Speedup | ||
|
||
![Speedup over single verification](speedup-batch/tweakcheck-speedup-batch.png) | ||
|
||
Build steps | ||
----------- | ||
To generate the above graphs on your local machine: | ||
|
||
$ cd doc/speedup-batch | ||
$ make | ||
$ make speedup-batch.png |
This file contains 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 @@ | ||
*.dat |
This file contains 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,23 @@ | ||
schnorrsig_data = schnorrsig_batch.dat schnorrsig_single.dat | ||
tweak_data = tweak_batch.dat tweak_single.dat | ||
|
||
bench_output.txt: bench.sh | ||
SECP256K1_BENCH_ITERS=500000 ./bench.sh bench_output.txt | ||
|
||
schnorrsig_batch.dat: bench_output.txt | ||
cat bench_output.txt | grep -v "schnorrsig_batch_verify_1 " | awk '{ gsub(/ /,""); print }' | awk -F, 'match($$0, /schnorrsig_batch_verify_([0-9]+)/, arr) {print arr[1] " " $$3}' > schnorrsig_batch.dat | ||
|
||
schnorrsig_single.dat: bench_output.txt | ||
cat bench_output.txt | awk '{ gsub(/ /,""); print }' | awk -F, 'match($$0, /schnorrsig_verify/) {print $$3}' > schnorrsig_single.dat | ||
|
||
tweak_batch.dat: bench_output.txt | ||
cat bench_output.txt | grep -v "tweak_check_batch_verify_1 " | awk '{ gsub(/ /,""); print }' | awk -F, 'match($$0, /tweak_check_batch_verify_([0-9]+)/, arr) {print arr[1] " " $$3}' > tweak_batch.dat | ||
|
||
tweak_single.dat: bench_output.txt | ||
cat bench_output.txt | awk '{ gsub(/ /,""); print }' | awk -F, 'match($$0, /tweak_add_check/) {print $$3}' > tweak_single.dat | ||
|
||
speedup-batch.png: $(schnorrsig_data) $(tweak_data) plot.gp | ||
gnuplot plot.gp | ||
|
||
clean: | ||
rm *.log *.txt *.dat *.png |
This file contains 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,13 @@ | ||
#!/bin/bash | ||
|
||
output_file=$1 | ||
cur_dir=$(pwd) | ||
|
||
cd ../../ | ||
echo "HEAD: $(git rev-parse --short HEAD)" > "$cur_dir/$output_file.log" | ||
make clean | ||
./autogen.sh | ||
./configure --enable-experimental --enable-module-batch --enable-module-schnorrsig >> "$cur_dir/$output_file.log" | ||
make -j | ||
./bench schnorrsig > "$cur_dir/$output_file" | ||
./bench extrakeys >> "$cur_dir/$output_file" |
Oops, something went wrong.