Updated tests post-fork
Some checks are pending
C/C++ CI / build-windows-msbuild (map[grpc:ON os:2022 rx:ON tls:ON upnp:ON vs:Visual Studio 17 2022 vspath:C:\Program Files\Microsoft Visual Studio\2022\Enterprise]) (push) Waiting to run
C/C++ CI / build-macos (push) Waiting to run
C/C++ CI / build-macos-aarch64 (push) Waiting to run
C/C++ CI / build-freebsd (map[architecture:x86-64 host:ubuntu-latest name:freebsd version:13.3]) (push) Waiting to run
C/C++ CI / build-openbsd (map[architecture:x86-64 host:ubuntu-latest name:openbsd version:7.4]) (push) Waiting to run
C/C++ CI / build-ubuntu-static-libs (map[flags:-fuse-linker-plugin -ffunction-sections -Wno-error=inline]) (push) Waiting to run
C/C++ CI / build-ubuntu (map[c:gcc-11 cpp:g++-11 flags: os:ubuntu-20.04]) (push) Waiting to run
C/C++ CI / build-ubuntu (map[c:gcc-12 cpp:g++-12 flags: os:ubuntu-22.04]) (push) Waiting to run
C/C++ CI / build-ubuntu (map[c:gcc-8 cpp:g++-8 flags: os:ubuntu-20.04]) (push) Waiting to run
C/C++ CI / build-alpine-static (map[arch:aarch64 branch:latest-stable flags:-ffunction-sections -Wno-error=inline -mfix-cortex-a53-835769 -mfix-cortex-a53-843419]) (push) Waiting to run
C/C++ CI / build-alpine-static (map[arch:riscv64 branch:edge flags:-ffunction-sections -Wno-error=inline]) (push) Waiting to run
C/C++ CI / build-alpine-static (map[arch:x86_64 branch:latest-stable flags:-ffunction-sections -Wno-error=inline]) (push) Waiting to run
C/C++ CI / build-ubuntu-aarch64 (map[flags:-fuse-linker-plugin -ffunction-sections -mfix-cortex-a53-835769 -mfix-cortex-a53-843419 os:ubuntu-20.04]) (push) Waiting to run
C/C++ CI / build-ubuntu-aarch64 (map[flags:-fuse-linker-plugin -ffunction-sections -mfix-cortex-a53-835769 -mfix-cortex-a53-843419 os:ubuntu-22.04]) (push) Waiting to run
C/C++ CI / build-windows-msys2 (map[c:clang cxx:clang++ flags:-fuse-ld=lld -Wno-unused-command-line-argument -Wno-nan-infinity-disabled]) (push) Waiting to run
C/C++ CI / build-windows-msys2 (map[c:gcc cxx:g++ flags:-ffunction-sections -Wno-error=maybe-uninitialized -Wno-error=attributes]) (push) Waiting to run
C/C++ CI / build-windows-msbuild (map[grpc:OFF os:2019 rx:OFF tls:OFF upnp:OFF vs:Visual Studio 16 2019 vspath:C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise]) (push) Waiting to run
C/C++ CI / build-windows-msbuild (map[grpc:OFF os:2019 rx:OFF tls:ON upnp:OFF vs:Visual Studio 16 2019 vspath:C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise]) (push) Waiting to run
C/C++ CI / build-windows-msbuild (map[grpc:OFF os:2019 rx:OFF tls:ON upnp:ON vs:Visual Studio 16 2019 vspath:C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise]) (push) Waiting to run
C/C++ CI / build-windows-msbuild (map[grpc:OFF os:2019 rx:ON tls:ON upnp:ON vs:Visual Studio 16 2019 vspath:C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise]) (push) Waiting to run
C/C++ CI / build-windows-msbuild (map[grpc:ON os:2019 rx:ON tls:ON upnp:ON vs:Visual Studio 16 2019 vspath:C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise]) (push) Waiting to run
clang-tidy / clang-tidy (push) Waiting to run
CodeQL / Analyze (push) Waiting to run
cppcheck / cppcheck-ubuntu (push) Waiting to run
cppcheck / cppcheck-windows (push) Waiting to run
Sync test / sync-test-windows-debug-asan (push) Waiting to run
Microsoft C++ Code Analysis / Analyze (push) Waiting to run
source-snapshot / source-snapshot (push) Waiting to run
Sync test / sync-test-windows-leaks (push) Waiting to run
Sync test / sync-test-ubuntu-tsan (push) Waiting to run
Sync test / sync-test-ubuntu-msan (push) Waiting to run
Sync test / sync-test-ubuntu-ubsan (push) Waiting to run
Sync test / sync-test-ubuntu-asan (push) Waiting to run
Sync test / sync-test-macos (map[flags:-Og -ftrapv -target arm64-apple-macos-11 os:macos-14]) (push) Waiting to run
Sync test / sync-test-macos (map[flags:-Og -ftrapv os:macos-13]) (push) Waiting to run

This commit is contained in:
SChernykh 2024-10-13 13:13:14 +02:00
parent 61bb862cdb
commit c88f126cb1
9 changed files with 31 additions and 488 deletions

View file

@ -1,428 +0,0 @@
name: Sync test (old)
on:
push:
paths-ignore:
- 'docker-compose/**'
- 'docs/**'
- 'README.md'
pull_request:
schedule:
- cron: '47 0/3 * * *'
jobs:
sync-test-ubuntu-tsan:
timeout-minutes: 60
runs-on: ubuntu-22.04
steps:
- name: Install dependencies
run: |
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install -y git build-essential cmake gcc-12 g++-12
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Build libcurl
run: |
cd external/src/curl
cmake . -DCMAKE_C_COMPILER=gcc-12 -DCMAKE_C_FLAGS='-fsanitize=thread -Og -fno-omit-frame-pointer -g' -DBUILD_CURL_EXE=OFF -DBUILD_SHARED_LIBS=OFF -DCURL_DISABLE_INSTALL=ON -DCURL_ENABLE_EXPORT_TARGET=OFF -DCURL_DISABLE_HEADERS_API=ON -DCURL_DISABLE_BINDLOCAL=ON -DBUILD_LIBCURL_DOCS=OFF -DBUILD_MISC_DOCS=OFF -DENABLE_CURL_MANUAL=OFF -DCURL_ZLIB=OFF -DCURL_DISABLE_ALTSVC=ON -DCURL_DISABLE_COOKIES=ON -DCURL_DISABLE_DOH=ON -DCURL_DISABLE_GETOPTIONS=ON -DCURL_DISABLE_HSTS=ON -DCURL_DISABLE_LIBCURL_OPTION=ON -DCURL_DISABLE_MIME=ON -DCURL_DISABLE_NETRC=ON -DCURL_DISABLE_NTLM=ON -DCURL_DISABLE_PARSEDATE=ON -DCURL_DISABLE_PROGRESS_METER=ON -DCURL_DISABLE_SHUFFLE_DNS=ON -DCURL_DISABLE_SOCKETPAIR=ON -DCURL_DISABLE_VERBOSE_STRINGS=ON -DHTTP_ONLY=ON -DCURL_ENABLE_SSL=OFF -DUSE_LIBIDN2=OFF -DCURL_USE_LIBPSL=OFF -DCURL_USE_LIBSSH2=OFF -DENABLE_UNIX_SOCKETS=OFF -DCURL_DISABLE_TESTS=ON -DUSE_NGHTTP2=OFF
make -j$(nproc)
cd lib && mkdir .libs && cp libcurl.a .libs
- name: Build libuv
run: |
cd external/src/libuv
mkdir build
cd build
cmake .. -DCMAKE_C_COMPILER=gcc-12 -DCMAKE_C_FLAGS='-fsanitize=thread -Og -fno-omit-frame-pointer -g' -DBUILD_TESTING=OFF -DLIBUV_BUILD_SHARED=OFF
make -j$(nproc)
- name: Build libzmq
run: |
cd external/src/libzmq
mkdir build
cd build
cmake .. -DCMAKE_C_COMPILER=gcc-12 -DCMAKE_CXX_COMPILER=g++-12 -DCMAKE_C_FLAGS='-fsanitize=thread -Og -fno-omit-frame-pointer -g' -DCMAKE_CXX_FLAGS='-fsanitize=thread -Og -fno-omit-frame-pointer -g' -DWITH_LIBSODIUM=OFF -DWITH_LIBBSD=OFF -DBUILD_TESTS=OFF -DWITH_DOCS=OFF -DENABLE_DRAFTS=OFF -DBUILD_SHARED=OFF
make -j$(nproc)
- name: Build p2pool
run: |
mkdir build
cd build
cmake .. -DDEV_TEST_SYNC=ON -DDEV_WITH_TSAN=ON -DCMAKE_C_COMPILER=gcc-12 -DCMAKE_CXX_COMPILER=g++-12 -DCMAKE_C_FLAGS='-fsanitize=thread -Og -fno-omit-frame-pointer -g' -DCMAKE_CXX_FLAGS='-fsanitize=thread -Og -fno-omit-frame-pointer -g' -DWITH_LTO=OFF -DSTATIC_LIBS=ON
make -j$(nproc) p2pool
- name: Run p2pool
run: |
cd build
mkdir data
python ../tests/src/stratum_dummy.py 1 &
python ../tests/src/stratum_dummy.py 2 &
python ../tests/src/stratum_dummy.py 3 &
sudo sysctl vm.mmap_rnd_bits=28
TSAN_OPTIONS="suppressions=../tests/src/tsan_sup.txt halt_on_error=1" ./p2pool --host xmr.support --rpc-port 18081 --zmq-port 18083 --host node.richfowler.net --rpc-port 18089 --zmq-port 18084 --wallet 44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg --mini --out-peers 200 --data-api data --local-api --loglevel 6
- name: Check p2pool.log
run: |
cd build
grep 'Synchronization finished successfully' p2pool.log
- name: Archive p2pool.log
uses: actions/upload-artifact@v4
with:
name: p2pool_ubuntu_data_tsan
path: |
build/*.log
build/data/
sync-test-ubuntu-msan:
timeout-minutes: 60
runs-on: ubuntu-22.04
steps:
- name: Install dependencies
run: |
sudo apt update
sudo apt install -y git build-essential cmake ninja-build
- name: Install clang
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 18
- name: Build libcxx_msan
run: |
git clone --depth=1 https://github.com/llvm/llvm-project -b release/18.x
cd llvm-project
mkdir build
cmake -G Ninja -S runtimes -B build -DLLVM_ENABLE_RUNTIMES="libcxx;libcxxabi" -DCMAKE_C_COMPILER=clang-18 -DCMAKE_CXX_COMPILER=clang++-18 -DLLVM_USE_SANITIZER=MemoryWithOrigins -DLIBCXXABI_USE_LLVM_UNWINDER=OFF
ninja -C build cxx cxxabi
cd build
mkdir /tmp/libcxx_msan
cp -r include /tmp/libcxx_msan
cp -r lib /tmp/libcxx_msan
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Build libcurl
run: |
cd external/src/curl
cmake . -DCMAKE_C_COMPILER=clang-18 -DCMAKE_C_FLAGS='-fsanitize=memory -fsanitize-recover -fsanitize-memory-track-origins -Og -fno-omit-frame-pointer -g' -DBUILD_CURL_EXE=OFF -DBUILD_SHARED_LIBS=OFF -DCURL_DISABLE_INSTALL=ON -DCURL_ENABLE_EXPORT_TARGET=OFF -DCURL_DISABLE_HEADERS_API=ON -DCURL_DISABLE_BINDLOCAL=ON -DBUILD_LIBCURL_DOCS=OFF -DBUILD_MISC_DOCS=OFF -DENABLE_CURL_MANUAL=OFF -DCURL_ZLIB=OFF -DCURL_DISABLE_ALTSVC=ON -DCURL_DISABLE_COOKIES=ON -DCURL_DISABLE_DOH=ON -DCURL_DISABLE_GETOPTIONS=ON -DCURL_DISABLE_HSTS=ON -DCURL_DISABLE_LIBCURL_OPTION=ON -DCURL_DISABLE_MIME=ON -DCURL_DISABLE_NETRC=ON -DCURL_DISABLE_NTLM=ON -DCURL_DISABLE_PARSEDATE=ON -DCURL_DISABLE_PROGRESS_METER=ON -DCURL_DISABLE_SHUFFLE_DNS=ON -DCURL_DISABLE_SOCKETPAIR=ON -DCURL_DISABLE_VERBOSE_STRINGS=ON -DHTTP_ONLY=ON -DCURL_ENABLE_SSL=OFF -DUSE_LIBIDN2=OFF -DCURL_USE_LIBPSL=OFF -DCURL_USE_LIBSSH2=OFF -DENABLE_UNIX_SOCKETS=OFF -DCURL_DISABLE_TESTS=ON -DUSE_NGHTTP2=OFF
make -j$(nproc)
cd lib && mkdir .libs && cp libcurl.a .libs
- name: Build libuv
run: |
cd external/src/libuv
mkdir build
cd build
cmake .. -DCMAKE_C_COMPILER=clang-18 -DCMAKE_C_FLAGS='-fsanitize=memory -fsanitize-recover -fsanitize-memory-track-origins -Og -fno-omit-frame-pointer -g' -DBUILD_TESTING=OFF -DLIBUV_BUILD_SHARED=OFF
make -j$(nproc)
- name: Build libzmq
run: |
cd external/src/libzmq
mkdir build
cd build
cmake .. -DCMAKE_C_COMPILER=clang-18 -DCMAKE_CXX_COMPILER=clang++-18 -DCMAKE_C_FLAGS='-fsanitize=memory -fsanitize-recover -fsanitize-memory-track-origins -Og -fno-omit-frame-pointer -g' -DCMAKE_CXX_FLAGS='-nostdinc++ -nostdlib++ -fsanitize=memory -fsanitize-recover -fsanitize-memory-track-origins -Og -fno-omit-frame-pointer -g -isystem /tmp/libcxx_msan/include/c++/v1 -L/tmp/libcxx_msan/lib -lc++ -lc++abi -Wno-unused-command-line-argument' -DWITH_LIBSODIUM=OFF -DWITH_LIBBSD=OFF -DBUILD_TESTS=OFF -DWITH_DOCS=OFF -DENABLE_DRAFTS=OFF -DBUILD_SHARED=OFF
make -j$(nproc)
- name: Build p2pool
run: |
mkdir build
cd build
cmake .. -DCMAKE_C_COMPILER=clang-18 -DCMAKE_CXX_COMPILER=clang++-18 -DCMAKE_C_FLAGS='-fsanitize=memory -fsanitize-recover -fsanitize-memory-track-origins -fno-omit-frame-pointer -g' -DCMAKE_CXX_FLAGS='-nostdinc++ -nostdlib++ -fsanitize=memory -fsanitize-recover -fsanitize-memory-track-origins -isystem /tmp/libcxx_msan/include/c++/v1 -L/tmp/libcxx_msan/lib -Wl,-rpath /tmp/libcxx_msan/lib -lc++ -lc++abi -Wno-unused-command-line-argument -fuse-ld=lld-18 -fno-omit-frame-pointer -g' -DDEV_TEST_SYNC=ON -DDEV_WITH_MSAN=ON -DWITH_LTO=OFF -DSTATIC_LIBS=ON
make -j$(nproc) p2pool
- name: Run p2pool
run: |
cd build
mkdir data
python ../tests/src/stratum_dummy.py 1 &
python ../tests/src/stratum_dummy.py 2 &
python ../tests/src/stratum_dummy.py 3 &
sudo sysctl vm.mmap_rnd_bits=28
MSAN_OPTIONS="halt_on_error=1" ./p2pool --host xmr.support --rpc-port 18081 --zmq-port 18083 --host node.richfowler.net --rpc-port 18089 --zmq-port 18084 --wallet 44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg --mini --out-peers 200 --data-api data --local-api --loglevel 6
- name: Check p2pool.log
run: |
cd build
grep 'Synchronization finished successfully' p2pool.log
- name: Archive p2pool.log
uses: actions/upload-artifact@v4
with:
name: p2pool_ubuntu_data_msan
path: |
build/*.log
build/data/
sync-test-ubuntu-ubsan:
timeout-minutes: 60
runs-on: ubuntu-22.04
steps:
- name: Install dependencies
run: |
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install -y git build-essential cmake libuv1-dev libzmq3-dev libsodium-dev libpgm-dev libnorm-dev libgss-dev libcurl4-openssl-dev libidn2-0-dev gcc-12 g++-12
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Build p2pool
run: |
mkdir build
cd build
cmake .. -DDEV_TEST_SYNC=ON -DDEV_WITH_UBSAN=ON -DCMAKE_C_COMPILER=gcc-12 -DCMAKE_CXX_COMPILER=g++-12 -DWITH_LTO=OFF
make -j$(nproc) p2pool
- name: Run p2pool
run: |
cd build
mkdir data
python ../tests/src/stratum_dummy.py 1 &
python ../tests/src/stratum_dummy.py 2 &
python ../tests/src/stratum_dummy.py 3 &
sudo sysctl vm.mmap_rnd_bits=28
UBSAN_OPTIONS="suppressions=../tests/src/ubsan_sup.txt halt_on_error=1" ./p2pool --host xmr.support --rpc-port 18081 --zmq-port 18083 --host node.richfowler.net --rpc-port 18089 --zmq-port 18084 --wallet 44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg --mini --out-peers 200 --data-api data --local-api --loglevel 6
- name: Check p2pool.log
run: |
cd build
grep 'Synchronization finished successfully' p2pool.log
- name: Archive p2pool.log
uses: actions/upload-artifact@v4
with:
name: p2pool_ubuntu_data_ubsan
path: |
build/*.log
build/data/
sync-test-ubuntu-asan:
timeout-minutes: 60
runs-on: ubuntu-22.04
steps:
- name: Install dependencies
run: |
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt update
sudo apt install -y git build-essential cmake libuv1-dev libzmq3-dev libsodium-dev libpgm-dev libnorm-dev libgss-dev libcurl4-openssl-dev libidn2-0-dev gcc-12 g++-12
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Build p2pool
run: |
mkdir build
cd build
cmake .. -DDEV_TEST_SYNC=ON -DDEV_WITH_ASAN=ON -DCMAKE_C_COMPILER=gcc-12 -DCMAKE_CXX_COMPILER=g++-12 -DCMAKE_C_FLAGS="-fno-omit-frame-pointer -fsanitize=address -Og -g" -DCMAKE_CXX_FLAGS="-fno-omit-frame-pointer -fsanitize=address -Og -g" -DWITH_LTO=OFF
make -j$(nproc) p2pool
- name: Run p2pool
run: |
cd build
mkdir data
python ../tests/src/stratum_dummy.py 1 &
python ../tests/src/stratum_dummy.py 2 &
python ../tests/src/stratum_dummy.py 3 &
sudo sysctl vm.mmap_rnd_bits=28
ASAN_OPTIONS="detect_stack_use_after_return=1 atexit=1" ./p2pool --host xmr.support --rpc-port 18081 --zmq-port 18083 --host node.richfowler.net --rpc-port 18089 --zmq-port 18084 --wallet 44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg --mini --out-peers 200 --data-api data --local-api --loglevel 6
- name: Check p2pool.log
run: |
cd build
grep 'Synchronization finished successfully' p2pool.log
- name: Archive p2pool.log
uses: actions/upload-artifact@v4
with:
name: p2pool_ubuntu_data_asan
path: |
build/*.log
build/data/
sync-test-macos:
timeout-minutes: 60
runs-on: ${{ matrix.config.os }}
strategy:
matrix:
config:
- {os: macos-13, flags: "-Og -ftrapv"}
- {os: macos-14, flags: "-Og -ftrapv -target arm64-apple-macos-11"}
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Install dependencies
run: |
HOMEBREW_NO_AUTO_UPDATE=1 brew install pyenv
pyenv install 3:latest
- name: Build libcurl
run: |
cd external/src/curl
cmake . -DCMAKE_C_COMPILER="$(brew --prefix llvm@15)/bin/clang" -DCMAKE_AR="$(brew --prefix llvm@15)/bin/llvm-ar" -DCMAKE_RANLIB="$(brew --prefix llvm@15)/bin/llvm-ranlib" -DCMAKE_C_FLAGS="${{ matrix.config.flags }}" -DBUILD_CURL_EXE=OFF -DBUILD_SHARED_LIBS=OFF -DCURL_DISABLE_INSTALL=ON -DCURL_ENABLE_EXPORT_TARGET=OFF -DCURL_DISABLE_HEADERS_API=ON -DCURL_DISABLE_BINDLOCAL=ON -DBUILD_LIBCURL_DOCS=OFF -DBUILD_MISC_DOCS=OFF -DENABLE_CURL_MANUAL=OFF -DCURL_ZLIB=OFF -DCURL_DISABLE_ALTSVC=ON -DCURL_DISABLE_COOKIES=ON -DCURL_DISABLE_DOH=ON -DCURL_DISABLE_GETOPTIONS=ON -DCURL_DISABLE_HSTS=ON -DCURL_DISABLE_LIBCURL_OPTION=ON -DCURL_DISABLE_MIME=ON -DCURL_DISABLE_NETRC=ON -DCURL_DISABLE_NTLM=ON -DCURL_DISABLE_PARSEDATE=ON -DCURL_DISABLE_PROGRESS_METER=ON -DCURL_DISABLE_SHUFFLE_DNS=ON -DCURL_DISABLE_SOCKETPAIR=ON -DCURL_DISABLE_VERBOSE_STRINGS=ON -DHTTP_ONLY=ON -DCURL_ENABLE_SSL=OFF -DUSE_LIBIDN2=OFF -DCURL_USE_LIBPSL=OFF -DCURL_USE_LIBSSH2=OFF -DENABLE_UNIX_SOCKETS=OFF -DCURL_DISABLE_TESTS=ON -DUSE_NGHTTP2=OFF
make -j4
cd lib && mkdir .libs && cp libcurl.a .libs
- name: Build libuv
run: |
cd external/src/libuv
mkdir build
cd build
cmake .. -DCMAKE_C_COMPILER="$(brew --prefix llvm@15)/bin/clang" -DCMAKE_AR="$(brew --prefix llvm@15)/bin/llvm-ar" -DCMAKE_RANLIB="$(brew --prefix llvm@15)/bin/llvm-ranlib" -DCMAKE_C_FLAGS='${{ matrix.config.flags }}' -DBUILD_TESTING=OFF -DLIBUV_BUILD_SHARED=OFF
make -j4
- name: Build libzmq
run: |
cd external/src/libzmq
mkdir build
cd build
cmake .. -DCMAKE_C_COMPILER="$(brew --prefix llvm@15)/bin/clang" -DCMAKE_CXX_COMPILER="$(brew --prefix llvm@15)/bin/clang++" -DCMAKE_AR="$(brew --prefix llvm@15)/bin/llvm-ar" -DCMAKE_RANLIB="$(brew --prefix llvm@15)/bin/llvm-ranlib" -DCMAKE_C_FLAGS='${{ matrix.config.flags }}' -DCMAKE_CXX_FLAGS='${{ matrix.config.flags }}' -DWITH_LIBSODIUM=OFF -DWITH_LIBBSD=OFF -DBUILD_TESTS=OFF -DWITH_DOCS=OFF -DENABLE_DRAFTS=OFF -DBUILD_SHARED=OFF
make -j4
- name: Build p2pool
run: |
mkdir build
cd build
cmake .. -DCMAKE_C_COMPILER="$(brew --prefix llvm@15)/bin/clang" -DCMAKE_CXX_COMPILER="$(brew --prefix llvm@15)/bin/clang++" -DCMAKE_AR="$(brew --prefix llvm@15)/bin/llvm-ar" -DCMAKE_RANLIB="$(brew --prefix llvm@15)/bin/llvm-ranlib" -DCMAKE_C_FLAGS='${{ matrix.config.flags }}' -DCMAKE_CXX_FLAGS='${{ matrix.config.flags }}' -DWITH_LTO=OFF -DSTATIC_LIBS=ON -DDEV_TEST_SYNC=ON
make -j4 p2pool
- name: Run p2pool
run: |
cd build
mkdir data
python3 ../tests/src/stratum_dummy.py 1 &
python3 ../tests/src/stratum_dummy.py 2 &
python3 ../tests/src/stratum_dummy.py 3 &
./p2pool --host xmr.support --rpc-port 18081 --zmq-port 18083 --host node.richfowler.net --rpc-port 18089 --zmq-port 18084 --wallet 44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg --mini --out-peers 200 --data-api data --local-api --loglevel 6
- name: Check p2pool.log
run: |
cd build
grep 'Synchronization finished successfully' p2pool.log
- name: Archive p2pool.log
uses: actions/upload-artifact@v4
with:
name: p2pool_${{ matrix.config.os }}_data
path: |
build/*.log
build/data/
sync-test-windows-debug-asan:
timeout-minutes: 60
runs-on: windows-2022
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup cmake
uses: lukka/get-cmake@latest
- name: Build p2pool
run: |
mkdir build
cd build
cmake .. -G "Visual Studio 17 2022" -DCMAKE_SYSTEM_VERSION="10.0" -DDEV_TEST_SYNC=ON -DDEV_WITH_ASAN=ON
& "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\Msbuild\\Current\\Bin\\amd64\\msbuild" -v:m /m /p:Configuration=Debug p2pool.vcxproj
- name: Run p2pool
shell: cmd
run: |
call "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\VC\\Auxiliary\\Build\\vcvarsall.bat" amd64
cd build/Debug
mkdir data
start python ../../tests/src/stratum_dummy.py 1
start python ../../tests/src/stratum_dummy.py 2
start python ../../tests/src/stratum_dummy.py 3
p2pool.exe --host xmr.support --rpc-port 18081 --zmq-port 18083 --host node.richfowler.net --rpc-port 18089 --zmq-port 18084 --wallet 44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg --mini --out-peers 200 --data-api data --local-api --loglevel 6
- name: Check p2pool.log
run: |
cd build/Debug
findstr /C:"Synchronization finished successfully" p2pool.log
- name: Archive p2pool.log
uses: actions/upload-artifact@v4
with:
name: p2pool_windows_data_debug_asan
path: |
build/Debug/*.log
build/Debug/data/
sync-test-windows-leaks:
timeout-minutes: 60
runs-on: windows-2022
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
submodules: recursive
- name: Setup cmake
uses: lukka/get-cmake@latest
- name: Build p2pool
run: |
mkdir build
cd build
cmake .. -G "Visual Studio 17 2022" -DCMAKE_SYSTEM_VERSION="10.0" -DDEV_TEST_SYNC=ON -DDEV_TRACK_MEMORY=ON
& "C:\\Program Files\\Microsoft Visual Studio\\2022\\Enterprise\\Msbuild\\Current\\Bin\\amd64\\msbuild" -v:m /m /p:Configuration=RelWithDebInfo p2pool.vcxproj
- name: Run p2pool
run: |
cd build/RelWithDebInfo
mkdir data
Start-Process python -ArgumentList "../../tests/src/stratum_dummy.py 1"
Start-Process python -ArgumentList "../../tests/src/stratum_dummy.py 2"
Start-Process python -ArgumentList "../../tests/src/stratum_dummy.py 3"
./p2pool.exe --host xmr.support --rpc-port 18081 --zmq-port 18083 --host node.richfowler.net --rpc-port 18089 --zmq-port 18084 --wallet 44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg --mini --out-peers 200 --data-api data --local-api --loglevel 6
- name: Check p2pool.log
run: |
cd build/RelWithDebInfo
Remove-Item p2pool.cache -Force
findstr /C:"Synchronization finished successfully" p2pool.log
- name: Archive p2pool.log
if: '!cancelled()'
uses: actions/upload-artifact@v4
with:
name: p2pool_windows_data_leaks
path: |
build/RelWithDebInfo/p2pool.*
build/RelWithDebInfo/data/

View file

@ -10,7 +10,7 @@ on:
pull_request: pull_request:
schedule: schedule:
- cron: '17 0/3 * * *' - cron: '47 0/3 * * *'
jobs: jobs:
sync-test-ubuntu-tsan: sync-test-ubuntu-tsan:
@ -67,11 +67,8 @@ jobs:
python ../tests/src/stratum_dummy.py 1 & python ../tests/src/stratum_dummy.py 1 &
python ../tests/src/stratum_dummy.py 2 & python ../tests/src/stratum_dummy.py 2 &
python ../tests/src/stratum_dummy.py 3 & python ../tests/src/stratum_dummy.py 3 &
python ../tests/src/mm_server.py 8000 id0 data0 &
python ../tests/src/mm_server.py 8001 id1 data1 &
python ../tests/src/mm_server.py 8002 id2 data2 &
sudo sysctl vm.mmap_rnd_bits=28 sudo sysctl vm.mmap_rnd_bits=28
TSAN_OPTIONS="suppressions=../tests/src/tsan_sup.txt halt_on_error=1" ./p2pool ${{ secrets.TESTNET_NODE_PARAMS }} --config ../tests/src/mm_test_config.json --wallet 9y9HUSpSZX7j2J5UUngX5nCRezR6mZfLmL2D5JXpmPjYVDCPCCcw6Tab2R55xqPTN2FoQEEDmz99TVdy9EW74mqMUw5xRun --data-api data --local-api --merge-mine 127.0.0.1:8000 test0 --merge-mine 127.0.0.1:8001 test1 --merge-mine 127.0.0.1:8002 test2 --loglevel 6 TSAN_OPTIONS="suppressions=../tests/src/tsan_sup.txt halt_on_error=1" ./p2pool --host xmr.support --rpc-port 18081 --zmq-port 18083 --host node.richfowler.net --rpc-port 18089 --zmq-port 18084 --wallet 44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg --mini --out-peers 200 --data-api data --local-api --loglevel 6
- name: Check p2pool.log - name: Check p2pool.log
run: | run: |
@ -156,11 +153,8 @@ jobs:
python ../tests/src/stratum_dummy.py 1 & python ../tests/src/stratum_dummy.py 1 &
python ../tests/src/stratum_dummy.py 2 & python ../tests/src/stratum_dummy.py 2 &
python ../tests/src/stratum_dummy.py 3 & python ../tests/src/stratum_dummy.py 3 &
python ../tests/src/mm_server.py 8000 id0 data0 &
python ../tests/src/mm_server.py 8001 id1 data1 &
python ../tests/src/mm_server.py 8002 id2 data2 &
sudo sysctl vm.mmap_rnd_bits=28 sudo sysctl vm.mmap_rnd_bits=28
MSAN_OPTIONS="halt_on_error=1" ./p2pool ${{ secrets.TESTNET_NODE_PARAMS }} --config ../tests/src/mm_test_config.json --wallet 9y9HUSpSZX7j2J5UUngX5nCRezR6mZfLmL2D5JXpmPjYVDCPCCcw6Tab2R55xqPTN2FoQEEDmz99TVdy9EW74mqMUw5xRun --data-api data --local-api --merge-mine 127.0.0.1:8000 test0 --merge-mine 127.0.0.1:8001 test1 --merge-mine 127.0.0.1:8002 test2 --loglevel 6 MSAN_OPTIONS="halt_on_error=1" ./p2pool --host xmr.support --rpc-port 18081 --zmq-port 18083 --host node.richfowler.net --rpc-port 18089 --zmq-port 18084 --wallet 44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg --mini --out-peers 200 --data-api data --local-api --loglevel 6
- name: Check p2pool.log - name: Check p2pool.log
run: | run: |
@ -206,11 +200,8 @@ jobs:
python ../tests/src/stratum_dummy.py 1 & python ../tests/src/stratum_dummy.py 1 &
python ../tests/src/stratum_dummy.py 2 & python ../tests/src/stratum_dummy.py 2 &
python ../tests/src/stratum_dummy.py 3 & python ../tests/src/stratum_dummy.py 3 &
python ../tests/src/mm_server.py 8000 id0 data0 &
python ../tests/src/mm_server.py 8001 id1 data1 &
python ../tests/src/mm_server.py 8002 id2 data2 &
sudo sysctl vm.mmap_rnd_bits=28 sudo sysctl vm.mmap_rnd_bits=28
UBSAN_OPTIONS="suppressions=../tests/src/ubsan_sup.txt halt_on_error=1" ./p2pool ${{ secrets.TESTNET_NODE_PARAMS }} --config ../tests/src/mm_test_config.json --wallet 9y9HUSpSZX7j2J5UUngX5nCRezR6mZfLmL2D5JXpmPjYVDCPCCcw6Tab2R55xqPTN2FoQEEDmz99TVdy9EW74mqMUw5xRun --data-api data --local-api --merge-mine 127.0.0.1:8000 test0 --merge-mine 127.0.0.1:8001 test1 --merge-mine 127.0.0.1:8002 test2 --loglevel 6 UBSAN_OPTIONS="suppressions=../tests/src/ubsan_sup.txt halt_on_error=1" ./p2pool --host xmr.support --rpc-port 18081 --zmq-port 18083 --host node.richfowler.net --rpc-port 18089 --zmq-port 18084 --wallet 44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg --mini --out-peers 200 --data-api data --local-api --loglevel 6
- name: Check p2pool.log - name: Check p2pool.log
run: | run: |
@ -256,11 +247,8 @@ jobs:
python ../tests/src/stratum_dummy.py 1 & python ../tests/src/stratum_dummy.py 1 &
python ../tests/src/stratum_dummy.py 2 & python ../tests/src/stratum_dummy.py 2 &
python ../tests/src/stratum_dummy.py 3 & python ../tests/src/stratum_dummy.py 3 &
python ../tests/src/mm_server.py 8000 id0 data0 &
python ../tests/src/mm_server.py 8001 id1 data1 &
python ../tests/src/mm_server.py 8002 id2 data2 &
sudo sysctl vm.mmap_rnd_bits=28 sudo sysctl vm.mmap_rnd_bits=28
ASAN_OPTIONS="detect_stack_use_after_return=1 atexit=1" ./p2pool ${{ secrets.TESTNET_NODE_PARAMS }} --config ../tests/src/mm_test_config.json --wallet 9y9HUSpSZX7j2J5UUngX5nCRezR6mZfLmL2D5JXpmPjYVDCPCCcw6Tab2R55xqPTN2FoQEEDmz99TVdy9EW74mqMUw5xRun --data-api data --local-api --merge-mine 127.0.0.1:8000 test0 --merge-mine 127.0.0.1:8001 test1 --merge-mine 127.0.0.1:8002 test2 --loglevel 6 ASAN_OPTIONS="detect_stack_use_after_return=1 atexit=1" ./p2pool --host xmr.support --rpc-port 18081 --zmq-port 18083 --host node.richfowler.net --rpc-port 18089 --zmq-port 18084 --wallet 44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg --mini --out-peers 200 --data-api data --local-api --loglevel 6
- name: Check p2pool.log - name: Check p2pool.log
run: | run: |
@ -334,10 +322,7 @@ jobs:
python3 ../tests/src/stratum_dummy.py 1 & python3 ../tests/src/stratum_dummy.py 1 &
python3 ../tests/src/stratum_dummy.py 2 & python3 ../tests/src/stratum_dummy.py 2 &
python3 ../tests/src/stratum_dummy.py 3 & python3 ../tests/src/stratum_dummy.py 3 &
python3 ../tests/src/mm_server.py 8000 id0 data0 & ./p2pool --host xmr.support --rpc-port 18081 --zmq-port 18083 --host node.richfowler.net --rpc-port 18089 --zmq-port 18084 --wallet 44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg --mini --out-peers 200 --data-api data --local-api --loglevel 6
python3 ../tests/src/mm_server.py 8001 id1 data1 &
python3 ../tests/src/mm_server.py 8002 id2 data2 &
./p2pool ${{ secrets.TESTNET_NODE_PARAMS }} --config ../tests/src/mm_test_config.json --wallet 9y9HUSpSZX7j2J5UUngX5nCRezR6mZfLmL2D5JXpmPjYVDCPCCcw6Tab2R55xqPTN2FoQEEDmz99TVdy9EW74mqMUw5xRun --data-api data --local-api --merge-mine 127.0.0.1:8000 test0 --merge-mine 127.0.0.1:8001 test1 --merge-mine 127.0.0.1:8002 test2 --loglevel 6
- name: Check p2pool.log - name: Check p2pool.log
run: | run: |
@ -382,10 +367,7 @@ jobs:
start python ../../tests/src/stratum_dummy.py 1 start python ../../tests/src/stratum_dummy.py 1
start python ../../tests/src/stratum_dummy.py 2 start python ../../tests/src/stratum_dummy.py 2
start python ../../tests/src/stratum_dummy.py 3 start python ../../tests/src/stratum_dummy.py 3
start python ../../tests/src/mm_server.py 8000 id0 data0 & p2pool.exe --host xmr.support --rpc-port 18081 --zmq-port 18083 --host node.richfowler.net --rpc-port 18089 --zmq-port 18084 --wallet 44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg --mini --out-peers 200 --data-api data --local-api --loglevel 6
start python ../../tests/src/mm_server.py 8001 id1 data1 &
start python ../../tests/src/mm_server.py 8002 id2 data2 &
p2pool.exe ${{ secrets.TESTNET_NODE_PARAMS }} --config ../../tests/src/mm_test_config.json --wallet 9y9HUSpSZX7j2J5UUngX5nCRezR6mZfLmL2D5JXpmPjYVDCPCCcw6Tab2R55xqPTN2FoQEEDmz99TVdy9EW74mqMUw5xRun --data-api data --local-api --merge-mine 127.0.0.1:8000 test0 --merge-mine 127.0.0.1:8001 test1 --merge-mine 127.0.0.1:8002 test2 --loglevel 6
- name: Check p2pool.log - name: Check p2pool.log
run: | run: |
@ -428,10 +410,7 @@ jobs:
Start-Process python -ArgumentList "../../tests/src/stratum_dummy.py 1" Start-Process python -ArgumentList "../../tests/src/stratum_dummy.py 1"
Start-Process python -ArgumentList "../../tests/src/stratum_dummy.py 2" Start-Process python -ArgumentList "../../tests/src/stratum_dummy.py 2"
Start-Process python -ArgumentList "../../tests/src/stratum_dummy.py 3" Start-Process python -ArgumentList "../../tests/src/stratum_dummy.py 3"
Start-Process python -ArgumentList "../../tests/src/mm_server.py 8000 id0 data0" ./p2pool.exe --host xmr.support --rpc-port 18081 --zmq-port 18083 --host node.richfowler.net --rpc-port 18089 --zmq-port 18084 --wallet 44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg --mini --out-peers 200 --data-api data --local-api --loglevel 6
Start-Process python -ArgumentList "../../tests/src/mm_server.py 8001 id1 data1"
Start-Process python -ArgumentList "../../tests/src/mm_server.py 8002 id2 data2"
./p2pool.exe ${{ secrets.TESTNET_NODE_PARAMS }} --config ../../tests/src/mm_test_config.json --wallet 9y9HUSpSZX7j2J5UUngX5nCRezR6mZfLmL2D5JXpmPjYVDCPCCcw6Tab2R55xqPTN2FoQEEDmz99TVdy9EW74mqMUw5xRun --data-api data --local-api --merge-mine 127.0.0.1:8000 test0 --merge-mine 127.0.0.1:8001 test1 --merge-mine 127.0.0.1:8002 test2 --loglevel 6
- name: Check p2pool.log - name: Check p2pool.log
run: | run: |

View file

@ -425,7 +425,7 @@ hash PoolBlock::calculate_tx_key_seed() const
bool PoolBlock::merge_mining_enabled() const bool PoolBlock::merge_mining_enabled() const
{ {
#ifdef P2POOL_UNIT_TESTS #ifdef P2POOL_UNIT_TESTS
return false; return true;
#else #else
switch (SideChain::network_type()) { switch (SideChain::network_type()) {
case NetworkType::Mainnet: case NetworkType::Mainnet:

Binary file not shown.

View file

@ -60,7 +60,7 @@ TEST(block_template, update)
tpl.update(data, mempool, &wallet); tpl.update(data, mempool, &wallet);
const PoolBlock* b = tpl.pool_block_template(); const PoolBlock* b = tpl.pool_block_template();
ASSERT_EQ(b->m_sidechainId, H("0355a4eeb586ab4d30f3ba89f0ebf7ac1c34a55aebf1bee50af04ff893330280")); ASSERT_EQ(b->m_sidechainId, H("2c90c1926a75c81afd49bf4a4b63e9de7b4c153866411c47e7af864b547c23ec"));
std::vector<uint8_t> blobs; std::vector<uint8_t> blobs;
uint64_t height; uint64_t height;
@ -79,7 +79,7 @@ TEST(block_template, update)
hash blobs_hash; hash blobs_hash;
keccak(blobs.data(), static_cast<int>(blobs.size()), blobs_hash.h); keccak(blobs.data(), static_cast<int>(blobs.size()), blobs_hash.h);
ASSERT_EQ(blobs_hash, H("70ee1661794c9a55f006432b57b0fc37922e0ccf8f1e4294b43890f8a6f44c62")); ASSERT_EQ(blobs_hash, H("c043b754d043b4f6fe3f70273a937c77ff75a5afba9a6ca92776e79da28a1165"));
// Test 2: mempool with high fee and low fee transactions, it must choose high fee transactions // Test 2: mempool with high fee and low fee transactions, it must choose high fee transactions
for (uint64_t i = 0; i < 512; ++i) { for (uint64_t i = 0; i < 512; ++i) {
@ -92,7 +92,7 @@ TEST(block_template, update)
tpl.update(data, mempool, &wallet); tpl.update(data, mempool, &wallet);
ASSERT_EQ(b->m_sidechainId, H("272a7eea0b804cf24427528977d221850d0ee06c26e935219a75f180cfbfc7f3")); ASSERT_EQ(b->m_sidechainId, H("c9df4853003ab436416b9fc9a5a072d16b4dede849e697a8be2ebb9c88c8ec72"));
ASSERT_EQ(b->m_transactions.size(), 203); ASSERT_EQ(b->m_transactions.size(), 203);
for (size_t i = 1; i < b->m_transactions.size(); ++i) { for (size_t i = 1; i < b->m_transactions.size(); ++i) {
@ -109,7 +109,7 @@ TEST(block_template, update)
ASSERT_EQ(template_id, 2U); ASSERT_EQ(template_id, 2U);
keccak(blobs.data(), static_cast<int>(blobs.size()), blobs_hash.h); keccak(blobs.data(), static_cast<int>(blobs.size()), blobs_hash.h);
ASSERT_EQ(blobs_hash, H("c74d295a9cb7e808030284e2169a6f05b685a11c6c577a774d5eb8fad175d5cd")); ASSERT_EQ(blobs_hash, H("f00e196216d160a4fcbf468f748205039d276d62edfa6c6fd4c81dbd1f62d9b7"));
destroy_crypto_cache(); destroy_crypto_cache();
} }

View file

@ -1,8 +0,0 @@
{
"name": "mm_test3",
"password": "",
"block_time": 10,
"min_diff": 100000,
"pplns_window": 216,
"uncle_penalty": 20
}

View file

@ -57,26 +57,26 @@ TEST(pool_block, deserialize)
int outputs_offset, outputs_blob_size; int outputs_offset, outputs_blob_size;
const std::vector<uint8_t> mainchain_data = b.serialize_mainchain_data(&header_size, &miner_tx_size, &outputs_offset, &outputs_blob_size); const std::vector<uint8_t> mainchain_data = b.serialize_mainchain_data(&header_size, &miner_tx_size, &outputs_offset, &outputs_blob_size);
ASSERT_EQ(mainchain_data.size(), 1757U); ASSERT_EQ(mainchain_data.size(), 1829U);
ASSERT_EQ(header_size, 43U); ASSERT_EQ(header_size, 43U);
ASSERT_EQ(miner_tx_size, 1457U); ASSERT_EQ(miner_tx_size, 1145U);
ASSERT_EQ(outputs_offset, 54); ASSERT_EQ(outputs_offset, 54);
ASSERT_EQ(outputs_blob_size, 1371); ASSERT_EQ(outputs_blob_size, 1058);
ASSERT_EQ(b.m_majorVersion, 16U); ASSERT_EQ(b.m_majorVersion, 16U);
ASSERT_EQ(b.m_minorVersion, 16U); ASSERT_EQ(b.m_minorVersion, 16U);
ASSERT_EQ(b.m_timestamp, 1679221824U); ASSERT_EQ(b.m_timestamp, 1728813765U);
ASSERT_EQ(b.m_nonce, 1247U); ASSERT_EQ(b.m_nonce, 352454720U);
ASSERT_EQ(b.m_txinGenHeight, 2845298U); ASSERT_EQ(b.m_txinGenHeight, 3258099U);
ASSERT_EQ(b.m_outputs.size(), 35U); ASSERT_EQ(b.m_outputs.size(), 27U);
ASSERT_EQ(b.m_extraNonceSize, 4U); ASSERT_EQ(b.m_extraNonceSize, 4U);
ASSERT_EQ(b.m_extraNonce, 1482827308U); ASSERT_EQ(b.m_extraNonce, 2983923783U);
ASSERT_EQ(b.m_transactions.size(), 9U); ASSERT_EQ(b.m_transactions.size(), 21U);
ASSERT_EQ(b.m_uncles.size(), 0U); ASSERT_EQ(b.m_uncles.size(), 0U);
ASSERT_EQ(b.m_sidechainHeight, 4674483U); ASSERT_EQ(b.m_sidechainHeight, 9443384U);
ASSERT_EQ(b.m_difficulty.lo, 1854596983U); ASSERT_EQ(b.m_difficulty.lo, 1828732004U);
ASSERT_EQ(b.m_difficulty.hi, 0U); ASSERT_EQ(b.m_difficulty.hi, 0U);
ASSERT_EQ(b.m_cumulativeDifficulty.lo, 7172845253120126ull); ASSERT_EQ(b.m_cumulativeDifficulty.lo, 15051095864465561ull);
ASSERT_EQ(b.m_cumulativeDifficulty.hi, 0U); ASSERT_EQ(b.m_cumulativeDifficulty.hi, 0U);
ASSERT_EQ(b.m_depth, 0U); ASSERT_EQ(b.m_depth, 0U);
ASSERT_EQ(b.m_verified, false); ASSERT_EQ(b.m_verified, false);
@ -87,7 +87,7 @@ TEST(pool_block, deserialize)
hash seed; hash seed;
{ {
std::stringstream s; std::stringstream s;
s << "6fc9c4a55eb513eb31955c084d9342e0082987f9e42da042449b7c9001176d3a"; s << "bf513dbe52c22b09e65edae222ec902d6adb75585a0141b81a165f0fb0c9c0bc";
s >> seed; s >> seed;
} }
@ -99,7 +99,7 @@ TEST(pool_block, deserialize)
std::stringstream s; std::stringstream s;
s << pow_hash; s << pow_hash;
ASSERT_EQ(s.str(), "aa7a3c4a2d67cb6a728e244288219bf038024f3b511b0da197a19ec601000000"); ASSERT_EQ(s.str(), "0906c001cc0900098fe1b62593f8ba52bd1ae2a0806096aa361a9f1702000000");
ASSERT_EQ(b.m_difficulty.check_pow(pow_hash), true); ASSERT_EQ(b.m_difficulty.check_pow(pow_hash), true);
@ -118,16 +118,16 @@ TEST(pool_block, verify)
uint64_t m_sidechainHeight; uint64_t m_sidechainHeight;
bool m_shuffle; bool m_shuffle;
} tests[2] = { } tests[2] = {
{ "default", "sidechain_dump.dat", 2870010, 4957203, true }, { "default", "sidechain_dump.dat", 3258121, 9443762, true },
{ "mini", "sidechain_dump_mini.dat", 2870010, 4414446, false }, { "mini", "sidechain_dump_mini.dat", 3258121, 8912067, false },
}; };
for (const STest& t : tests) for (const STest& t : tests)
{ {
SideChain sidechain(nullptr, NetworkType::Mainnet, t.m_poolName); SideChain sidechain(nullptr, NetworkType::Mainnet, t.m_poolName);
// Difficulty of block 2869248 // Difficulty of block 3256320
sidechain.m_testMainChainDiff = difficulty_type(345786476185ULL, 0ULL); sidechain.m_testMainChainDiff = difficulty_type(374140388237ULL, 0ULL);
std::ifstream f(t.m_fileName, std::ios::binary | std::ios::ate); std::ifstream f(t.m_fileName, std::ios::binary | std::ios::ate);
ASSERT_EQ(f.good() && f.is_open(), true); ASSERT_EQ(f.good() && f.is_open(), true);

Binary file not shown.

Binary file not shown.