From 260de8480f3710f3f0d9c5fb275964fd97b64320 Mon Sep 17 00:00:00 2001 From: losh11 Date: Sun, 3 Mar 2024 03:13:04 +0000 Subject: [PATCH] fix: secp-zkp refs + VG_CHECK test + block_assemble bench --- ci/lint/06_script.sh | 2 +- ci/test/06_script_b.sh | 4 ++-- ci/test/wrap-qemu.sh | 2 +- ci/test/wrap-wine.sh | 2 +- contrib/devtools/copyright_header.py | 2 +- src/Makefile.test.include | 2 +- src/bench/block_assemble.cpp | 2 +- src/secp256k1-zkp/src/util.h | 12 ++++++++++++ 8 files changed, 20 insertions(+), 8 deletions(-) diff --git a/ci/lint/06_script.sh b/ci/lint/06_script.sh index dc0f9b923..87774f0e4 100755 --- a/ci/lint/06_script.sh +++ b/ci/lint/06_script.sh @@ -15,7 +15,7 @@ if [ "$TRAVIS_EVENT_TYPE" = "pull_request" ]; then fi test/lint/git-subtree-check.sh src/crypto/ctaes -test/lint/git-subtree-check.sh src/secp256k1 +test/lint/git-subtree-check.sh src/secp256k1-zkp test/lint/git-subtree-check.sh src/univalue test/lint/git-subtree-check.sh src/leveldb test/lint/git-subtree-check.sh src/crc32c diff --git a/ci/test/06_script_b.sh b/ci/test/06_script_b.sh index 3d8d7baa5..e7e40362a 100755 --- a/ci/test/06_script_b.sh +++ b/ci/test/06_script_b.sh @@ -9,7 +9,7 @@ export LC_ALL=C.UTF-8 if [[ $HOST = *-mingw32 ]]; then BEGIN_FOLD wrap-wine # Generate all binaries, so that they can be wrapped - DOCKER_EXEC make $MAKEJOBS -C src/secp256k1 VERBOSE=1 + DOCKER_EXEC make $MAKEJOBS -C src/secp256k1-zkp VERBOSE=1 DOCKER_EXEC make $MAKEJOBS -C src/univalue VERBOSE=1 DOCKER_EXEC "${BASE_ROOT_DIR}/ci/test/wrap-wine.sh" END_FOLD @@ -18,7 +18,7 @@ fi if [ -n "$QEMU_USER_CMD" ]; then BEGIN_FOLD wrap-qemu # Generate all binaries, so that they can be wrapped - DOCKER_EXEC make $MAKEJOBS -C src/secp256k1 VERBOSE=1 + DOCKER_EXEC make $MAKEJOBS -C src/secp256k1-zkp VERBOSE=1 DOCKER_EXEC make $MAKEJOBS -C src/univalue VERBOSE=1 DOCKER_EXEC "${BASE_ROOT_DIR}/ci/test/wrap-qemu.sh" END_FOLD diff --git a/ci/test/wrap-qemu.sh b/ci/test/wrap-qemu.sh index be7d7fcc1..1da25ac1a 100755 --- a/ci/test/wrap-qemu.sh +++ b/ci/test/wrap-qemu.sh @@ -6,7 +6,7 @@ export LC_ALL=C.UTF-8 -for b_name in {"${BASE_OUTDIR}/bin"/*,src/secp256k1/*tests,src/univalue/{no_nul,test_json,unitester,object}}; do +for b_name in {"${BASE_OUTDIR}/bin"/*,src/secp256k1-zkp/*tests,src/univalue/{no_nul,test_json,unitester,object}}; do # shellcheck disable=SC2044 for b in $(find "${BASE_ROOT_DIR}" -executable -type f -name $(basename $b_name)); do echo "Wrap $b ..." diff --git a/ci/test/wrap-wine.sh b/ci/test/wrap-wine.sh index 58a8983e6..a4bf75990 100755 --- a/ci/test/wrap-wine.sh +++ b/ci/test/wrap-wine.sh @@ -6,7 +6,7 @@ export LC_ALL=C.UTF-8 -for b_name in {"${BASE_OUTDIR}/bin"/*,src/secp256k1/*tests,src/univalue/{no_nul,test_json,unitester,object}}.exe; do +for b_name in {"${BASE_OUTDIR}/bin"/*,src/secp256k1-zkp/*tests,src/univalue/{no_nul,test_json,unitester,object}}.exe; do # shellcheck disable=SC2044 for b in $(find "${BASE_ROOT_DIR}" -executable -type f -name "$(basename $b_name)"); do if (file "$b" | grep "Windows"); then diff --git a/contrib/devtools/copyright_header.py b/contrib/devtools/copyright_header.py index 9a555c70b..7e5449b69 100755 --- a/contrib/devtools/copyright_header.py +++ b/contrib/devtools/copyright_header.py @@ -33,7 +33,7 @@ EXCLUDE_DIRS = [ # git subtrees "src/crypto/ctaes/", "src/leveldb/", - "src/secp256k1/", + "src/secp256k1-zkp/", "src/univalue/", "src/crc32c/", ] diff --git a/src/Makefile.test.include b/src/Makefile.test.include index 82701ce12..c2fb6847a 100644 --- a/src/Makefile.test.include +++ b/src/Makefile.test.include @@ -1348,7 +1348,7 @@ if ENABLE_BENCH $(BENCH_BINARY) > /dev/null endif endif - $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C secp256k1 check + $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C secp256k1-zkp check if EMBEDDED_UNIVALUE $(AM_V_at)$(MAKE) $(AM_MAKEFLAGS) -C univalue check endif diff --git a/src/bench/block_assemble.cpp b/src/bench/block_assemble.cpp index 99a7ad237..0248b3ddf 100644 --- a/src/bench/block_assemble.cpp +++ b/src/bench/block_assemble.cpp @@ -40,7 +40,7 @@ static void AssembleBlock(benchmark::Bench& bench) CMutableTransaction tx; tx.vin.push_back(MineBlock(test_setup.m_node, SCRIPT_PUB)); tx.vin.back().scriptWitness = witness; - tx.vout.emplace_back(1337, SCRIPT_PUB); + tx.vout.emplace_back(13370, SCRIPT_PUB); if (NUM_BLOCKS - b >= COINBASE_MATURITY) txs.at(b) = MakeTransactionRef(tx); } diff --git a/src/secp256k1-zkp/src/util.h b/src/secp256k1-zkp/src/util.h index 3b0fee59d..8373ccd87 100644 --- a/src/secp256k1-zkp/src/util.h +++ b/src/secp256k1-zkp/src/util.h @@ -68,6 +68,18 @@ static SECP256K1_INLINE void secp256k1_callback_call(const secp256k1_callback * #define VERIFY_SETUP(stmt) #endif +/* Define `VG_UNDEF` and `VG_CHECK` when VALGRIND is defined */ +#if !defined(VG_CHECK) +# if defined(VALGRIND) +# include +# define VG_UNDEF(x,y) VALGRIND_MAKE_MEM_UNDEFINED((x),(y)) +# define VG_CHECK(x,y) VALGRIND_CHECK_MEM_IS_DEFINED((x),(y)) +# else +# define VG_UNDEF(x,y) +# define VG_CHECK(x,y) +# endif +#endif + /* Like `VG_CHECK` but on VERIFY only */ #if defined(VERIFY) #define VG_CHECK_VERIFY(x, y) VG_CHECK((x), (y))