Fix RandomX validation exploit with difficulty reset, improve build system

- One-time difficulty reset to minimum for 17 blocks at activation height
- Separate RandomX build dirs for linux/win64 cross-compilation
- Add build target tracking to auto-clean on target switch
- Automated win64 release packaging to release-win64/
- Add build artifacts to .gitignore
- Miner memory diagnostics and large-page dataset fallback
This commit is contained in:
dan_s
2026-02-19 22:07:38 -06:00
parent 16149aed5a
commit 8a0eb77692
11 changed files with 395 additions and 37 deletions

View File

@@ -25,14 +25,14 @@ echo $PWD
./makecustom
cd $WD
# Build RandomX
# Build RandomX for Windows
cd src/RandomX
if [ -d "build" ]
if [ -f "build-win64/librandomx.a" ]
then
ls -la build/librandomx*
ls -la build-win64/librandomx*
else
mkdir build && cd build
CC="${CC} -g " CXX="${CXX} -g " cmake -DARCH=native ..
mkdir -p build-win64 && cd build-win64
CC="${CC} -g " CXX="${CXX} -g " cmake -DCMAKE_SYSTEM_NAME=Windows -DCMAKE_CXX_COMPILER=x86_64-w64-mingw32-g++-posix -DCMAKE_C_COMPILER=x86_64-w64-mingw32-gcc-posix -DARCH=native ..
make
fi
@@ -41,3 +41,55 @@ cd $WD
sed -i 's/-lboost_system-mt /-lboost_system-mt-s /' configure
cd src/
CC="${CC} -g " CXX="${CXX} -g " make V=1 hushd.exe hush-cli.exe hush-tx.exe
# Create release package
cd $WD
echo "Creating Windows release package..."
VERSION=$(grep -oP 'define\(_CLIENT_VERSION.*?,\s*\K[0-9]+' configure.ac | head -4 | tr '\n' '.' | sed 's/\.$//')
VERSION=${VERSION:-3.10.4}
RELEASE_DIR="release-win64"
mkdir -p "$RELEASE_DIR"
# Strip binaries
x86_64-w64-mingw32-strip -s src/hushd.exe src/hush-cli.exe src/hush-tx.exe
# Copy binaries
cp src/hushd.exe src/hush-cli.exe src/hush-tx.exe "$RELEASE_DIR/"
# Copy required data files
cp asmap.dat sapling-spend.params sapling-output.params "$RELEASE_DIR/"
# Create DragonX batch files
cat > "$RELEASE_DIR/dragonxd.bat" << 'EOF'
@call :GET_CURRENT_DIR
@cd %THIS_DIR%
hushd.exe -ac_name=DRAGONX -ac_algo=randomx -ac_halving=3500000 -ac_reward=300000000 -ac_blocktime=36 -ac_private=1 -addnode=176.126.87.241 %*
@goto :EOF
:GET_CURRENT_DIR
@pushd %~dp0
@set THIS_DIR=%CD%
@popd
@goto :EOF
EOF
cat > "$RELEASE_DIR/dragonx-cli.bat" << 'EOF'
@call :GET_CURRENT_DIR
@cd %THIS_DIR%
hush-cli.exe -ac_name=DRAGONX %*
@goto :EOF
:GET_CURRENT_DIR
@pushd %~dp0
@set THIS_DIR=%CD%
@popd
@goto :EOF
EOF
# Create ZIP
rm -f "$RELEASE_DIR/hush-${VERSION}-win64.zip"
cd "$RELEASE_DIR"
zip -9 "hush-${VERSION}-win64.zip" *.exe *.bat *.dat *.params
cd ..
echo "Release package created: $RELEASE_DIR/hush-${VERSION}-win64.zip"
ls -lh "$RELEASE_DIR/hush-${VERSION}-win64.zip"

View File

@@ -139,13 +139,13 @@ echo $PWD
./makecustom
cd $WD
# Build RandomX
# Build RandomX for Linux
cd src/RandomX
if [ -d "build" ]
if [ -f "build-linux/librandomx.a" ]
then
ls -la build/librandomx*
ls -la build-linux/librandomx*
else
mkdir build && cd build
mkdir -p build-linux && cd build-linux
cmake -DARCH=native ..
make
fi