From 318b9decdad42e313a3f81b2eae16b8987fbcea1 Mon Sep 17 00:00:00 2001 From: Taylor Helsper Date: Tue, 7 Dec 2021 19:59:40 -0600 Subject: [PATCH] Manage secp256k1 versions --- rootfs/standard/usr/bin/mynode_post_upgrade.sh | 11 +++++++++-- .../usr/bin/mynode_update_latest_version_files.sh | 1 + .../standard/usr/share/mynode/mynode_app_versions.sh | 4 ++++ setup/setup_device.sh | 11 +++++++++-- 4 files changed, 23 insertions(+), 4 deletions(-) diff --git a/rootfs/standard/usr/bin/mynode_post_upgrade.sh b/rootfs/standard/usr/bin/mynode_post_upgrade.sh index f6cdef97..8387ccd9 100755 --- a/rootfs/standard/usr/bin/mynode_post_upgrade.sh +++ b/rootfs/standard/usr/bin/mynode_post_upgrade.sh @@ -542,17 +542,24 @@ echo $ELECTRS_VERSION > $ELECTRS_VERSION_FILE # Install recent version of secp256k1 echo "Installing secp256k1..." -if [ ! -f /usr/include/secp256k1_ecdh.h ]; then +SECP256K1_UPGRADE_URL=https://github.com/bitcoin-core/secp256k1/archive/$SECP256K1_VERSION.tar.gz +CURRENT="" +if [ -f $SECP256K1_VERSION_FILE ]; then + CURRENT=$(cat $SECP256K1_VERSION_FILE) +fi +if [ "$CURRENT" != "$SECP256K1_VERSION" ]; then rm -rf /tmp/secp256k1 cd /tmp/ git clone https://github.com/bitcoin-core/secp256k1.git cd secp256k1 ./autogen.sh - ./configure + ./configure --enable-module-recovery --disable-jni --enable-experimental --enable-module-ecdh --enable-benchmark=no make make install cp -f include/* /usr/include/ + + echo $SECP256K1_VERSION > $SECP256K1_VERSION_FILE fi # Upgrade JoinMarket (legacy) diff --git a/rootfs/standard/usr/bin/mynode_update_latest_version_files.sh b/rootfs/standard/usr/bin/mynode_update_latest_version_files.sh index 5c59afd3..8ce25ca2 100755 --- a/rootfs/standard/usr/bin/mynode_update_latest_version_files.sh +++ b/rootfs/standard/usr/bin/mynode_update_latest_version_files.sh @@ -14,6 +14,7 @@ echo $CARAVAN_VERSION > $CARAVAN_LATEST_VERSION_FILE echo $CORSPROXY_VERSION > $CORSPROXY_LATEST_VERSION_FILE echo $JOINMARKET_VERSION > $JOINMARKET_LATEST_VERSION_FILE echo $JOININBOX_VERSION > $JOININBOX_LATEST_VERSION_FILE +echo $SECP256K1_VERSION > $SECP256K1_LATEST_VERSION_FILE echo $WHIRLPOOL_VERSION > $WHIRLPOOL_LATEST_VERSION_FILE echo $DOJO_VERSION > $DOJO_LATEST_VERSION_FILE echo $RTL_VERSION > $RTL_LATEST_VERSION_FILE diff --git a/rootfs/standard/usr/share/mynode/mynode_app_versions.sh b/rootfs/standard/usr/share/mynode/mynode_app_versions.sh index 67620f91..9cfe381b 100644 --- a/rootfs/standard/usr/share/mynode/mynode_app_versions.sh +++ b/rootfs/standard/usr/share/mynode/mynode_app_versions.sh @@ -57,6 +57,10 @@ JOININBOX_VERSION="v0.6.4" JOININBOX_VERSION_FILE=/home/bitcoin/.mynode/joininbox_version JOININBOX_LATEST_VERSION_FILE=/home/bitcoin/.mynode/joininbox_version_latest +SECP256K1_VERSION=486205aa68b7f1d4291f78fa20bc4485fd843e1c +SECP256K1_VERSION_FILE=/home/bitcoin/.mynode/secp256k1_version +SECP256K1_LATEST_VERSION_FILE=/home/bitcoin/.mynode/secp256k1_version_latest + WHIRLPOOL_VERSION="0.10.11" WHIRLPOOL_UPLOAD_FILE_ID="21d25ed02cceb91f4aa95b6389b9da9c" # Update sig file at /usr/share/whirlpool/whirlpool.asc for each release diff --git a/setup/setup_device.sh b/setup/setup_device.sh index 364f9cab..3c05e634 100755 --- a/setup/setup_device.sh +++ b/setup/setup_device.sh @@ -573,17 +573,24 @@ echo $ELECTRS_VERSION > $ELECTRS_VERSION_FILE # Install recent version of secp256k1 echo "Installing secp256k1..." -if [ ! -f /usr/include/secp256k1_ecdh.h ]; then +SECP256K1_UPGRADE_URL=https://github.com/bitcoin-core/secp256k1/archive/$SECP256K1_VERSION.tar.gz +CURRENT="" +if [ -f $SECP256K1_VERSION_FILE ]; then + CURRENT=$(cat $SECP256K1_VERSION_FILE) +fi +if [ "$CURRENT" != "$SECP256K1_VERSION" ]; then rm -rf /tmp/secp256k1 cd /tmp/ git clone https://github.com/bitcoin-core/secp256k1.git cd secp256k1 ./autogen.sh - ./configure + ./configure --enable-module-recovery --disable-jni --enable-experimental --enable-module-ecdh --enable-benchmark=no make make install cp -f include/* /usr/include/ + + echo $SECP256K1_VERSION > $SECP256K1_VERSION_FILE fi echo "Installing JoinInBox..."