Compare commits
54 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| f1c9a1f505 | |||
| 6fe6925f23 | |||
| 2e14be3534 | |||
| f24273378d | |||
| 5a94840442 | |||
| 0936d6e4f0 | |||
| a80d5eb540 | |||
| 6492c6008e | |||
| 9af5dd43ad | |||
| 3558181a7b | |||
| 37e9c3b8a4 | |||
| 3c5c938d40 | |||
| 02a9ce4ee5 | |||
| 9baec059ee | |||
| e9ab515594 | |||
| 07be6a3a81 | |||
| 06aa632e6f | |||
| 9ce9516c99 | |||
| 16053d45d7 | |||
| b39a9bd3ca | |||
| a60584e9ec | |||
| 00b6dabc78 | |||
| 0d33214557 | |||
| d68afc1868 | |||
| e95cc65c43 | |||
| 8cc49350f8 | |||
| 5bd55a5ec6 | |||
| dd2812f1e5 | |||
| 92dfde8a3e | |||
| 6dcdbe0f15 | |||
| dd7e2a477f | |||
| a4459d6207 | |||
| 2581b4c2da | |||
| 28ee73b9e4 | |||
| 4b18bb6ea4 | |||
| 921611ff4d | |||
| fb8e2a71e0 | |||
| ecdaa83669 | |||
| cf325e0e76 | |||
| 94da2e8dff | |||
| 8071ff985f | |||
| a365cfca31 | |||
| d7cd9d24fc | |||
| 7b1b526988 | |||
| 86962eb7aa | |||
| 1029faa02f | |||
| 4a9ccaa62d | |||
| fd0a7ea0c7 | |||
| c0d1070395 | |||
| 180b7edd77 | |||
| 09f5a89a12 | |||
| b1d59a6def | |||
| 3be1d87462 | |||
| 8fa00efa7b |
+13
-13
@@ -18,9 +18,9 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
config:
|
||||
- {arch: x86_64, branch: latest-stable, flags: "-ffunction-sections -Wno-error=inline"}
|
||||
- {arch: aarch64, branch: latest-stable, flags: "-ffunction-sections -Wno-error=inline -mfix-cortex-a53-835769 -mfix-cortex-a53-843419"}
|
||||
- {arch: riscv64, branch: edge, flags: "-ffunction-sections -Wno-error=inline"}
|
||||
- {arch: x86_64, branch: latest-stable, flags: "-ffunction-sections"}
|
||||
- {arch: aarch64, branch: latest-stable, flags: "-ffunction-sections -mfix-cortex-a53-835769 -mfix-cortex-a53-843419"}
|
||||
- {arch: riscv64, branch: edge, flags: "-ffunction-sections"}
|
||||
|
||||
steps:
|
||||
- name: Setup Alpine Linux
|
||||
@@ -43,7 +43,7 @@ jobs:
|
||||
shell: alpine.sh {0}
|
||||
run: |
|
||||
cd external/src/curl
|
||||
cmake . -DCMAKE_C_FLAGS="-Os -flto=auto ${{ 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
|
||||
cmake . -DCMAKE_C_FLAGS="-Os -flto=auto ${{ 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_BROTLI=OFF -DCURL_ZSTD=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 -DCURL_DISABLE_WEBSOCKETS=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 -DBUILD_EXAMPLES=OFF -DP2POOL_BORINGSSL=ON -DCURL_DISABLE_SRP=ON -DOPENSSL_INCLUDE_DIR=../grpc/third_party/boringssl-with-bazel/src/include
|
||||
make -j$(nproc)
|
||||
cd lib && mkdir .libs && cp libcurl.a .libs
|
||||
|
||||
@@ -175,7 +175,7 @@ jobs:
|
||||
strategy:
|
||||
matrix:
|
||||
config:
|
||||
- {flags: "-fuse-linker-plugin -ffunction-sections -Wno-error=inline"}
|
||||
- {flags: "-fuse-linker-plugin -ffunction-sections"}
|
||||
|
||||
steps:
|
||||
- name: Install dependencies
|
||||
@@ -193,7 +193,7 @@ jobs:
|
||||
- name: Build libcurl
|
||||
run: |
|
||||
cd external/src/curl
|
||||
cmake . -DCMAKE_C_FLAGS="-Os -flto=auto ${{ 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
|
||||
cmake . -DCMAKE_C_FLAGS="-Os -flto=auto ${{ 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_BROTLI=OFF -DCURL_ZSTD=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 -DCURL_DISABLE_WEBSOCKETS=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 -DBUILD_EXAMPLES=OFF -DP2POOL_BORINGSSL=ON -DCURL_DISABLE_SRP=ON -DOPENSSL_INCLUDE_DIR=../grpc/third_party/boringssl-with-bazel/src/include
|
||||
make -j$(nproc)
|
||||
cd lib && mkdir .libs && cp libcurl.a .libs
|
||||
|
||||
@@ -272,7 +272,7 @@ jobs:
|
||||
- name: Build libcurl
|
||||
run: |
|
||||
cd external/src/curl
|
||||
cmake . -DCMAKE_TOOLCHAIN_FILE=../../../cmake/aarch64_toolchain.cmake -DCMAKE_C_FLAGS="-Os -flto=auto ${{ 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
|
||||
cmake . -DCMAKE_TOOLCHAIN_FILE=../../../cmake/aarch64_toolchain.cmake -DCMAKE_C_FLAGS="-Os -flto=auto ${{ 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_BROTLI=OFF -DCURL_ZSTD=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 -DCURL_DISABLE_WEBSOCKETS=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 -DBUILD_EXAMPLES=OFF -DP2POOL_BORINGSSL=ON -DCURL_DISABLE_SRP=ON -DOPENSSL_INCLUDE_DIR=../grpc/third_party/boringssl-with-bazel/src/include
|
||||
make -j$(nproc)
|
||||
cd lib && mkdir .libs && cp libcurl.a .libs
|
||||
|
||||
@@ -361,7 +361,7 @@ jobs:
|
||||
- name: Build libcurl
|
||||
run: |
|
||||
cd external/src/curl
|
||||
cmake . -G "Unix Makefiles" -DCMAKE_C_COMPILER=${{ matrix.config.c }} -DCMAKE_C_FLAGS="-Os ${{ matrix.config.flags }}" -DCURL_TARGET_WINDOWS_VERSION=0x0600 -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
|
||||
cmake . -G "Unix Makefiles" -DCMAKE_C_COMPILER=${{ matrix.config.c }} -DCMAKE_C_FLAGS="-Os ${{ matrix.config.flags }}" -DCURL_TARGET_WINDOWS_VERSION=0x0600 -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_BROTLI=OFF -DCURL_ZSTD=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 -DCURL_DISABLE_WEBSOCKETS=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 -DBUILD_EXAMPLES=OFF -DP2POOL_BORINGSSL=ON -DCURL_DISABLE_SRP=ON -DOPENSSL_INCLUDE_DIR=../grpc/third_party/boringssl-with-bazel/src/include
|
||||
make -j$(nproc)
|
||||
cd lib && mkdir .libs && cp libcurl.a .libs
|
||||
|
||||
@@ -400,7 +400,7 @@ jobs:
|
||||
cd tests
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -G "Unix Makefiles" -DCMAKE_C_COMPILER=${{ matrix.config.c }} -DCMAKE_CXX_COMPILER=${{ matrix.config.cxx }} -DCMAKE_C_FLAGS="${{ matrix.config.flags }} -Wl,-s -Wl,--gc-sections" -DCMAKE_CXX_FLAGS="${{ matrix.config.flags }} -Wl,-s -Wl,--gc-sections" -DSTATIC_LIBS=ON
|
||||
cmake .. -G "Unix Makefiles" -DCMAKE_C_COMPILER=${{ matrix.config.c }} -DCMAKE_CXX_COMPILER=${{ matrix.config.cxx }} -DCMAKE_C_FLAGS="${{ matrix.config.flags }} -Wl,-s -Wl,--gc-sections" -DCMAKE_CXX_FLAGS="${{ matrix.config.flags }} -Wl,-s -Wl,--gc-sections" -DSTATIC_LIBS=ON -DOPENSSL_NO_ASM=ON
|
||||
make -j$(nproc)
|
||||
|
||||
- name: Run tests
|
||||
@@ -502,7 +502,7 @@ jobs:
|
||||
- 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="-Os -flto -target x86_64-apple-macos10.13 -Wno-overriding-t-option" -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
|
||||
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="-Os -flto -target x86_64-apple-macos10.13 -Wno-overriding-t-option" -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_BROTLI=OFF -DCURL_ZSTD=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 -DCURL_DISABLE_WEBSOCKETS=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 -DBUILD_EXAMPLES=OFF -DP2POOL_BORINGSSL=ON -DCURL_DISABLE_SRP=ON -DOPENSSL_INCLUDE_DIR=../grpc/third_party/boringssl-with-bazel/src/include
|
||||
make -j4
|
||||
cd lib && mkdir .libs && cp libcurl.a .libs
|
||||
|
||||
@@ -541,7 +541,7 @@ jobs:
|
||||
cd tests
|
||||
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='-flto -target x86_64-apple-macos10.13 -Wno-overriding-t-option' -DCMAKE_CXX_FLAGS='-flto -target x86_64-apple-macos10.13 -Wno-overriding-t-option' -DSTATIC_LIBS=ON
|
||||
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='-flto -target x86_64-apple-macos10.13 -Wno-overriding-t-option' -DCMAKE_CXX_FLAGS='-flto -target x86_64-apple-macos10.13 -Wno-overriding-t-option' -DCMAKE_ASM_FLAGS='-target x86_64-apple-macos10.13' -DSTATIC_LIBS=ON
|
||||
make -j4
|
||||
|
||||
- name: Run tests
|
||||
@@ -570,7 +570,7 @@ jobs:
|
||||
- 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="-Os -target arm64-apple-macos-11" -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
|
||||
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="-Os -target arm64-apple-macos-11" -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_BROTLI=OFF -DCURL_ZSTD=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 -DCURL_DISABLE_WEBSOCKETS=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 -DBUILD_EXAMPLES=OFF -DP2POOL_BORINGSSL=ON -DCURL_DISABLE_SRP=ON -DOPENSSL_INCLUDE_DIR=../grpc/third_party/boringssl-with-bazel/src/include
|
||||
make -j3
|
||||
cd lib && mkdir .libs && cp libcurl.a .libs
|
||||
|
||||
@@ -660,7 +660,7 @@ jobs:
|
||||
run: |
|
||||
sudo pkg install -y cmake
|
||||
cd external/src/curl
|
||||
cmake . -DCMAKE_C_FLAGS="-Os -flto" -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
|
||||
cmake . -DCMAKE_C_FLAGS="-Os -flto" -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_BROTLI=OFF -DCURL_ZSTD=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 -DCURL_DISABLE_WEBSOCKETS=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 -DBUILD_EXAMPLES=OFF -DP2POOL_BORINGSSL=ON -DCURL_DISABLE_SRP=ON -DOPENSSL_INCLUDE_DIR=../grpc/third_party/boringssl-with-bazel/src/include
|
||||
make -j4
|
||||
cd lib && mkdir .libs && cp libcurl.a .libs
|
||||
cd ../../libuv
|
||||
|
||||
@@ -18,9 +18,9 @@ jobs:
|
||||
run: |
|
||||
wget https://apt.llvm.org/llvm.sh
|
||||
chmod +x llvm.sh
|
||||
sudo ./llvm.sh 19
|
||||
sudo apt-get install -y clang-tidy-19
|
||||
clang-tidy-19 --verify-config
|
||||
sudo ./llvm.sh 20
|
||||
sudo apt-get install -y clang-tidy-20
|
||||
clang-tidy-20 --verify-config
|
||||
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v4
|
||||
@@ -31,9 +31,9 @@ jobs:
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_C_COMPILER=clang-19 -DCMAKE_CXX_COMPILER=clang++-19 -DDEV_CLANG_TIDY=ON -DSTATIC_LIBS=ON
|
||||
cmake .. -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCMAKE_C_COMPILER=clang-20 -DCMAKE_CXX_COMPILER=clang++-20 -DDEV_CLANG_TIDY=ON -DSTATIC_LIBS=ON
|
||||
|
||||
- name: Run clang-tidy
|
||||
run: |
|
||||
cd src
|
||||
clang-tidy-19 *.cpp -p ../build -checks=-clang-diagnostic-undefined-internal,-clang-analyzer-optin.performance.Padding,-clang-diagnostic-nan-infinity-disabled -warnings-as-errors=* -header-filter=^[^\.]
|
||||
clang-tidy-20 *.cpp -p ../build -checks=-clang-diagnostic-undefined-internal,-clang-analyzer-optin.performance.Padding,-clang-diagnostic-nan-infinity-disabled -warnings-as-errors=* -header-filter=^[^\.]
|
||||
|
||||
@@ -15,7 +15,7 @@ on:
|
||||
jobs:
|
||||
cppcheck-ubuntu:
|
||||
|
||||
timeout-minutes: 120
|
||||
timeout-minutes: 240
|
||||
runs-on: ubuntu-latest
|
||||
|
||||
steps:
|
||||
@@ -39,7 +39,7 @@ jobs:
|
||||
run: |
|
||||
mkdir build
|
||||
cd build
|
||||
cmake .. -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DSTATIC_LIBS=ON
|
||||
cmake .. -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DSTATIC_LIBS=ON -DWITH_GRPC=OFF
|
||||
python ../cppcheck/remove_external.py compile_commands.json
|
||||
|
||||
- name: Run cppcheck
|
||||
@@ -48,12 +48,14 @@ jobs:
|
||||
./run.sh
|
||||
|
||||
- name: Archive full error list
|
||||
if: '!cancelled()'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: errors_full-linux
|
||||
path: cppcheck/errors_full.txt
|
||||
|
||||
- name: Archive checkers report
|
||||
if: '!cancelled()'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: checkers_report-linux
|
||||
@@ -96,12 +98,14 @@ jobs:
|
||||
./run.cmd
|
||||
|
||||
- name: Archive full error list
|
||||
if: '!cancelled()'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: errors_full-windows
|
||||
path: cppcheck/errors_full.txt
|
||||
|
||||
- name: Archive checkers report
|
||||
if: '!cancelled()'
|
||||
uses: actions/upload-artifact@v4
|
||||
with:
|
||||
name: checkers_report-windows
|
||||
|
||||
@@ -33,7 +33,7 @@ jobs:
|
||||
- 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
|
||||
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_BROTLI=OFF -DCURL_ZSTD=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 -DCURL_DISABLE_WEBSOCKETS=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 -DBUILD_EXAMPLES=OFF -DP2POOL_BORINGSSL=ON -DCURL_DISABLE_SRP=ON -DOPENSSL_INCLUDE_DIR=../grpc/third_party/boringssl-with-bazel/src/include
|
||||
make -j$(nproc)
|
||||
cd lib && mkdir .libs && cp libcurl.a .libs
|
||||
|
||||
@@ -68,7 +68,7 @@ jobs:
|
||||
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
|
||||
TSAN_OPTIONS="suppressions=../tests/src/tsan_sup.txt halt_on_error=1 history_size=4" ./p2pool --host xmr.support --rpc-port 18081 --zmq-port 18083 --host node.richfowler.net --rpc-port 18089 --zmq-port 18084 --rpc-ssl --wallet 44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg --mini --out-peers 200 --data-api data --local-api --loglevel 6
|
||||
|
||||
- name: Check p2pool.log
|
||||
run: |
|
||||
@@ -119,7 +119,7 @@ jobs:
|
||||
- name: Build libcurl
|
||||
run: |
|
||||
cd external/src/curl
|
||||
cmake . -DCMAKE_C_COMPILER=clang-19 -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
|
||||
cmake . -DCMAKE_C_COMPILER=clang-19 -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_BROTLI=OFF -DCURL_ZSTD=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 -DCURL_DISABLE_WEBSOCKETS=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 -DBUILD_EXAMPLES=OFF -DP2POOL_BORINGSSL=ON -DCURL_DISABLE_SRP=ON -DOPENSSL_INCLUDE_DIR=../grpc/third_party/boringssl-with-bazel/src/include
|
||||
make -j$(nproc)
|
||||
cd lib && mkdir .libs && cp libcurl.a .libs
|
||||
|
||||
@@ -154,7 +154,7 @@ jobs:
|
||||
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
|
||||
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 --rpc-ssl --wallet 44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg --mini --out-peers 200 --data-api data --local-api --loglevel 6
|
||||
|
||||
- name: Check p2pool.log
|
||||
run: |
|
||||
@@ -201,7 +201,7 @@ jobs:
|
||||
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
|
||||
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 --rpc-ssl --wallet 44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg --mini --out-peers 200 --data-api data --local-api --loglevel 6
|
||||
|
||||
- name: Check p2pool.log
|
||||
run: |
|
||||
@@ -248,7 +248,7 @@ jobs:
|
||||
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
|
||||
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 --rpc-ssl --wallet 44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg --mini --out-peers 200 --data-api data --local-api --loglevel 6
|
||||
|
||||
- name: Check p2pool.log
|
||||
run: |
|
||||
@@ -280,15 +280,10 @@ jobs:
|
||||
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
|
||||
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_BROTLI=OFF -DCURL_ZSTD=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 -DCURL_DISABLE_WEBSOCKETS=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 -DBUILD_EXAMPLES=OFF -DP2POOL_BORINGSSL=ON -DCURL_DISABLE_SRP=ON -DOPENSSL_INCLUDE_DIR=../grpc/third_party/boringssl-with-bazel/src/include
|
||||
make -j4
|
||||
cd lib && mkdir .libs && cp libcurl.a .libs
|
||||
|
||||
@@ -322,7 +317,7 @@ jobs:
|
||||
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
|
||||
./p2pool --host xmr.support --rpc-port 18081 --zmq-port 18083 --host node.richfowler.net --rpc-port 18089 --zmq-port 18084 --rpc-ssl --wallet 44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg --mini --out-peers 200 --data-api data --local-api --loglevel 6
|
||||
|
||||
- name: Check p2pool.log
|
||||
run: |
|
||||
@@ -367,7 +362,7 @@ jobs:
|
||||
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
|
||||
p2pool.exe --host xmr.support --rpc-port 18081 --zmq-port 18083 --host node.richfowler.net --rpc-port 18089 --zmq-port 18084 --rpc-ssl --wallet 44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg --mini --out-peers 200 --data-api data --local-api --loglevel 6
|
||||
|
||||
- name: Check p2pool.log
|
||||
run: |
|
||||
@@ -410,7 +405,7 @@ jobs:
|
||||
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
|
||||
./p2pool.exe --host xmr.support --rpc-port 18081 --zmq-port 18083 --host node.richfowler.net --rpc-port 18089 --zmq-port 18084 --rpc-ssl --wallet 44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg --mini --out-peers 200 --data-api data --local-api --loglevel 6
|
||||
|
||||
- name: Check p2pool.log
|
||||
run: |
|
||||
|
||||
+2
-11
@@ -31,7 +31,7 @@ option(DEV_DEBUG "[Developer only] Compile a debug build" OFF)
|
||||
set_property(DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY VS_STARTUP_PROJECT p2pool)
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES MSVC)
|
||||
set(CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION 10.0)
|
||||
include(cmake/msvc_libs.cmake)
|
||||
endif()
|
||||
|
||||
if (WITH_GRPC)
|
||||
@@ -233,16 +233,7 @@ elseif (NOT APPLE)
|
||||
set(LIBS ${LIBS} pthread)
|
||||
endif()
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES MSVC)
|
||||
find_library(ZMQ_LIBRARY_DEBUG NAMES libzmq-v142-mt-sgd-4_3_6 PATHS "external/lib/libzmq/Debug")
|
||||
find_library(ZMQ_LIBRARY NAMES libzmq-v142-mt-s-4_3_6 PATHS "external/lib/libzmq/Release")
|
||||
find_library(UV_LIBRARY_DEBUG NAMES libuv PATHS "external/lib/libuv/Debug")
|
||||
find_library(UV_LIBRARY NAMES libuv PATHS "external/lib/libuv/Release")
|
||||
find_library(CURL_LIBRARY_DEBUG NAMES libcurl-d PATHS "external/lib/libcurl/Debug")
|
||||
find_library(CURL_LIBRARY NAMES libcurl PATHS "external/lib/libcurl/Release")
|
||||
add_definitions(-D_DISABLE_VECTOR_ANNOTATION)
|
||||
add_definitions(-D_DISABLE_STRING_ANNOTATION)
|
||||
elseif (CMAKE_CXX_COMPILER_ID MATCHES GNU OR CMAKE_CXX_COMPILER_ID MATCHES Clang)
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES GNU OR CMAKE_CXX_COMPILER_ID MATCHES Clang)
|
||||
find_library(ZMQ_LIBRARY_DEBUG NAMES zmq libzmq.a)
|
||||
find_library(ZMQ_LIBRARY NAMES zmq libzmq.a)
|
||||
find_library(UV_LIBRARY_DEBUG NAMES uv libuv.a)
|
||||
|
||||
+2
-2
@@ -17,7 +17,7 @@ if (CMAKE_CXX_COMPILER_ID MATCHES GNU)
|
||||
set(GENERAL_FLAGS "${GENERAL_FLAGS} -fno-omit-frame-pointer -fsanitize=address")
|
||||
endif()
|
||||
|
||||
set(WARNING_FLAGS "-Wall -Wextra -Wcast-qual -Wlogical-op -Wundef -Wformat=2 -Wpointer-arith -Werror")
|
||||
set(WARNING_FLAGS "-Wall -Wextra -Wcast-qual -Wlogical-op -Wundef -Wformat=2 -Wpointer-arith -Werror -Wno-error=inline")
|
||||
|
||||
if (CMAKE_CXX_COMPILER_VERSION VERSION_GREATER 7.5.0)
|
||||
set(WARNING_FLAGS "${WARNING_FLAGS} -Wstrict-overflow=2")
|
||||
@@ -60,7 +60,7 @@ elseif (CMAKE_CXX_COMPILER_ID MATCHES MSVC)
|
||||
set(GENERAL_FLAGS "/MP /EHa")
|
||||
set(WARNING_FLAGS "/Wall /WX /sdl")
|
||||
set(SECURITY_FLAGS "/GS /guard:cf")
|
||||
set(OPTIMIZATION_FLAGS "/O2 /Oi /Ob2 /Ot /DNDEBUG /GL")
|
||||
set(OPTIMIZATION_FLAGS "/O2 /Oi /Ob2 /Ot /Oy /DNDEBUG /GL")
|
||||
|
||||
if (DISABLE_WARNINGS)
|
||||
set(WARNING_FLAGS "/W0")
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
set(CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION 10.0)
|
||||
|
||||
add_definitions(-D_DISABLE_VECTOR_ANNOTATION)
|
||||
add_definitions(-D_DISABLE_STRING_ANNOTATION)
|
||||
|
||||
set(BUILD_TESTING OFF CACHE BOOL "")
|
||||
set(LIBUV_BUILD_SHARED OFF CACHE BOOL "")
|
||||
set(WITH_LIBSODIUM OFF CACHE BOOL "")
|
||||
set(WITH_LIBBSD OFF CACHE BOOL "")
|
||||
set(BUILD_TESTS OFF CACHE BOOL "")
|
||||
set(ZMQ_HAVE_IPC OFF CACHE BOOL "")
|
||||
set(WITH_DOCS OFF CACHE BOOL "")
|
||||
set(ENABLE_DRAFTS OFF CACHE BOOL "")
|
||||
set(BUILD_SHARED OFF CACHE BOOL "")
|
||||
set(ENABLE_CLANG OFF CACHE BOOL "")
|
||||
|
||||
set(CURL_TARGET_WINDOWS_VERSION "0x0600" CACHE STRING "")
|
||||
set(BUILD_CURL_EXE OFF CACHE BOOL "")
|
||||
set(BUILD_SHARED_LIBS OFF CACHE BOOL "")
|
||||
set(CURL_DISABLE_INSTALL ON CACHE BOOL "")
|
||||
set(CURL_ENABLE_EXPORT_TARGET OFF CACHE BOOL "")
|
||||
set(CURL_DISABLE_HEADERS_API ON CACHE BOOL "")
|
||||
set(CURL_DISABLE_BINDLOCAL ON CACHE BOOL "")
|
||||
set(BUILD_LIBCURL_DOCS OFF CACHE BOOL "")
|
||||
set(BUILD_MISC_DOCS OFF CACHE BOOL "")
|
||||
set(ENABLE_CURL_MANUAL OFF CACHE BOOL "")
|
||||
set(CURL_ZLIB OFF CACHE BOOL "")
|
||||
set(CURL_BROTLI OFF CACHE BOOL "")
|
||||
set(CURL_ZSTD OFF CACHE BOOL "")
|
||||
set(CURL_DISABLE_ALTSVC ON CACHE BOOL "")
|
||||
set(CURL_DISABLE_COOKIES ON CACHE BOOL "")
|
||||
set(CURL_DISABLE_DOH ON CACHE BOOL "")
|
||||
set(CURL_DISABLE_GETOPTIONS ON CACHE BOOL "")
|
||||
set(CURL_DISABLE_HSTS ON CACHE BOOL "")
|
||||
set(CURL_DISABLE_LIBCURL_OPTION ON CACHE BOOL "")
|
||||
set(CURL_DISABLE_MIME ON CACHE BOOL "")
|
||||
set(CURL_DISABLE_NETRC ON CACHE BOOL "")
|
||||
set(CURL_DISABLE_NTLM ON CACHE BOOL "")
|
||||
set(CURL_DISABLE_PARSEDATE ON CACHE BOOL "")
|
||||
set(CURL_DISABLE_PROGRESS_METER ON CACHE BOOL "")
|
||||
set(CURL_DISABLE_SHUFFLE_DNS ON CACHE BOOL "")
|
||||
set(CURL_DISABLE_SOCKETPAIR ON CACHE BOOL "")
|
||||
set(CURL_DISABLE_VERBOSE_STRINGS ON CACHE BOOL "")
|
||||
set(CURL_DISABLE_WEBSOCKETS ON CACHE BOOL "")
|
||||
set(HTTP_ONLY ON CACHE BOOL "")
|
||||
set(CURL_ENABLE_SSL OFF CACHE BOOL "")
|
||||
set(USE_LIBIDN2 OFF CACHE BOOL "")
|
||||
set(CURL_USE_LIBPSL OFF CACHE BOOL "")
|
||||
set(CURL_USE_LIBSSH2 OFF CACHE BOOL "")
|
||||
set(ENABLE_UNIX_SOCKETS OFF CACHE BOOL "")
|
||||
set(CURL_DISABLE_TESTS ON CACHE BOOL "")
|
||||
set(USE_NGHTTP2 OFF CACHE BOOL "")
|
||||
set(BUILD_EXAMPLES OFF CACHE BOOL "")
|
||||
set(CURL_DISABLE_SRP ON CACHE BOOL "")
|
||||
set(CURL_STATIC_CRT ON CACHE BOOL "")
|
||||
|
||||
if (WITH_TLS)
|
||||
set(P2POOL_BORINGSSL ON CACHE BOOL "")
|
||||
set(OPENSSL_INCLUDE_DIR "../grpc/third_party/boringssl-with-bazel/src/include" CACHE STRING "")
|
||||
endif()
|
||||
|
||||
add_subdirectory(external/src/curl)
|
||||
add_subdirectory(external/src/libuv)
|
||||
add_subdirectory(external/src/libzmq)
|
||||
|
||||
set(CURL_LIBRARY_DEBUG libcurl_static)
|
||||
set(CURL_LIBRARY libcurl_static)
|
||||
|
||||
set(UV_LIBRARY_DEBUG uv_a)
|
||||
set(UV_LIBRARY uv_a)
|
||||
|
||||
set(ZMQ_LIBRARY_DEBUG libzmq-static)
|
||||
set(ZMQ_LIBRARY libzmq-static)
|
||||
+11
-1
@@ -1,9 +1,19 @@
|
||||
@echo off
|
||||
"..\cppcheck-main\bin\cppcheck.exe" ../src/*.cpp -DSIZE_MAX=UINT64_MAX -DRAPIDJSON_ENDIAN=RAPIDJSON_LITTLEENDIAN -D_WIN32=1 -D_WIN64=1 -DWIN32=1 -D_WINDOWS=1 -DNDEBUG=1 -DWITH_GRPC=1 -DPROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII=0 -DWITH_RANDOMX=1 -DWITH_UPNP=1 -DCURL_STATICLIB=1 -DWIN32_LEAN_AND_MEAN=1 -D_WIN32_WINNT=0x0600 -D_DISABLE_VECTOR_ANNOTATION=1 -D_DISABLE_STRING_ANNOTATION=1 -DZMQ_STATIC=1 -DHAVE_BITSCANREVERSE64=1 -DRAPIDJSON_PARSE_DEFAULT_FLAGS=kParseTrailingCommasFlag -DMINIUPNP_STATICLIB=1 -DCARES_STATICLIB=1 -DCMAKE_INTDIR="Release" -D__SSE2__=1 -D_MSC_VER=1929 -D__COVERITY__ --platform=win64 --std=c++17 --enable=all --inconclusive --inline-suppr --template="{file}:{line}:{id}{inconclusive: INCONCLUSIVE} {message}" --includes-file=includes.txt --suppressions-list=suppressions.txt --output-file=errors_full.txt --max-ctu-depth=3 --check-level=exhaustive --checkers-report=checkers_report.txt
|
||||
"..\cppcheck-main\bin\cppcheck.exe" ../src/*.cpp -D__cppcheck__ -DSIZE_MAX=UINT64_MAX -DRAPIDJSON_ENDIAN=RAPIDJSON_LITTLEENDIAN -D_WIN32=1 -D_WIN64=1 -DWIN32=1 -D_WINDOWS=1 -DNDEBUG=1 -DWITH_GRPC=1 -DPROTOBUF_ENABLE_DEBUG_LOGGING_MAY_LEAK_PII=0 -DWITH_RANDOMX=1 -DWITH_UPNP=1 -DCURL_STATICLIB=1 -DWIN32_LEAN_AND_MEAN=1 -D_WIN32_WINNT=0x0600 -D_DISABLE_VECTOR_ANNOTATION=1 -D_DISABLE_STRING_ANNOTATION=1 -DZMQ_STATIC=1 -DHAVE_BITSCANREVERSE64=1 -DRAPIDJSON_PARSE_DEFAULT_FLAGS=kParseTrailingCommasFlag -DMINIUPNP_STATICLIB=1 -DCARES_STATICLIB=1 -DCMAKE_INTDIR="Release" -D__SSE2__=1 -D_MSC_VER=1929 --platform=win64 --std=c++17 --enable=all --inconclusive --inline-suppr --template="{file}:{line}:{id}{inconclusive: INCONCLUSIVE} {message}" --includes-file=includes.txt --suppressions-list=suppressions.txt --output-file=errors_full.txt --max-ctu-depth=3 --check-level=exhaustive --checkers-report=checkers_report.txt
|
||||
|
||||
findstr /V /C:"external\src" errors_full.txt > errors_filtered0.txt
|
||||
findstr /V /C:":checkersReport" errors_filtered0.txt > errors_filtered.txt
|
||||
|
||||
findstr /C:"There were critical errors" checkers_report.txt > checkers_report_filtered.txt
|
||||
|
||||
for /f %%i in ("errors_filtered.txt") do set size=%%~zi
|
||||
if %size% gtr 0 (
|
||||
type errors_filtered.txt
|
||||
exit 1
|
||||
)
|
||||
|
||||
for /f %%i in ("checkers_report_filtered.txt") do set size2=%%~zi
|
||||
if %size2% gtr 0 (
|
||||
type checkers_report_filtered.txt
|
||||
exit 1
|
||||
)
|
||||
|
||||
+10
-1
@@ -1,8 +1,17 @@
|
||||
#!/bin/bash
|
||||
../cppcheck-main/cppcheck --project=../build/compile_commands.json -DSIZE_MAX=UINT64_MAX -DRAPIDJSON_ENDIAN=RAPIDJSON_LITTLEENDIAN -D__SSE2__=1 -D__BYTE_ORDER__=1 -D__ORDER_LITTLE_ENDIAN__=1 -D__linux__=1 --platform=unix64 --std=c++17 --enable=all --inconclusive --inline-suppr --template="{file}:{line}:{id}{inconclusive: INCONCLUSIVE} {message}" --suppressions-list=suppressions.txt --output-file=errors_full.txt --max-ctu-depth=3 --check-level=exhaustive --checkers-report=checkers_report.txt
|
||||
../cppcheck-main/cppcheck --project=../build/compile_commands.json -D__cppcheck__ -DSIZE_MAX=UINT64_MAX -DRAPIDJSON_ENDIAN=RAPIDJSON_LITTLEENDIAN -DRAPIDJSON_64BIT=1 -D__SSE2__=1 -D__BYTE_ORDER__=1 -D__ORDER_LITTLE_ENDIAN__=1 -D__linux__=1 -D__x86_64 -D_M_AMD64 -D_M_X64 --platform=unix64 --std=c++17 --enable=all --inconclusive --inline-suppr --template="{file}:{line}:{id}{inconclusive: INCONCLUSIVE} {message}" --suppressions-list=suppressions.txt --output-file=errors_full.txt --max-ctu-depth=3 --check-level=exhaustive --checkers-report=checkers_report.txt
|
||||
|
||||
grep -v 'external' errors_full.txt > errors_filtered0.txt
|
||||
grep -v ':checkersReport' errors_filtered0.txt > errors_filtered.txt
|
||||
|
||||
grep 'There were critical errors' checkers_report.txt > checkers_report_filtered.txt
|
||||
|
||||
if [ -s errors_filtered.txt ]; then
|
||||
cat errors_filtered.txt
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -s checkers_report_filtered.txt ]; then
|
||||
cat checkers_report_filtered.txt
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@@ -1,3 +1,3 @@
|
||||
npyscreen==4.10.5
|
||||
MarkupSafe==2.0.1
|
||||
jinja2==3.1.4
|
||||
jinja2==3.1.5
|
||||
|
||||
@@ -5,4 +5,6 @@ COPY app /app
|
||||
WORKDIR /app
|
||||
RUN pip install -r requirements.txt
|
||||
|
||||
STOPSIGNAL SIGINT
|
||||
|
||||
CMD ["/app/p2pool_statistics.py"]
|
||||
|
||||
+50
-34
@@ -1,38 +1,42 @@
|
||||
### P2Pool command line options
|
||||
|
||||
```
|
||||
--wallet Wallet address to mine to. Subaddresses and integrated addresses are not supported!
|
||||
--host IP address of your Monero node, default is 127.0.0.1
|
||||
--rpc-port monerod RPC API port number, default is 18081
|
||||
--zmq-port monerod ZMQ pub port number, default is 18083 (same port as in monerod's "--zmq-pub" command line parameter)
|
||||
--stratum Comma-separated list of IP:port for stratum server to listen on
|
||||
--p2p Comma-separated list of IP:port for p2p server to listen on
|
||||
--addpeers Comma-separated list of IP:port of other p2pool nodes to connect to
|
||||
--light-mode Don't allocate RandomX dataset, saves 2GB of RAM
|
||||
--loglevel Verbosity of the log, integer number between 0 and 6
|
||||
--config Name of p2pool sidechain's config file (don't use it unless you want to mine to a different p2pool chain)
|
||||
--data-api Path to the p2pool JSON data (use it in tandem with an external web-server)
|
||||
--local-api Enable /local/ path in api path for Stratum Server and built-in miner statistics
|
||||
--stratum-api An alias for --local-api
|
||||
--no-cache Disable p2pool.cache
|
||||
--no-color Disable colors in console output
|
||||
--no-randomx Disable internal RandomX hasher: p2pool will use RPC calls to monerod to check PoW hashes
|
||||
--out-peers N Maximum number of outgoing connections for p2p server (any value between 10 and 450)
|
||||
--in-peers N Maximum number of incoming connections for p2p server (any value between 10 and 450)
|
||||
--start-mining N Start built-in miner using N threads (any value between 1 and 64)
|
||||
--mini Connect to p2pool-mini sidechain. Note that it will also change default p2p port from 37889 to 37888
|
||||
--no-autodiff Disable automatic difficulty adjustment for miners connected to stratum (WARNING: incompatible with Nicehash and MRR)
|
||||
--rpc-login Specify username[:password] required for Monero RPC server
|
||||
--socks5 Specify IP:port of a SOCKS5 proxy to use for outgoing connections
|
||||
--no-dns Disable DNS queries, use only IP addresses to connect to peers (seed node DNS will be unavailable too)
|
||||
--p2p-external-port Port number that your router uses for mapping to your local p2p port. Use it if you are behind a NAT and still want to accept incoming connections
|
||||
--no-upnp Disable UPnP port forwarding
|
||||
--no-igd An alias for --no-upnp
|
||||
--upnp-stratum Port forward Stratum port (it's not forwarded by default)
|
||||
--merge-mine IP:port and wallet address for another blockchain to merge mine with
|
||||
--version Print p2pool's version and build details
|
||||
--tls-cert file Load TLS certificate chain from "file" in the PEM format
|
||||
--tls-cert-key file Load TLS certificate private key from "file" in the PEM format
|
||||
--wallet Wallet address to mine to. Subaddresses and integrated addresses are not supported!
|
||||
--host IP address of your Monero node, default is 127.0.0.1
|
||||
--rpc-port monerod RPC API port number, default is 18081
|
||||
--zmq-port monerod ZMQ pub port number, default is 18083 (same port as in monerod's "--zmq-pub" command line parameter)
|
||||
--stratum Comma-separated list of IP:port for stratum server to listen on
|
||||
--p2p Comma-separated list of IP:port for p2p server to listen on
|
||||
--addpeers Comma-separated list of IP:port of other p2pool nodes to connect to
|
||||
--light-mode Don't allocate RandomX dataset, saves 2GB of RAM
|
||||
--loglevel Verbosity of the log, integer number between 0 and 6
|
||||
--data-dir Path to store general p2pool files (log, cache, peer data, etc.), default is current directory
|
||||
--sidechain-config Name of the p2pool sidechain parameters file (only use it if you run your own sidechain)
|
||||
--data-api Path to the p2pool JSON data (use it in tandem with an external web-server). Not affected by --data-dir setting!
|
||||
--local-api Enable /local/ path in api path for Stratum Server and built-in miner statistics
|
||||
--stratum-api An alias for --local-api
|
||||
--no-cache Disable p2pool.cache
|
||||
--no-color Disable colors in console output
|
||||
--no-randomx Disable internal RandomX hasher: p2pool will use RPC calls to monerod to check PoW hashes
|
||||
--out-peers N Maximum number of outgoing connections for p2p server (any value between 10 and 450)
|
||||
--in-peers N Maximum number of incoming connections for p2p server (any value between 10 and 450)
|
||||
--start-mining N Start built-in miner using N threads (any value between 1 and 64)
|
||||
--mini Connect to p2pool-mini sidechain. Note that it will also change default p2p port from 37889 to 37888
|
||||
--no-autodiff Disable automatic difficulty adjustment for miners connected to stratum (WARNING: incompatible with Nicehash and MRR)
|
||||
--rpc-login Specify username[:password] required for Monero RPC server
|
||||
--socks5 Specify IP:port of a SOCKS5 proxy to use for outgoing connections
|
||||
--no-dns Disable DNS queries, use only IP addresses to connect to peers (seed node DNS will be unavailable too)
|
||||
--p2p-external-port Port number that your router uses for mapping to your local p2p port. Use it if you are behind a NAT and still want to accept incoming connections
|
||||
--no-upnp Disable UPnP port forwarding
|
||||
--no-igd An alias for --no-upnp
|
||||
--upnp-stratum Port forward Stratum port (it's not forwarded by default)
|
||||
--merge-mine IP:port and wallet address for another blockchain to merge mine with
|
||||
--version Print p2pool's version and build details
|
||||
--tls-cert file Load TLS certificate chain from "file" in the PEM format
|
||||
--tls-cert-key file Load TLS certificate private key from "file" in the PEM format
|
||||
--rpc-ssl Enable SSL on RPC connections to the Monero node
|
||||
--rpc-ssl-fingerprint base64-encoded fingerprint of the Monero node's certificate (optional, use it for certificate pinning)
|
||||
--no-stratum-http Disable HTTP on Stratum ports
|
||||
```
|
||||
|
||||
### Example command line
|
||||
@@ -45,9 +49,9 @@ p2pool.exe --host 127.0.0.1 --rpc-port 18081 --zmq-port 18083 --wallet YOUR_WALL
|
||||
|
||||
You can have multiple hosts in command line. If P2Pool detects that the host it's currently using is down or stuck, it will cycle through hosts until it finds a working one. It will not switch back as long as the current host it found is working.
|
||||
|
||||
Each new host uses RPC and zmq-pub port numbers from the previous host (or default 18081/18083 if none were specified). Note that `--rpc-login` is not copied from the previous host, you must specify it for each host that has username/password.
|
||||
Each new host uses RPC and zmq-pub port numbers from the previous host (or default 18081/18083 if none were specified). Note that `--rpc-login`, `--rpc-ssl` and `--rpc-ssl-fingerprint` are not copied from the previous host, you must specify it for each host that has username/password or RPC-SSL enabled.
|
||||
|
||||
In this example, you have local Monero host running on ports 18081/18083 (RPC/zmq-pub), and several backup hosts running on ports 18089/18084.
|
||||
In the following example, you have local Monero host running on ports 18081/18083 (RPC/zmq-pub), and several backup hosts running on ports 18089/18084.
|
||||
|
||||
|
||||
```
|
||||
@@ -86,3 +90,15 @@ If you want to use your own certificate, please refer to your certificate provid
|
||||
Note that you need to use certificate files and `--tls...` parameters to be able to use certificate pinning in XMRig miners that connect to your P2Pool instance.
|
||||
|
||||
`--tls-cert` and `--tls-cert-key` parameters must always be used together.
|
||||
|
||||
### RPC-SSL
|
||||
|
||||
Starting from v4.4, P2Pool supports RPC-SSL connections to Monero nodes. Add `--rpc-ssl` to P2Pool command line to enable it.
|
||||
|
||||
P2Pool supports certificate pinning on RPC-SSL connections via `--rpc-ssl-fingerprint MONERO_NODE_FINGERPRINT_BASE64` parameter. To get your node certificate's fingerprint, run
|
||||
|
||||
```
|
||||
openssl x509 -in rpc_ssl.crt -pubkey -noout -inform pem | openssl pkey -pubin -outform der | openssl dgst -sha256 -binary | openssl enc -base64
|
||||
```
|
||||
|
||||
By default, `rpc_ssl.crt` can be found in Monero data directory: `/home/username/.bitmonero/rpc_ssl.crt` on Linux and `C:\ProgramData\bitmonero\rpc_ssl.crt` on Windows.
|
||||
@@ -281,7 +281,7 @@ It's highly recommended to create a new wallet for mining because wallet address
|
||||
<details><summary>Help and support</summary>
|
||||
P2Pool is a decentralized community, there is no dedicated support. You can reach and get help from other miners on:
|
||||
<ul>
|
||||
<li>IRC channels: <span>#monero-pools</span> and <span>#p2pool-log</span> (<span>#p2pool-mini</span> for P2Pool mini) on <a href="https://libera.chat/" target="_blank">Libera.Chat</a>
|
||||
<li>IRC channels: <span>#p2pool-log</span> (<span>#p2pool-mini</span> for P2Pool mini) on <a href="https://libera.chat/" target="_blank">Libera.Chat</a>
|
||||
<li>Reddit: <a href="https://reddit.com/r/MoneroMining/" target="_blank">r/MoneroMining</a>
|
||||
</ul></details>
|
||||
</td></tr></table>
|
||||
@@ -310,7 +310,7 @@ P2Pool is a decentralized community, there is no dedicated support. You can reac
|
||||
<br><br>
|
||||
<div style="position:fixed;width:100%;bottom:0;background-color:#383838;font-size:1rem;text-align:center;color:#b0b0b0;">
|
||||
<a href="api/" target="_blank">Pool API</a> | <a href="https://github.com/SChernykh/p2pool" target="_blank">Source</a> | <a href="http://yucmgsbw7nknw7oi3bkuwudvc657g2xcqahhbjyewazusyytapqo4xid.onion/" target="_blank">Onion URL</a><br>
|
||||
Donate to support the project:<br><a href="monero:44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg?tx_description=Donation%20to%20P2Pool" style="font-size:0.9rem;color:#b0b0b0;">44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg</a><br>
|
||||
Donate to support the project:<br><span style="font-size:0.9rem;color:#b0b0b0;">44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg</span><br>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
|
||||
@@ -281,7 +281,7 @@ It's highly recommended to create a new wallet for mining because wallet address
|
||||
<details><summary>Help and support</summary>
|
||||
P2Pool is a decentralized community, there is no dedicated support. You can reach and get help from other miners on:
|
||||
<ul>
|
||||
<li>IRC channels: <span>#monero-pools</span> and <span>#p2pool-log</span> (<span>#p2pool-mini</span> for P2Pool mini) on <a href="https://libera.chat/" target="_blank">Libera.Chat</a>
|
||||
<li>IRC channels: <span>#p2pool-log</span> (<span>#p2pool-mini</span> for P2Pool mini) on <a href="https://libera.chat/" target="_blank">Libera.Chat</a>
|
||||
<li>Reddit: <a href="https://reddit.com/r/MoneroMining/" target="_blank">r/MoneroMining</a>
|
||||
</ul></details>
|
||||
</td></tr></table>
|
||||
@@ -310,7 +310,7 @@ P2Pool is a decentralized community, there is no dedicated support. You can reac
|
||||
<br><br>
|
||||
<div style="position:fixed;width:100%;bottom:0;background-color:#383838;font-size:1rem;text-align:center;color:#b0b0b0;">
|
||||
<a href="api/" target="_blank">Pool API</a> | <a href="https://github.com/SChernykh/p2pool" target="_blank">Source</a> | <a href="http://yucmgsbw7nknw7oi3bkuwudvc657g2xcqahhbjyewazusyytapqo4xid.onion/mini/" target="_blank">Onion URL</a><br>
|
||||
Donate to support the project:<br><a href="monero:44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg?tx_description=Donation%20to%20P2Pool" style="font-size:0.9rem;color:#b0b0b0;">44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg</a><br>
|
||||
Donate to support the project:<br><span style="font-size:0.9rem;color:#b0b0b0;">44MnN1f3Eto8DZYUWuE5XZNUtE3vcRzt2j6PzqWpPau34e6Cf4fAxt6X2MBmrm6F9YMEiMNjN6W4Shn4pLcfNAja621jwyg</span><br>
|
||||
|
||||
</div>
|
||||
</body>
|
||||
|
||||
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Vendored
BIN
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Vendored
+2
-2
@@ -39,8 +39,8 @@ include_directories(../grpc/third_party/abseil-cpp)
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES MSVC)
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /W0 /Zi /Od /Ob0 /MP /MTd")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /W0 /Zi /Od /Ob0 /MP /MTd")
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /W0 /O1 /Ob2 /Oi /Os /Oy /MP /GL /MT")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /W0 /O1 /Ob2 /Oi /Os /Oy /MP /GL /MT")
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /W0 /O1 /Ob2 /Oi /Os /Oy /MP /GL /MT /GS /guard:cf")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /W0 /O1 /Ob2 /Oi /Os /Oy /MP /GL /MT /GS /guard:cf")
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /W0 /Ob1 /Ot /Zi /MP /MT")
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /W0 /Ob1 /Ot /Zi /MP /MT")
|
||||
else()
|
||||
|
||||
Vendored
+1
-1
Submodule external/src/cppzmq updated: 6164cf7dbc...a371495a91
Vendored
+1
-1
Submodule external/src/curl updated: 7eb8c04847...d644f86242
Vendored
+1
-1
Submodule external/src/grpc updated: 70cfb88491...e22a758b13
Vendored
+1
-1
Submodule external/src/libuv updated: 7984398deb...bf762bb18b
Vendored
+1
-1
Submodule external/src/libzmq updated: c2fae81460...8a20bd6132
Vendored
+1
-1
Submodule external/src/miniupnp updated: a2eda5c4db...014e459b8e
Vendored
+1
-1
Submodule external/src/rapidjson updated: 5eb4b2335a...43a1db7dba
+9
-4
@@ -19,6 +19,7 @@
|
||||
#include "block_cache.h"
|
||||
#include "pool_block.h"
|
||||
#include "p2p_server.h"
|
||||
#include "side_chain.h"
|
||||
|
||||
LOG_CATEGORY(BlockCache)
|
||||
|
||||
@@ -35,9 +36,11 @@ struct BlockCache::Impl : public nocopy_nomove
|
||||
|
||||
Impl()
|
||||
{
|
||||
m_fd = open(cache_name, O_RDWR | O_CREAT, static_cast<mode_t>(0600));
|
||||
const std::string cache_path = DATA_DIR + cache_name;
|
||||
|
||||
m_fd = open(cache_path.c_str(), O_RDWR | O_CREAT, static_cast<mode_t>(0600));
|
||||
if (m_fd == -1) {
|
||||
LOGERR(1, "couldn't open/create " << cache_name);
|
||||
LOGERR(1, "couldn't open/create " << cache_path << ": error " << errno);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -86,11 +89,12 @@ struct BlockCache::Impl : public nocopy_nomove
|
||||
#elif defined(_WIN32)
|
||||
|
||||
Impl()
|
||||
: m_file(CreateFile(cache_name, GENERIC_ALL, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_HIDDEN, NULL))
|
||||
: m_cachePath(DATA_DIR + cache_name)
|
||||
, m_file(CreateFile(m_cachePath.c_str(), GENERIC_ALL, FILE_SHARE_READ, NULL, OPEN_ALWAYS, FILE_ATTRIBUTE_HIDDEN, NULL))
|
||||
, m_map(0)
|
||||
{
|
||||
if (m_file == INVALID_HANDLE_VALUE) {
|
||||
LOGERR(1, "couldn't open " << cache_name << ", error " << static_cast<uint32_t>(GetLastError()));
|
||||
LOGERR(1, "couldn't open " << m_cachePath << ": error " << static_cast<uint32_t>(GetLastError()));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -141,6 +145,7 @@ struct BlockCache::Impl : public nocopy_nomove
|
||||
}
|
||||
}
|
||||
|
||||
std::string m_cachePath;
|
||||
HANDLE m_file;
|
||||
HANDLE m_map;
|
||||
|
||||
|
||||
@@ -209,7 +209,7 @@ static void do_status(p2pool *m_pool, const char * /* args */)
|
||||
|
||||
m_pool->print_merge_mining_status();
|
||||
|
||||
bkg_jobs_tracker.print_status();
|
||||
bkg_jobs_tracker->print_status();
|
||||
|
||||
if (p2p) {
|
||||
p2p->check_for_updates(true);
|
||||
@@ -313,7 +313,7 @@ static void do_stop_mining(p2pool* m_pool, const char* /*args*/)
|
||||
|
||||
static void do_exit(p2pool *m_pool, const char * /* args */)
|
||||
{
|
||||
bkg_jobs_tracker.wait();
|
||||
bkg_jobs_tracker->wait();
|
||||
m_pool->stop();
|
||||
}
|
||||
|
||||
@@ -358,7 +358,7 @@ void ConsoleCommands::stdinReadCallback(uv_stream_t* stream, ssize_t nread, cons
|
||||
}
|
||||
|
||||
|
||||
void ConsoleCommands::process_input(std::string& command, char* data, uint32_t size)
|
||||
void ConsoleCommands::process_input(std::string& command, const char* data, uint32_t size)
|
||||
{
|
||||
command.append(data, size);
|
||||
|
||||
|
||||
@@ -40,7 +40,7 @@ public:
|
||||
size_t size() const override { return sizeof(ConsoleClient); }
|
||||
|
||||
bool on_connect() override { return true; };
|
||||
bool on_read(char* data, uint32_t size) override { static_cast<ConsoleCommands*>(m_owner)->process_input(m_command, data, size); return true; };
|
||||
bool on_read(const char* data, uint32_t size) override { static_cast<ConsoleCommands*>(m_owner)->process_input(m_command, data, size); return true; };
|
||||
|
||||
char m_consoleReadBuf[1024] = {};
|
||||
|
||||
@@ -66,7 +66,7 @@ private:
|
||||
static void allocCallback(uv_handle_t* handle, size_t suggested_size, uv_buf_t* buf);
|
||||
static void stdinReadCallback(uv_stream_t* stream, ssize_t nread, const uv_buf_t* buf);
|
||||
|
||||
void process_input(std::string& command, char* data, uint32_t size);
|
||||
void process_input(std::string& command, const char* data, uint32_t size);
|
||||
};
|
||||
|
||||
} // namespace p2pool
|
||||
|
||||
+16
-9
@@ -37,9 +37,7 @@ class RandomBytes
|
||||
public:
|
||||
RandomBytes() : rng(RandomDeviceSeed::instance), dist(0, 255)
|
||||
{
|
||||
if (uv_mutex_init(&m) != 0) {
|
||||
abort();
|
||||
}
|
||||
uv_mutex_init_checked(&m);
|
||||
|
||||
// Diffuse the initial state in case it has low quality
|
||||
rng.discard(10000);
|
||||
@@ -66,7 +64,7 @@ private:
|
||||
std::uniform_int_distribution<> dist;
|
||||
};
|
||||
|
||||
static RandomBytes randomBytes;
|
||||
static RandomBytes* randomBytes = nullptr;
|
||||
|
||||
}
|
||||
|
||||
@@ -86,7 +84,7 @@ static FORCEINLINE bool less32(const uint8_t* k0, const uint8_t* k1)
|
||||
void generate_keys(hash& pub, hash& sec)
|
||||
{
|
||||
do {
|
||||
do { randomBytes(sec.h); } while (!less32(sec.h, limit));
|
||||
do { (*randomBytes)(sec.h); } while (!less32(sec.h, limit));
|
||||
sc_reduce32(sec.h);
|
||||
} while (!sc_isnonzero(sec.h));
|
||||
|
||||
@@ -153,8 +151,7 @@ static FORCEINLINE void derivation_to_scalar(const hash& derivation, size_t outp
|
||||
uint8_t* p = buf.output_index;
|
||||
writeVarint(output_index, [&p](uint8_t b) { *(p++) = b; });
|
||||
|
||||
const uint8_t* data = buf.derivation;
|
||||
hash_to_scalar(data, static_cast<int>(p - data), res);
|
||||
hash_to_scalar(buf.derivation, static_cast<int>(sizeof(buf.derivation) + (p - buf.output_index)), res);
|
||||
}
|
||||
|
||||
class Cache : public nocopy_nomove
|
||||
@@ -472,6 +469,10 @@ void derive_view_tag(const hash& derivation, size_t output_index, uint8_t& view_
|
||||
|
||||
void init_crypto_cache()
|
||||
{
|
||||
if (!randomBytes) {
|
||||
randomBytes = new RandomBytes();
|
||||
}
|
||||
|
||||
if (!cache) {
|
||||
cache = new Cache();
|
||||
}
|
||||
@@ -479,9 +480,15 @@ void init_crypto_cache()
|
||||
|
||||
void destroy_crypto_cache()
|
||||
{
|
||||
if (cache) {
|
||||
delete cache;
|
||||
{
|
||||
auto p = randomBytes;
|
||||
randomBytes = nullptr;
|
||||
delete p;
|
||||
}
|
||||
{
|
||||
auto p = cache;
|
||||
cache = nullptr;
|
||||
delete p;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace JSONRPCRequest {
|
||||
|
||||
struct CurlContext
|
||||
{
|
||||
CurlContext(const std::string& address, int port, const std::string& req, const std::string& auth, const std::string& proxy, CallbackBase* cb, CallbackBase* close_cb, uv_loop_t* loop);
|
||||
CurlContext(const std::string& address, int port, const std::string& req, const std::string& auth, const std::string& proxy, bool ssl, const std::string& ssl_fingerprint, CallbackBase* cb, CallbackBase* close_cb, uv_loop_t* loop);
|
||||
~CurlContext();
|
||||
|
||||
static int socket_func(CURL* easy, curl_socket_t s, int action, void* userp, void* socketp)
|
||||
@@ -82,7 +82,7 @@ struct CurlContext
|
||||
uint64_t m_connectedTime;
|
||||
};
|
||||
|
||||
CurlContext::CurlContext(const std::string& address, int port, const std::string& req, const std::string& auth, const std::string& proxy, CallbackBase* cb, CallbackBase* close_cb, uv_loop_t* loop)
|
||||
CurlContext::CurlContext(const std::string& address, int port, const std::string& req, const std::string& auth, const std::string& proxy, bool ssl, const std::string& ssl_fingerprint, CallbackBase* cb, CallbackBase* close_cb, uv_loop_t* loop)
|
||||
: m_callback(cb)
|
||||
, m_closeCallback(close_cb)
|
||||
, m_loop(loop)
|
||||
@@ -100,8 +100,19 @@ CurlContext::CurlContext(const std::string& address, int port, const std::string
|
||||
char buf[log::Stream::BUF_SIZE + 1];
|
||||
buf[0] = '\0';
|
||||
|
||||
const char* protocol = "http://";
|
||||
|
||||
#ifdef WITH_TLS
|
||||
if (ssl) {
|
||||
protocol = "https://";
|
||||
}
|
||||
#else
|
||||
(void)ssl;
|
||||
(void)ssl_fingerprint;
|
||||
#endif
|
||||
|
||||
log::Stream s(buf);
|
||||
s << "http://" << address << ':' << port;
|
||||
s << protocol << address << ':' << port;
|
||||
|
||||
if (!m_req.empty() && (m_req.front() == '/')) {
|
||||
s << m_req.c_str() << '\0';
|
||||
@@ -200,9 +211,23 @@ CurlContext::CurlContext(const std::string& address, int port, const std::string
|
||||
}
|
||||
}
|
||||
|
||||
#ifdef WITH_TLS
|
||||
curl_easy_setopt_checked(m_handle, CURLOPT_SSL_VERIFYPEER, 0L);
|
||||
curl_easy_setopt_checked(m_handle, CURLOPT_SSL_VERIFYHOST, 0L);
|
||||
|
||||
if (!ssl_fingerprint.empty()) {
|
||||
char buf[64] = {};
|
||||
|
||||
log::Stream s(buf);
|
||||
s << "sha256//" << ssl_fingerprint;
|
||||
|
||||
curl_easy_setopt_checked(m_handle, CURLOPT_PINNEDPUBLICKEY, buf);
|
||||
}
|
||||
#endif
|
||||
|
||||
CURLMcode curl_err = curl_multi_add_handle(m_multiHandle, m_handle);
|
||||
if (curl_err != CURLM_OK) {
|
||||
LOGERR(1, "curl_multi_add_handle failed, error " << curl_multi_strerror(curl_err));
|
||||
LOGERR(1, "curl_multi_add_handle failed: " << curl_multi_strerror(curl_err));
|
||||
curl_easy_cleanup(m_handle);
|
||||
curl_multi_cleanup(m_multiHandle);
|
||||
uv_close(reinterpret_cast<uv_handle_t*>(&m_timer), nullptr);
|
||||
@@ -336,7 +361,7 @@ void CurlContext::on_timeout(uv_handle_t* req)
|
||||
int running_handles = 0;
|
||||
const CURLMcode err = curl_multi_socket_action(ctx->m_multiHandle, CURL_SOCKET_TIMEOUT, 0, &running_handles);
|
||||
if (err != CURLM_OK) {
|
||||
LOGERR(1, "curl_multi_socket_action failed, error " << curl_multi_strerror(err));
|
||||
LOGERR(1, "curl_multi_socket_action failed: " << curl_multi_strerror(err));
|
||||
}
|
||||
|
||||
ctx->check_multi_info();
|
||||
@@ -382,7 +407,7 @@ void CurlContext::curl_perform(uv_poll_t* req, int status, int events)
|
||||
if (it != ctx->m_pollHandles.end()) {
|
||||
const CURLMcode err = curl_multi_socket_action(ctx->m_multiHandle, it->first, flags, &running_handles);
|
||||
if (err != CURLM_OK) {
|
||||
LOGERR(1, "curl_multi_socket_action failed, error " << curl_multi_strerror(err));
|
||||
LOGERR(1, "curl_multi_socket_action failed: " << curl_multi_strerror(err));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -449,7 +474,7 @@ void CurlContext::shutdown()
|
||||
}
|
||||
}
|
||||
|
||||
void Call(const std::string& address, int port, const std::string& req, const std::string& auth, const std::string& proxy, CallbackBase* cb, CallbackBase* close_cb, uv_loop_t* loop)
|
||||
void Call(const std::string& address, int port, const std::string& req, const std::string& auth, const std::string& proxy, bool ssl, const std::string& ssl_fingerprint, CallbackBase* cb, CallbackBase* close_cb, uv_loop_t* loop)
|
||||
{
|
||||
if (!loop) {
|
||||
loop = uv_default_loop();
|
||||
@@ -459,7 +484,7 @@ void Call(const std::string& address, int port, const std::string& req, const st
|
||||
[=]()
|
||||
{
|
||||
try {
|
||||
new CurlContext(address, port, req, auth, proxy, cb, close_cb, loop);
|
||||
new CurlContext(address, port, req, auth, proxy, ssl, ssl_fingerprint, cb, close_cb, loop);
|
||||
}
|
||||
catch (const std::exception& e) {
|
||||
const char* msg = e.what();
|
||||
|
||||
@@ -22,15 +22,15 @@ namespace JSONRPCRequest {
|
||||
|
||||
typedef Callback<void, const char*, size_t, double>::Base CallbackBase;
|
||||
|
||||
void Call(const std::string& address, int port, const std::string& req, const std::string& auth, const std::string& proxy, CallbackBase* cb, CallbackBase* close_cb, uv_loop_t* loop);
|
||||
void Call(const std::string& address, int port, const std::string& req, const std::string& auth, const std::string& proxy, bool ssl, const std::string& ssl_fingerprint, CallbackBase* cb, CallbackBase* close_cb, uv_loop_t* loop);
|
||||
|
||||
template<typename T, typename U>
|
||||
FORCEINLINE void call(const std::string& address, int port, const std::string& req, const std::string& auth, const std::string& proxy, T&& cb, U&& close_cb, uv_loop_t* loop = nullptr)
|
||||
FORCEINLINE void call(const std::string& address, int port, const std::string& req, const std::string& auth, const std::string& proxy, bool ssl, const std::string& ssl_fingerprint, T&& cb, U&& close_cb, uv_loop_t* loop = nullptr)
|
||||
{
|
||||
typedef Callback<void, const char*, size_t, double>::Derived<T> CallbackT;
|
||||
typedef Callback<void, const char*, size_t, double>::Derived<U> CallbackU;
|
||||
|
||||
Call(address, port, req, auth, proxy, new CallbackT(std::move(cb)), new CallbackU(std::move(close_cb)), loop);
|
||||
Call(address, port, req, auth, proxy, ssl, ssl_fingerprint, new CallbackT(std::move(cb)), new CallbackU(std::move(close_cb)), loop);
|
||||
}
|
||||
|
||||
} // namespace JSONRPCRequest
|
||||
|
||||
+5
-8
@@ -116,17 +116,14 @@ NOINLINE void keccakf_plain(std::array<uint64_t, 25>& st)
|
||||
}
|
||||
}
|
||||
|
||||
void (*keccakf)(std::array<uint64_t, 25>&) = keccakf_plain;
|
||||
|
||||
keccakf_func keccakf = []() {
|
||||
#if defined(__x86_64__) || defined(_M_AMD64)
|
||||
static struct KeccakBMI_Check {
|
||||
KeccakBMI_Check() {
|
||||
if (randomx::Cpu().hasBmi()) {
|
||||
keccakf = keccakf_bmi;
|
||||
}
|
||||
if (randomx::Cpu().hasBmi()) {
|
||||
return keccakf_bmi;
|
||||
}
|
||||
} keccak_bmi_check;
|
||||
#endif
|
||||
return keccakf_plain;
|
||||
}();
|
||||
|
||||
NOINLINE void keccak_step(const uint8_t* &in, int &inlen, std::array<uint64_t, 25>& st)
|
||||
{
|
||||
|
||||
+3
-1
@@ -25,7 +25,9 @@ enum KeccakParams {
|
||||
};
|
||||
|
||||
extern const uint64_t keccakf_rndc[24];
|
||||
extern void (*keccakf)(std::array<uint64_t, 25>& st);
|
||||
|
||||
typedef void (*keccakf_func)(std::array<uint64_t, 25>&);
|
||||
extern keccakf_func keccakf;
|
||||
|
||||
void keccakf_plain(std::array<uint64_t, 25>& st);
|
||||
void keccakf_bmi(std::array<uint64_t, 25>& st);
|
||||
|
||||
+35
-42
@@ -117,38 +117,28 @@ public:
|
||||
FORCEINLINE Worker()
|
||||
: m_writePos(0)
|
||||
, m_readPos(0)
|
||||
, m_started{ false }
|
||||
, m_stopped(false)
|
||||
{
|
||||
#if defined(_WIN32) && defined(_MSC_VER) && !defined(NDEBUG)
|
||||
SetUnhandledExceptionFilter(UnhandledExceptionFilter);
|
||||
SymInitialize(GetCurrentProcess(), NULL, TRUE);
|
||||
#endif
|
||||
|
||||
set_main_thread();
|
||||
|
||||
std::setlocale(LC_ALL, "en_001");
|
||||
|
||||
m_logFile.open(log_file_name, std::ios::app | std::ios::binary);
|
||||
m_logFilePath = DATA_DIR + log_file_name;
|
||||
m_logFile.open(m_logFilePath, std::ios::app | std::ios::binary);
|
||||
|
||||
if (!m_logFile.is_open()) {
|
||||
fprintf(stderr, "failed to open %s: error %d\n", m_logFilePath.c_str(), errno);
|
||||
}
|
||||
|
||||
m_buf.resize(BUF_SIZE);
|
||||
|
||||
// Create default loop here
|
||||
uv_default_loop();
|
||||
|
||||
uv_cond_init(&m_cond);
|
||||
uv_mutex_init(&m_mutex);
|
||||
|
||||
const int err = uv_thread_create(&m_worker, run_wrapper, this);
|
||||
if (err) {
|
||||
fprintf(stderr, "failed to start logger thread (%s), aborting\n", uv_err_name(err));
|
||||
abort();
|
||||
}
|
||||
|
||||
while (m_started.load() == false) {
|
||||
std::this_thread::yield();
|
||||
}
|
||||
|
||||
#ifdef _WIN32
|
||||
SetConsoleMode(hStdIn, ENABLE_ECHO_INPUT | ENABLE_LINE_INPUT | ENABLE_PROCESSED_INPUT | ENABLE_EXTENDED_FLAGS);
|
||||
|
||||
@@ -163,13 +153,13 @@ public:
|
||||
CONSOLE_COLORS = false;
|
||||
}
|
||||
|
||||
LOGINFO(0, "started");
|
||||
|
||||
if (!m_logFile.is_open()) {
|
||||
LOGERR(0, "failed to open " << log_file_name);
|
||||
}
|
||||
|
||||
init_uv_threadpool();
|
||||
|
||||
const int err = uv_thread_create(&m_worker, run_wrapper, this);
|
||||
if (err) {
|
||||
fprintf(stderr, "failed to start logger thread (%s), aborting\n", uv_err_name(err));
|
||||
abort();
|
||||
}
|
||||
}
|
||||
|
||||
~Worker()
|
||||
@@ -196,17 +186,8 @@ public:
|
||||
uv_thread_join(&m_worker);
|
||||
uv_cond_destroy(&m_cond);
|
||||
uv_mutex_destroy(&m_mutex);
|
||||
uv_loop_close(uv_default_loop());
|
||||
|
||||
#if ((UV_VERSION_MAJOR > 1) || ((UV_VERSION_MAJOR == 1) && (UV_VERSION_MINOR >= 38)))
|
||||
uv_library_shutdown();
|
||||
#endif
|
||||
|
||||
m_logFile.close();
|
||||
|
||||
#if defined(_WIN32) && defined(_MSC_VER) && !defined(NDEBUG)
|
||||
SymCleanup(GetCurrentProcess());
|
||||
#endif
|
||||
}
|
||||
|
||||
FORCEINLINE void write(const char* buf, uint32_t size)
|
||||
@@ -236,6 +217,8 @@ public:
|
||||
uv_cond_signal(&m_cond);
|
||||
}
|
||||
|
||||
const std::string& log_file_path() const { return m_logFilePath; }
|
||||
|
||||
private:
|
||||
static void init_uv_threadpool()
|
||||
{
|
||||
@@ -252,13 +235,13 @@ private:
|
||||
int err = putenv(buf);
|
||||
if (err != 0) {
|
||||
err = errno;
|
||||
LOGWARN(0, "Couldn't set UV thread pool size to " << N << " threads, putenv returned error " << err);
|
||||
fprintf(stderr, "Couldn't set UV thread pool size to %u threads, putenv returned error %d\n", N, err);
|
||||
}
|
||||
|
||||
static uv_work_t dummy;
|
||||
err = uv_queue_work(uv_default_loop_checked(), &dummy, [](uv_work_t*) {}, nullptr);
|
||||
if (err) {
|
||||
LOGERR(0, "init_uv_threadpool: uv_queue_work failed, error " << uv_err_name(err));
|
||||
fprintf(stderr, "init_uv_threadpool: uv_queue_work failed, error %s\n", uv_err_name(err));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -267,8 +250,6 @@ private:
|
||||
|
||||
NOINLINE void run()
|
||||
{
|
||||
m_started.exchange(true);
|
||||
|
||||
do {
|
||||
uv_mutex_lock(&m_mutex);
|
||||
if (m_readPos == m_writePos.load()) {
|
||||
@@ -346,9 +327,9 @@ private:
|
||||
|
||||
// Reopen the log file if it's been moved (logrotate support)
|
||||
struct stat buf;
|
||||
if (stat(log_file_name, &buf) != 0) {
|
||||
if (stat(m_logFilePath.c_str(), &buf) != 0) {
|
||||
m_logFile.close();
|
||||
m_logFile.open(log_file_name, std::ios::app | std::ios::binary);
|
||||
m_logFile.open(m_logFilePath, std::ios::app | std::ios::binary);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -392,13 +373,13 @@ private:
|
||||
uv_mutex_t m_mutex;
|
||||
uv_thread_t m_worker;
|
||||
|
||||
std::atomic<bool> m_started;
|
||||
bool m_stopped;
|
||||
|
||||
std::ofstream m_logFile;
|
||||
std::string m_logFilePath;
|
||||
};
|
||||
|
||||
static Worker worker;
|
||||
static Worker* worker = nullptr;
|
||||
|
||||
#endif // P2POOL_LOG_DISABLE
|
||||
|
||||
@@ -445,20 +426,32 @@ NOINLINE Writer::~Writer()
|
||||
m_buf[2] = static_cast<uint8_t>(size >> 8);
|
||||
m_buf[m_pos] = '\n';
|
||||
#ifndef P2POOL_LOG_DISABLE
|
||||
worker.write(m_buf, size);
|
||||
worker->write(m_buf, size);
|
||||
#endif
|
||||
}
|
||||
|
||||
void start()
|
||||
{
|
||||
#ifndef P2POOL_LOG_DISABLE
|
||||
worker = new Worker();
|
||||
|
||||
LOGINFO(0, "started");
|
||||
#endif
|
||||
}
|
||||
|
||||
void reopen()
|
||||
{
|
||||
// This will trigger the worker thread which will then reopen log file if it's been moved
|
||||
LOGINFO(0, "reopening " << log_file_name);
|
||||
#ifndef P2POOL_LOG_DISABLE
|
||||
LOGINFO(0, "reopening " << worker->log_file_path());
|
||||
#endif
|
||||
}
|
||||
|
||||
void stop()
|
||||
{
|
||||
#ifndef P2POOL_LOG_DISABLE
|
||||
worker.stop();
|
||||
delete worker;
|
||||
worker = nullptr;
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -506,8 +506,8 @@ struct DummyStream
|
||||
}
|
||||
};
|
||||
|
||||
#ifdef __COVERITY__
|
||||
// Coverity doesn't like this macro - CID 393138: Big parameter passed by value (PASS_BY_VALUE)
|
||||
#if defined(__COVERITY__) || defined(__cppcheck__)
|
||||
// Coverity and cppcheck don't like this macro - CID 393138: Big parameter passed by value (PASS_BY_VALUE)
|
||||
#define SIDE_EFFECT_CHECK(level, ...)
|
||||
#else
|
||||
#define SIDE_EFFECT_CHECK(level, ...) \
|
||||
@@ -547,6 +547,7 @@ struct DummyStream
|
||||
|
||||
#endif
|
||||
|
||||
void start();
|
||||
void reopen();
|
||||
void stop();
|
||||
|
||||
|
||||
+86
-32
@@ -21,53 +21,66 @@
|
||||
#include "stratum_server.h"
|
||||
#include "p2p_server.h"
|
||||
#include <curl/curl.h>
|
||||
#include <filesystem>
|
||||
|
||||
#ifdef WITH_RANDOMX
|
||||
#include "randomx.h"
|
||||
#endif
|
||||
|
||||
#if defined(_WIN32) && defined(_MSC_VER) && !defined(NDEBUG)
|
||||
|
||||
#include <DbgHelp.h>
|
||||
|
||||
#pragma comment(lib, "Dbghelp.lib")
|
||||
|
||||
#endif
|
||||
|
||||
void p2pool_usage()
|
||||
{
|
||||
printf("P2Pool %s\n"
|
||||
"\nUsage:\n\n" \
|
||||
"--wallet Wallet address to mine to. Subaddresses and integrated addresses are not supported!\n"
|
||||
"--host IP address of your Monero node, default is 127.0.0.1\n"
|
||||
"--rpc-port monerod RPC API port number, default is 18081\n"
|
||||
"--zmq-port monerod ZMQ pub port number, default is 18083 (same port as in monerod's \"--zmq-pub\" command line parameter)\n"
|
||||
"--stratum Comma-separated list of IP:port for stratum server to listen on\n"
|
||||
"--p2p Comma-separated list of IP:port for p2p server to listen on\n"
|
||||
"--addpeers Comma-separated list of IP:port of other p2pool nodes to connect to\n"
|
||||
"--light-mode Don't allocate RandomX dataset, saves 2GB of RAM\n"
|
||||
"--loglevel Verbosity of the log, integer number between 0 and %d\n"
|
||||
"--config Name of the p2pool config file\n"
|
||||
"--data-api Path to the p2pool JSON data (use it in tandem with an external web-server)\n"
|
||||
"--local-api Enable /local/ path in api path for Stratum Server and built-in miner statistics\n"
|
||||
"--stratum-api An alias for --local-api\n"
|
||||
"--no-cache Disable p2pool.cache\n"
|
||||
"--no-color Disable colors in console output\n"
|
||||
"--wallet Wallet address to mine to. Subaddresses and integrated addresses are not supported!\n"
|
||||
"--host IP address of your Monero node, default is 127.0.0.1\n"
|
||||
"--rpc-port monerod RPC API port number, default is 18081\n"
|
||||
"--zmq-port monerod ZMQ pub port number, default is 18083 (same port as in monerod's \"--zmq-pub\" command line parameter)\n"
|
||||
"--stratum Comma-separated list of IP:port for stratum server to listen on\n"
|
||||
"--p2p Comma-separated list of IP:port for p2p server to listen on\n"
|
||||
"--addpeers Comma-separated list of IP:port of other p2pool nodes to connect to\n"
|
||||
"--light-mode Don't allocate RandomX dataset, saves 2GB of RAM\n"
|
||||
"--loglevel Verbosity of the log, integer number between 0 and %d\n"
|
||||
"--data-dir Path to store general p2pool files (log, cache, peer data, etc.), default is current directory\n"
|
||||
"--sidechain-config Name of the p2pool sidechain parameters file (only use it if you run your own sidechain)\n"
|
||||
"--data-api Path to the p2pool JSON data (use it in tandem with an external web-server). Not affected by --data-dir setting!\n"
|
||||
"--local-api Enable /local/ path in api path for Stratum Server and built-in miner statistics\n"
|
||||
"--stratum-api An alias for --local-api\n"
|
||||
"--no-cache Disable p2pool.cache\n"
|
||||
"--no-color Disable colors in console output\n"
|
||||
#ifdef WITH_RANDOMX
|
||||
"--no-randomx Disable internal RandomX hasher: p2pool will use RPC calls to monerod to check PoW hashes\n"
|
||||
"--no-randomx Disable internal RandomX hasher: p2pool will use RPC calls to monerod to check PoW hashes\n"
|
||||
#endif
|
||||
"--out-peers N Maximum number of outgoing connections for p2p server (any value between 10 and 450)\n"
|
||||
"--in-peers N Maximum number of incoming connections for p2p server (any value between 10 and 450)\n"
|
||||
"--start-mining N Start built-in miner using N threads (any value between 1 and 64)\n"
|
||||
"--mini Connect to p2pool-mini sidechain. Note that it will also change default p2p port from %d to %d\n"
|
||||
"--no-autodiff Disable automatic difficulty adjustment for miners connected to stratum (WARNING: incompatible with Nicehash and MRR)\n"
|
||||
"--rpc-login Specify username[:password] required for Monero RPC server\n"
|
||||
"--socks5 Specify IP:port of a SOCKS5 proxy to use for outgoing connections\n"
|
||||
"--no-dns Disable DNS queries, use only IP addresses to connect to peers (seed node DNS will be unavailable too)\n"
|
||||
"--p2p-external-port Port number that your router uses for mapping to your local p2p port. Use it if you are behind a NAT and still want to accept incoming connections\n"
|
||||
"--out-peers N Maximum number of outgoing connections for p2p server (any value between 10 and 450)\n"
|
||||
"--in-peers N Maximum number of incoming connections for p2p server (any value between 10 and 450)\n"
|
||||
"--start-mining N Start built-in miner using N threads (any value between 1 and 64)\n"
|
||||
"--mini Connect to p2pool-mini sidechain. Note that it will also change default p2p port from %d to %d\n"
|
||||
"--no-autodiff Disable automatic difficulty adjustment for miners connected to stratum (WARNING: incompatible with Nicehash and MRR)\n"
|
||||
"--rpc-login Specify username[:password] required for Monero RPC server\n"
|
||||
"--socks5 Specify IP:port of a SOCKS5 proxy to use for outgoing connections\n"
|
||||
"--no-dns Disable DNS queries, use only IP addresses to connect to peers (seed node DNS will be unavailable too)\n"
|
||||
"--p2p-external-port Port number that your router uses for mapping to your local p2p port. Use it if you are behind a NAT and still want to accept incoming connections\n"
|
||||
#ifdef WITH_UPNP
|
||||
"--no-upnp Disable UPnP port forwarding\n"
|
||||
"--no-igd An alias for --no-upnp\n"
|
||||
"--upnp-stratum Port forward Stratum port (it's not forwarded by default)\n"
|
||||
"--no-upnp Disable UPnP port forwarding\n"
|
||||
"--no-igd An alias for --no-upnp\n"
|
||||
"--upnp-stratum Port forward Stratum port (it's not forwarded by default)\n"
|
||||
#endif
|
||||
"--merge-mine IP:port and wallet address for another blockchain to merge mine with\n"
|
||||
"--version Print p2pool's version and build details\n"
|
||||
"--merge-mine IP:port and wallet address for another blockchain to merge mine with\n"
|
||||
"--version Print p2pool's version and build details\n"
|
||||
#ifdef WITH_TLS
|
||||
"--tls-cert file Load TLS certificate chain from \"file\" in the PEM format\n"
|
||||
"--tls-cert-key file Load TLS certificate private key from \"file\" in the PEM format\n"
|
||||
"--tls-cert file Load TLS certificate chain from \"file\" in the PEM format\n"
|
||||
"--tls-cert-key file Load TLS certificate private key from \"file\" in the PEM format\n"
|
||||
"--rpc-ssl Enable SSL on RPC connections to the Monero node\n"
|
||||
"--rpc-ssl-fingerprint base64-encoded fingerprint of the Monero node's certificate (optional, use it for certificate pinning)\n"
|
||||
#endif
|
||||
"--no-stratum-http Disable HTTP on Stratum ports\n"
|
||||
"--help Show this help message\n\n"
|
||||
"Example command line:\n\n"
|
||||
"%s --host 127.0.0.1 --rpc-port 18081 --zmq-port 18083 --wallet YOUR_WALLET_ADDRESS --stratum 0.0.0.0:%d --p2p 0.0.0.0:%d\n\n",
|
||||
@@ -186,10 +199,39 @@ int main(int argc, char* argv[])
|
||||
if (!strcmp(argv[i], "--test")) {
|
||||
return p2pool_test();
|
||||
}
|
||||
|
||||
if ((strcmp(argv[i], "--data-dir") == 0) && (i + 1 < argc)) {
|
||||
std::string path = argv[++i];
|
||||
|
||||
if (!path.empty() && (path.back() != '/')
|
||||
#ifdef _WIN32
|
||||
&& (path.back() != '\\')
|
||||
#endif
|
||||
) {
|
||||
path.append(1, '/');
|
||||
}
|
||||
|
||||
p2pool::DATA_DIR = std::move(path);
|
||||
|
||||
// Try to create it if it doesn't exist
|
||||
if (!p2pool::DATA_DIR.empty()) {
|
||||
std::error_code err;
|
||||
std::filesystem::create_directories(p2pool::DATA_DIR, err);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#if defined(_WIN32) && defined(_MSC_VER) && !defined(NDEBUG)
|
||||
SymInitialize(GetCurrentProcess(), NULL, TRUE);
|
||||
#endif
|
||||
|
||||
memory_tracking_start();
|
||||
|
||||
// Create default loop here
|
||||
uv_default_loop();
|
||||
|
||||
p2pool::log::start();
|
||||
|
||||
p2pool::init_crypto_cache();
|
||||
|
||||
int result = static_cast<int>(curl_global_init_mem(CURL_GLOBAL_ALL, p2pool::malloc_hook, p2pool::free_hook, p2pool::realloc_hook, p2pool::strdup_hook, p2pool::calloc_hook));
|
||||
@@ -209,9 +251,21 @@ int main(int argc, char* argv[])
|
||||
|
||||
p2pool::destroy_crypto_cache();
|
||||
|
||||
p2pool::log::stop();
|
||||
|
||||
uv_loop_close(uv_default_loop());
|
||||
|
||||
#if ((UV_VERSION_MAJOR > 1) || ((UV_VERSION_MAJOR == 1) && (UV_VERSION_MINOR >= 38)))
|
||||
uv_library_shutdown();
|
||||
#endif
|
||||
|
||||
if (!memory_tracking_stop()) {
|
||||
result = 1;
|
||||
}
|
||||
|
||||
#if defined(_WIN32) && defined(_MSC_VER) && !defined(NDEBUG)
|
||||
SymCleanup(GetCurrentProcess());
|
||||
#endif
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -24,6 +24,8 @@
|
||||
#include <atomic>
|
||||
#include <type_traits>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <mutex>
|
||||
|
||||
#include <DbgHelp.h>
|
||||
|
||||
@@ -79,7 +81,7 @@ struct TrackedAllocation
|
||||
|
||||
static_assert(sizeof(TrackedAllocation) == 256, "");
|
||||
|
||||
uv_mutex_t allocation_lock;
|
||||
std::mutex allocation_lock;
|
||||
std::hash<void*> hasher;
|
||||
uint32_t first[N];
|
||||
uint32_t next[N];
|
||||
@@ -98,7 +100,7 @@ void show_top_10_allocations()
|
||||
const HANDLE h = GetCurrentProcess();
|
||||
|
||||
{
|
||||
p2pool::MutexLock lock(allocation_lock);
|
||||
std::lock_guard<std::mutex> lock(allocation_lock);
|
||||
|
||||
TrackedAllocation* end = buf;
|
||||
for (size_t i = 0; i < N; ++i) {
|
||||
@@ -173,7 +175,7 @@ FORCEINLINE static void add_alocation(void* p, size_t size)
|
||||
|
||||
const size_t index = hasher(p) & (N - 1);
|
||||
|
||||
p2pool::MutexLock lock(allocation_lock);
|
||||
std::lock_guard<std::mutex> lock(allocation_lock);
|
||||
|
||||
++num_allocations;
|
||||
if (num_allocations >= N / 2) {
|
||||
@@ -204,7 +206,7 @@ FORCEINLINE static void remove_allocation(void* p)
|
||||
return;
|
||||
}
|
||||
|
||||
p2pool::MutexLock lock(allocation_lock);
|
||||
std::lock_guard<std::mutex> lock(allocation_lock);
|
||||
|
||||
--num_allocations;
|
||||
|
||||
@@ -292,10 +294,14 @@ void memory_tracking_start()
|
||||
// Trigger std::ostream initialization to avoid reporting it as leaks
|
||||
std::cout << "Memory leak detection = " << 1 << std::endl;
|
||||
|
||||
// Trigger std::ofstream initialization to avoid reporting it as leaks
|
||||
{
|
||||
std::ofstream tmp("memory_tracking.tmp");
|
||||
}
|
||||
|
||||
using namespace p2pool;
|
||||
|
||||
uv_replace_allocator(malloc_hook, realloc_hook, calloc_hook, free_hook);
|
||||
uv_mutex_init_checked(&allocation_lock);
|
||||
track_memory = true;
|
||||
}
|
||||
|
||||
@@ -304,7 +310,6 @@ bool memory_tracking_stop()
|
||||
using namespace p2pool;
|
||||
|
||||
track_memory = false;
|
||||
uv_mutex_destroy(&allocation_lock);
|
||||
|
||||
const HANDLE h = GetCurrentProcess();
|
||||
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
|
||||
#include "common.h"
|
||||
#include "mempool.h"
|
||||
#include "util.h"
|
||||
|
||||
LOG_CATEGORY(Mempool)
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
#include "params.h"
|
||||
#include "json_rpc_request.h"
|
||||
#include "json_parsers.h"
|
||||
#include <rapidjson/document.h>
|
||||
#include "rapidjson_wrapper.h"
|
||||
|
||||
LOG_CATEGORY(MergeMiningClientJSON_RPC)
|
||||
|
||||
@@ -112,7 +112,7 @@ void MergeMiningClientJSON_RPC::merge_mining_get_chain_id()
|
||||
{
|
||||
const std::string req = "{\"jsonrpc\":\"2.0\",\"id\":\"0\",\"method\":\"merge_mining_get_chain_id\"}";
|
||||
|
||||
JSONRPCRequest::call(m_host, m_port, req, std::string(), m_pool->params().m_socks5Proxy,
|
||||
JSONRPCRequest::call(m_host, m_port, req, std::string(), m_pool->params().m_socks5Proxy, false, std::string(),
|
||||
[this](const char* data, size_t size, double ping) {
|
||||
WriteLock lock(m_lock);
|
||||
|
||||
@@ -201,7 +201,7 @@ void MergeMiningClientJSON_RPC::merge_mining_get_aux_block(uint64_t height, cons
|
||||
<< ",\"prev_id\":\"" << prev_id << '"'
|
||||
<< "}}";
|
||||
|
||||
JSONRPCRequest::call(m_host, m_port, std::string(buf, s.m_pos), std::string(), m_pool->params().m_socks5Proxy,
|
||||
JSONRPCRequest::call(m_host, m_port, std::string(buf, s.m_pos), std::string(), m_pool->params().m_socks5Proxy, false, std::string(),
|
||||
[this](const char* data, size_t size, double) {
|
||||
bool changed = false;
|
||||
hash chain_id;
|
||||
@@ -301,7 +301,7 @@ void MergeMiningClientJSON_RPC::submit_solution(const BlockTemplate* /*block_tpl
|
||||
<< ",\"merkle_proof\":[";
|
||||
|
||||
for (size_t i = 0, n = merkle_proof.size(); i < n; ++i) {
|
||||
if (i > 0) {
|
||||
if (i != 0) {
|
||||
s << ',';
|
||||
}
|
||||
s << '"' << merkle_proof[i] << '"';
|
||||
@@ -310,7 +310,7 @@ void MergeMiningClientJSON_RPC::submit_solution(const BlockTemplate* /*block_tpl
|
||||
s << "],\"path\":" << merkle_proof_path
|
||||
<< ",\"seed_hash\":\"" << seed_hash << "\"}}";
|
||||
|
||||
JSONRPCRequest::call(m_host, m_port, std::string(buf.data(), s.m_pos), std::string(), m_pool->params().m_socks5Proxy,
|
||||
JSONRPCRequest::call(m_host, m_port, std::string(buf.data(), s.m_pos), std::string(), m_pool->params().m_socks5Proxy, false, std::string(),
|
||||
[this](const char* data, size_t size, double) {
|
||||
parse_merge_mining_submit_solution(data, size);
|
||||
},
|
||||
|
||||
@@ -574,7 +574,7 @@ bool MergeMiningClientTari::TariClient::on_connect()
|
||||
return true;
|
||||
}
|
||||
|
||||
bool MergeMiningClientTari::TariClient::on_read(char* data, uint32_t size)
|
||||
bool MergeMiningClientTari::TariClient::on_read(const char* data, uint32_t size)
|
||||
{
|
||||
MergeMiningClientTari::TariServer* server = static_cast<MergeMiningClientTari::TariServer*>(m_owner);
|
||||
if (!server) {
|
||||
|
||||
@@ -98,7 +98,7 @@ private:
|
||||
|
||||
void reset() override;
|
||||
[[nodiscard]] bool on_connect() override;
|
||||
[[nodiscard]] bool on_read(char* data, uint32_t size) override;
|
||||
[[nodiscard]] bool on_read(const char* data, uint32_t size) override;
|
||||
|
||||
char m_buf[BUF_SIZE];
|
||||
std::vector<uint8_t> m_pendingData;
|
||||
|
||||
+13
-11
@@ -28,7 +28,7 @@
|
||||
#include "block_template.h"
|
||||
#include "p2pool_api.h"
|
||||
#include "stratum_server.h"
|
||||
#include <rapidjson/document.h>
|
||||
#include "rapidjson_wrapper.h"
|
||||
#include <fstream>
|
||||
#include <numeric>
|
||||
|
||||
@@ -447,10 +447,12 @@ void P2PServer::save_peer_list_async()
|
||||
|
||||
void P2PServer::save_peer_list()
|
||||
{
|
||||
std::ofstream f(saved_peer_list_file_name, std::ios::binary);
|
||||
const std::string path = DATA_DIR + saved_peer_list_file_name;
|
||||
|
||||
std::ofstream f(path, std::ios::binary);
|
||||
|
||||
if (!f.is_open()) {
|
||||
LOGERR(1, "failed to save peer list " << saved_peer_list_file_name << ", error " << errno);
|
||||
LOGERR(1, "failed to save peer list " << path << ": error " << errno);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -579,7 +581,9 @@ void P2PServer::load_peer_list()
|
||||
}
|
||||
|
||||
// Finally load peers from p2pool_peers.txt
|
||||
std::ifstream f(saved_peer_list_file_name);
|
||||
const std::string path = DATA_DIR + saved_peer_list_file_name;
|
||||
|
||||
std::ifstream f(path);
|
||||
if (f.is_open()) {
|
||||
std::string address;
|
||||
while (f.good()) {
|
||||
@@ -634,7 +638,7 @@ void P2PServer::load_monerod_peer_list()
|
||||
{
|
||||
const Params::Host& host = m_pool->current_host();
|
||||
|
||||
JSONRPCRequest::call(host.m_address, host.m_rpcPort, "/get_peer_list", host.m_rpcLogin, m_socks5Proxy,
|
||||
JSONRPCRequest::call(host.m_address, host.m_rpcPort, "/get_peer_list", host.m_rpcLogin, m_socks5Proxy, host.m_rpcSSL, host.m_rpcSSL_Fingerprint,
|
||||
[this](const char* data, size_t size, double)
|
||||
{
|
||||
#define ERR_STR "/get_peer_list RPC request returned invalid JSON "
|
||||
@@ -1421,7 +1425,7 @@ void P2PServer::api_update_local_stats()
|
||||
}
|
||||
}
|
||||
|
||||
s << "],\"uptime\":" << cur_time - m_pool->start_time() << '}';
|
||||
s << "],\"uptime\":" << cur_time - m_pool->start_time() << ",\"zmq_last_active\":" << (seconds_since_epoch() - m_pool->zmq_last_active()) << '}';
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1496,7 +1500,7 @@ bool P2PServer::P2PClient::on_connect()
|
||||
return send_handshake_challenge();
|
||||
}
|
||||
|
||||
bool P2PServer::P2PClient::on_read(char* data, uint32_t size)
|
||||
bool P2PServer::P2PClient::on_read(const char* data, uint32_t size)
|
||||
{
|
||||
P2PServer* server = static_cast<P2PServer*>(m_owner);
|
||||
if (!server) {
|
||||
@@ -1940,11 +1944,9 @@ void P2PServer::P2PClient::send_handshake_solution(const uint8_t (&challenge)[CH
|
||||
}
|
||||
}
|
||||
|
||||
bool P2PServer::P2PClient::check_handshake_solution(const hash& solution, const uint8_t (&solution_salt)[CHALLENGE_SIZE])
|
||||
bool P2PServer::P2PClient::check_handshake_solution(const hash& solution, const uint8_t (&solution_salt)[CHALLENGE_SIZE]) const
|
||||
{
|
||||
P2PServer* owner = static_cast<P2PServer*>(m_owner);
|
||||
|
||||
const std::vector<uint8_t>& consensus_id = owner->m_pool->side_chain().consensus_id();
|
||||
const std::vector<uint8_t>& consensus_id = static_cast<const P2PServer*>(m_owner)->m_pool->side_chain().consensus_id();
|
||||
const int consensus_id_size = static_cast<int>(consensus_id.size());
|
||||
|
||||
uint8_t challenge[CHALLENGE_SIZE];
|
||||
|
||||
+3
-3
@@ -79,7 +79,7 @@ public:
|
||||
|
||||
void reset() override;
|
||||
[[nodiscard]] bool on_connect() override;
|
||||
[[nodiscard]] bool on_read(char* data, uint32_t size) override;
|
||||
[[nodiscard]] bool on_read(const char* data, uint32_t size) override;
|
||||
void on_read_failed(int err) override;
|
||||
void on_disconnected() override;
|
||||
|
||||
@@ -101,7 +101,7 @@ public:
|
||||
|
||||
[[nodiscard]] bool send_handshake_challenge();
|
||||
void send_handshake_solution(const uint8_t (&challenge)[CHALLENGE_SIZE]);
|
||||
[[nodiscard]] bool check_handshake_solution(const hash& solution, const uint8_t (&solution_salt)[CHALLENGE_SIZE]);
|
||||
[[nodiscard]] bool check_handshake_solution(const hash& solution, const uint8_t (&solution_salt)[CHALLENGE_SIZE]) const;
|
||||
|
||||
[[nodiscard]] bool on_handshake_challenge(const uint8_t* buf);
|
||||
[[nodiscard]] bool on_handshake_solution(const uint8_t* buf);
|
||||
@@ -115,7 +115,7 @@ public:
|
||||
void on_block_notify(const uint8_t* buf);
|
||||
|
||||
[[nodiscard]] bool handle_incoming_block_async(const PoolBlock* block, uint64_t max_time_delta = 0);
|
||||
void handle_incoming_block(p2pool* pool, PoolBlock& block, std::vector<hash>& missing_blocks, bool& result);
|
||||
static void handle_incoming_block(p2pool* pool, PoolBlock& block, std::vector<hash>& missing_blocks, bool& result);
|
||||
void post_handle_incoming_block(p2pool* pool, const PoolBlock& block, const uint32_t reset_counter, bool is_v6, const raw_ip& addr, std::vector<hash>& missing_blocks, const bool result);
|
||||
|
||||
[[nodiscard]] bool is_good() const { return m_handshakeComplete && !m_handshakeInvalid && (m_listenPort >= 0); }
|
||||
|
||||
+59
-26
@@ -20,7 +20,7 @@
|
||||
#include "zmq_reader.h"
|
||||
#include "mempool.h"
|
||||
#include "json_rpc_request.h"
|
||||
#include "rapidjson/document.h"
|
||||
#include "rapidjson_wrapper.h"
|
||||
#include "json_parsers.h"
|
||||
#include "pow_hash.h"
|
||||
#include "block_template.h"
|
||||
@@ -73,6 +73,8 @@ p2pool::p2pool(int argc, char* argv[])
|
||||
|
||||
m_params = p;
|
||||
|
||||
bkg_jobs_tracker = new BackgroundJobTracker();
|
||||
|
||||
#ifdef WITH_UPNP
|
||||
if (p->m_upnp) {
|
||||
init_upnp();
|
||||
@@ -184,6 +186,8 @@ p2pool::p2pool(int argc, char* argv[])
|
||||
m_hasher = new RandomX_Hasher_RPC(this);
|
||||
#endif
|
||||
|
||||
PoolBlock::s_precalculatedSharesLock = new ReadWriteLock();
|
||||
|
||||
m_blockTemplate = new BlockTemplate(m_sideChain, m_hasher);
|
||||
m_mempool = new Mempool();
|
||||
|
||||
@@ -232,6 +236,17 @@ p2pool::~p2pool()
|
||||
delete m_blockTemplate;
|
||||
delete m_mempool;
|
||||
delete m_params;
|
||||
|
||||
{
|
||||
auto p = bkg_jobs_tracker;
|
||||
bkg_jobs_tracker = nullptr;
|
||||
delete p;
|
||||
}
|
||||
{
|
||||
auto p = PoolBlock::s_precalculatedSharesLock;
|
||||
PoolBlock::s_precalculatedSharesLock = nullptr;
|
||||
delete p;
|
||||
}
|
||||
}
|
||||
|
||||
void p2pool::update_host_ping(const std::string& display_name, double ping)
|
||||
@@ -421,24 +436,41 @@ void p2pool::handle_miner_data(MinerData& data)
|
||||
|
||||
if (m_serversStarted.load()) {
|
||||
std::vector<uint64_t> missing_heights;
|
||||
|
||||
auto check_height = [this, &missing_heights](uint64_t h) {
|
||||
auto it = m_mainchainByHeight.find(h);
|
||||
if ((it == m_mainchainByHeight.end()) || it->second.difficulty.empty()) {
|
||||
missing_heights.push_back(h);
|
||||
}
|
||||
};
|
||||
|
||||
{
|
||||
WriteLock lock(m_mainchainLock);
|
||||
ReadLock lock(m_mainchainLock);
|
||||
|
||||
for (uint64_t h = data.height; h && (h + BLOCK_HEADERS_REQUIRED > data.height); --h) {
|
||||
auto it = m_mainchainByHeight.find(h);
|
||||
if ((it == m_mainchainByHeight.end()) || it->second.difficulty.empty()) {
|
||||
LOGWARN(3, "Mainchain data for height " << h << " is missing, requesting it from monerod again");
|
||||
missing_heights.push_back(h);
|
||||
}
|
||||
check_height(h);
|
||||
}
|
||||
|
||||
const uint64_t seed_height = get_seed_height(data.height);
|
||||
const uint64_t prev_seed_height = (seed_height > SEEDHASH_EPOCH_BLOCKS) ? (seed_height - SEEDHASH_EPOCH_BLOCKS) : 0;
|
||||
|
||||
check_height(seed_height);
|
||||
check_height(prev_seed_height);
|
||||
}
|
||||
|
||||
if (missing_heights.size() > 1) {
|
||||
std::sort(missing_heights.begin(), missing_heights.end(), std::greater<uint64_t>());
|
||||
missing_heights.erase(std::unique(missing_heights.begin(), missing_heights.end()), missing_heights.end());
|
||||
}
|
||||
|
||||
for (uint64_t h : missing_heights) {
|
||||
LOGWARN(3, "Mainchain data for height " << h << " is missing, requesting it from monerod again");
|
||||
|
||||
char buf[log::Stream::BUF_SIZE + 1] = {};
|
||||
log::Stream s(buf);
|
||||
s << "{\"jsonrpc\":\"2.0\",\"id\":\"0\",\"method\":\"get_block_header_by_height\",\"params\":{\"height\":" << h << "}}\0";
|
||||
|
||||
JSONRPCRequest::call(host.m_address, host.m_rpcPort, buf, host.m_rpcLogin, m_params->m_socks5Proxy,
|
||||
JSONRPCRequest::call(host.m_address, host.m_rpcPort, buf, host.m_rpcLogin, m_params->m_socks5Proxy, host.m_rpcSSL, host.m_rpcSSL_Fingerprint,
|
||||
[this, h](const char* data, size_t size, double)
|
||||
{
|
||||
ChainMain block;
|
||||
@@ -550,12 +582,12 @@ void p2pool::update_aux_data(const hash& chain_id)
|
||||
|
||||
aux_id.reserve(m_mergeMiningClients.size() + 1);
|
||||
|
||||
IMergeMiningClient::ChainParameters params;
|
||||
IMergeMiningClient::ChainParameters chain_params;
|
||||
|
||||
for (const IMergeMiningClient* c : m_mergeMiningClients) {
|
||||
if (c->get_params(params)) {
|
||||
data.aux_chains.emplace_back(params.aux_id, params.aux_hash, params.aux_diff);
|
||||
aux_id.emplace_back(params.aux_id);
|
||||
if (c->get_params(chain_params)) {
|
||||
data.aux_chains.emplace_back(chain_params.aux_id, chain_params.aux_hash, chain_params.aux_diff);
|
||||
aux_id.emplace_back(chain_params.aux_id);
|
||||
}
|
||||
}
|
||||
aux_id.emplace_back(m_sideChain->consensus_hash());
|
||||
@@ -842,7 +874,7 @@ void p2pool::submit_block() const
|
||||
|
||||
const Params::Host& host = current_host();
|
||||
|
||||
JSONRPCRequest::call(host.m_address, host.m_rpcPort, request, host.m_rpcLogin, m_params->m_socks5Proxy,
|
||||
JSONRPCRequest::call(host.m_address, host.m_rpcPort, request, host.m_rpcLogin, m_params->m_socks5Proxy, host.m_rpcSSL, host.m_rpcSSL_Fingerprint,
|
||||
[height, diff, template_id, nonce, extra_nonce, merge_mining_root, is_external](const char* data, size_t size, double)
|
||||
{
|
||||
rapidjson::Document doc;
|
||||
@@ -961,7 +993,7 @@ void p2pool::download_block_headers(uint64_t current_height)
|
||||
s.m_pos = 0;
|
||||
s << "{\"jsonrpc\":\"2.0\",\"id\":\"0\",\"method\":\"get_block_header_by_height\",\"params\":{\"height\":" << height << "}}\0";
|
||||
|
||||
JSONRPCRequest::call(host.m_address, host.m_rpcPort, buf, host.m_rpcLogin, m_params->m_socks5Proxy,
|
||||
JSONRPCRequest::call(host.m_address, host.m_rpcPort, buf, host.m_rpcLogin, m_params->m_socks5Proxy, host.m_rpcSSL, host.m_rpcSSL_Fingerprint,
|
||||
[this, prev_seed_height, height](const char* data, size_t size, double)
|
||||
{
|
||||
ChainMain block;
|
||||
@@ -990,7 +1022,7 @@ void p2pool::download_block_headers(uint64_t current_height)
|
||||
s.m_pos = 0;
|
||||
s << "{\"jsonrpc\":\"2.0\",\"id\":\"0\",\"method\":\"get_block_headers_range\",\"params\":{\"start_height\":" << start_height << ",\"end_height\":" << current_height - 1 << "}}\0";
|
||||
|
||||
JSONRPCRequest::call(host.m_address, host.m_rpcPort, buf, host.m_rpcLogin, m_params->m_socks5Proxy,
|
||||
JSONRPCRequest::call(host.m_address, host.m_rpcPort, buf, host.m_rpcLogin, m_params->m_socks5Proxy, host.m_rpcSSL, host.m_rpcSSL_Fingerprint,
|
||||
[this, start_height, current_height, host](const char* data, size_t size, double)
|
||||
{
|
||||
if (parse_block_headers_range(data, size) == current_height - start_height) {
|
||||
@@ -1023,7 +1055,7 @@ void p2pool::download_block_headers(uint64_t current_height)
|
||||
for (const Params::Host& h : m_params->m_hosts) {
|
||||
const std::string& name = h.m_displayName;
|
||||
if (name != host.m_displayName) {
|
||||
JSONRPCRequest::call(h.m_address, h.m_rpcPort, "{\"jsonrpc\":\"2.0\",\"id\":\"0\",\"method\":\"get_version\"}", h.m_rpcLogin, m_params->m_socks5Proxy,
|
||||
JSONRPCRequest::call(h.m_address, h.m_rpcPort, "{\"jsonrpc\":\"2.0\",\"id\":\"0\",\"method\":\"get_version\"}", h.m_rpcLogin, m_params->m_socks5Proxy, host.m_rpcSSL, host.m_rpcSSL_Fingerprint,
|
||||
[this, name](const char*, size_t, double tcp_ping) { update_host_ping(name, tcp_ping); },
|
||||
[](const char*, size_t, double) {});
|
||||
}
|
||||
@@ -1132,7 +1164,7 @@ void p2pool::get_info()
|
||||
{
|
||||
const Params::Host& host = current_host();
|
||||
|
||||
JSONRPCRequest::call(host.m_address, host.m_rpcPort, "{\"jsonrpc\":\"2.0\",\"id\":\"0\",\"method\":\"get_info\"}", host.m_rpcLogin, m_params->m_socks5Proxy,
|
||||
JSONRPCRequest::call(host.m_address, host.m_rpcPort, "{\"jsonrpc\":\"2.0\",\"id\":\"0\",\"method\":\"get_info\"}", host.m_rpcLogin, m_params->m_socks5Proxy, host.m_rpcSSL, host.m_rpcSSL_Fingerprint,
|
||||
[this](const char* data, size_t size, double)
|
||||
{
|
||||
parse_get_info_rpc(data, size);
|
||||
@@ -1140,7 +1172,7 @@ void p2pool::get_info()
|
||||
[this, host](const char* data, size_t size, double)
|
||||
{
|
||||
if (size > 0) {
|
||||
LOGWARN(1, "get_info RPC request to host " << host.m_displayName << " failed: error " << log::const_buf(data, size) << ", trying again in 1 second");
|
||||
LOGWARN(1, "get_info RPC request to host " << host.m_displayName << " failed: " << log::const_buf(data, size) << ", trying again in 1 second");
|
||||
if (!m_stopped) {
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
|
||||
switch_host();
|
||||
@@ -1156,7 +1188,7 @@ void p2pool::load_found_blocks()
|
||||
return;
|
||||
}
|
||||
|
||||
std::ifstream f(FOUND_BLOCKS_FILE);
|
||||
std::ifstream f(DATA_DIR + FOUND_BLOCKS_FILE);
|
||||
if (!f.is_open()) {
|
||||
return;
|
||||
}
|
||||
@@ -1248,7 +1280,7 @@ void p2pool::get_version()
|
||||
{
|
||||
const Params::Host& host = current_host();
|
||||
|
||||
JSONRPCRequest::call(host.m_address, host.m_rpcPort, "{\"jsonrpc\":\"2.0\",\"id\":\"0\",\"method\":\"get_version\"}", host.m_rpcLogin, m_params->m_socks5Proxy,
|
||||
JSONRPCRequest::call(host.m_address, host.m_rpcPort, "{\"jsonrpc\":\"2.0\",\"id\":\"0\",\"method\":\"get_version\"}", host.m_rpcLogin, m_params->m_socks5Proxy, host.m_rpcSSL, host.m_rpcSSL_Fingerprint,
|
||||
[this](const char* data, size_t size, double)
|
||||
{
|
||||
parse_get_version_rpc(data, size);
|
||||
@@ -1256,7 +1288,7 @@ void p2pool::get_version()
|
||||
[this](const char* data, size_t size, double)
|
||||
{
|
||||
if (size > 0) {
|
||||
LOGWARN(1, "get_version RPC request failed: error " << log::const_buf(data, size) << ", trying again in 1 second");
|
||||
LOGWARN(1, "get_version RPC request failed: " << log::const_buf(data, size) << ", trying again in 1 second");
|
||||
if (!m_stopped) {
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
|
||||
get_version();
|
||||
@@ -1325,7 +1357,7 @@ void p2pool::get_miner_data(bool retry)
|
||||
|
||||
const Params::Host& host = current_host();
|
||||
|
||||
JSONRPCRequest::call(host.m_address, host.m_rpcPort, "{\"jsonrpc\":\"2.0\",\"id\":\"0\",\"method\":\"get_miner_data\"}", host.m_rpcLogin, m_params->m_socks5Proxy,
|
||||
JSONRPCRequest::call(host.m_address, host.m_rpcPort, "{\"jsonrpc\":\"2.0\",\"id\":\"0\",\"method\":\"get_miner_data\"}", host.m_rpcLogin, m_params->m_socks5Proxy, host.m_rpcSSL, host.m_rpcSSL_Fingerprint,
|
||||
[this, host](const char* data, size_t size, double tcp_ping)
|
||||
{
|
||||
parse_get_miner_data_rpc(data, size);
|
||||
@@ -1334,7 +1366,7 @@ void p2pool::get_miner_data(bool retry)
|
||||
[this, host, retry](const char* data, size_t size, double)
|
||||
{
|
||||
if (size > 0) {
|
||||
LOGWARN(1, "get_miner_data RPC request to host " << host.m_displayName << " failed: error " << log::const_buf(data, size) << (retry ? ", trying again in 1 second" : ""));
|
||||
LOGWARN(1, "get_miner_data RPC request to host " << host.m_displayName << " failed: " << log::const_buf(data, size) << (retry ? ", trying again in 1 second" : ""));
|
||||
if (!m_stopped && retry) {
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(1000));
|
||||
m_getMinerDataPending = false;
|
||||
@@ -1689,14 +1721,15 @@ void p2pool::api_update_block_found(const ChainMain* data, const PoolBlock* bloc
|
||||
difficulty_type diff;
|
||||
|
||||
if (data && get_difficulty_at_height(data->height, diff)) {
|
||||
std::ofstream f(FOUND_BLOCKS_FILE, std::ios::app);
|
||||
const std::string path = DATA_DIR + FOUND_BLOCKS_FILE;
|
||||
std::ofstream f(path, std::ios::app);
|
||||
if (f.is_open()) {
|
||||
f << cur_time << ' ' << data->height << ' ' << data->id << ' ' << diff << ' ' << total_hashes << '\n';
|
||||
f.flush();
|
||||
f.close();
|
||||
}
|
||||
else {
|
||||
LOGERR(1, "Failed to update " << FOUND_BLOCKS_FILE << ", error " << errno);
|
||||
LOGERR(1, "Failed to update " << path << ": error " << errno);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1938,7 +1971,7 @@ int p2pool::run()
|
||||
|
||||
m_stopped = true;
|
||||
|
||||
bkg_jobs_tracker.wait();
|
||||
bkg_jobs_tracker->wait();
|
||||
|
||||
#ifdef WITH_RANDOMX
|
||||
delete m_miner;
|
||||
|
||||
+37
-3
@@ -95,8 +95,14 @@ Params::Params(int argc, char* const argv[])
|
||||
ok = true;
|
||||
}
|
||||
|
||||
if ((strcmp(argv[i], "--config") == 0) && (i + 1 < argc)) {
|
||||
m_config = argv[++i];
|
||||
if ((strcmp(argv[i], "--data-dir") == 0) && (i + 1 < argc)) {
|
||||
// Processed in main.cpp
|
||||
++i;
|
||||
ok = true;
|
||||
}
|
||||
|
||||
if ((strcmp(argv[i], "--sidechain-config") == 0) && (i + 1 < argc)) {
|
||||
m_sidechainConfig = argv[++i];
|
||||
ok = true;
|
||||
}
|
||||
|
||||
@@ -161,6 +167,26 @@ Params::Params(int argc, char* const argv[])
|
||||
ok = true;
|
||||
}
|
||||
|
||||
#ifdef WITH_TLS
|
||||
if (strcmp(argv[i], "--rpc-ssl") == 0) {
|
||||
if (m_hosts.empty()) {
|
||||
m_hosts.emplace_back(Host());
|
||||
}
|
||||
|
||||
m_hosts.back().m_rpcSSL = true;
|
||||
ok = true;
|
||||
}
|
||||
|
||||
if ((strcmp(argv[i], "--rpc-ssl-fingerprint") == 0) && (i + 1 < argc)) {
|
||||
if (m_hosts.empty()) {
|
||||
m_hosts.emplace_back(Host());
|
||||
}
|
||||
|
||||
m_hosts.back().m_rpcSSL_Fingerprint = argv[++i];
|
||||
ok = true;
|
||||
}
|
||||
#endif
|
||||
|
||||
if ((strcmp(argv[i], "--socks5") == 0) && (i + 1 < argc)) {
|
||||
m_socks5Proxy = argv[++i];
|
||||
ok = true;
|
||||
@@ -207,7 +233,15 @@ Params::Params(int argc, char* const argv[])
|
||||
}
|
||||
#endif
|
||||
|
||||
if (strcmp(argv[i], "--no-stratum-http") == 0) {
|
||||
m_enableStratumHTTP = false;
|
||||
ok = true;
|
||||
}
|
||||
|
||||
if (!ok) {
|
||||
// Wait to avoid log messages overlapping with printf() calls and making a mess on screen
|
||||
std::this_thread::sleep_for(std::chrono::milliseconds(10));
|
||||
|
||||
fprintf(stderr, "Unknown command line parameter %s\n\n", argv[i]);
|
||||
p2pool_usage();
|
||||
throw std::exception();
|
||||
@@ -284,7 +318,7 @@ bool Params::Host::init_display_name(const Params& p)
|
||||
buf[0] = '\0';
|
||||
log::Stream s(buf);
|
||||
|
||||
s << m_displayName << ':' << m_rpcPort << ":ZMQ:" << m_zmqPort;
|
||||
s << m_displayName << (m_rpcSSL ? ":RPC-SSL " : ":RPC ") << m_rpcPort << ":ZMQ " << m_zmqPort;
|
||||
if (m_address != m_displayName) {
|
||||
s << " (" << m_address << ')';
|
||||
}
|
||||
|
||||
+7
-2
@@ -29,13 +29,14 @@ struct Params
|
||||
|
||||
struct Host
|
||||
{
|
||||
Host() : m_address("127.0.0.1"), m_rpcPort(18081), m_zmqPort(18083) {}
|
||||
Host() : m_address("127.0.0.1"), m_rpcPort(18081), m_zmqPort(18083), m_rpcSSL(false) {}
|
||||
|
||||
Host(const char* address, uint32_t rpcPort, uint32_t zmqPort, const char* rpcLogin)
|
||||
: m_address(address)
|
||||
, m_rpcPort(rpcPort)
|
||||
, m_zmqPort(zmqPort)
|
||||
, m_rpcLogin(rpcLogin)
|
||||
, m_rpcSSL(false)
|
||||
{}
|
||||
|
||||
bool valid() const { return !m_address.empty() && m_rpcPort && m_zmqPort && (m_rpcPort != m_zmqPort); }
|
||||
@@ -48,6 +49,9 @@ struct Params
|
||||
|
||||
std::string m_rpcLogin;
|
||||
|
||||
bool m_rpcSSL;
|
||||
std::string m_rpcSSL_Fingerprint;
|
||||
|
||||
std::string m_displayName;
|
||||
};
|
||||
|
||||
@@ -68,7 +72,7 @@ struct Params
|
||||
std::string m_stratumAddresses;
|
||||
std::string m_p2pAddresses;
|
||||
std::string m_p2pPeerList;
|
||||
std::string m_config;
|
||||
std::string m_sidechainConfig;
|
||||
std::string m_apiPath;
|
||||
bool m_localStats = false;
|
||||
bool m_blockCache = true;
|
||||
@@ -96,6 +100,7 @@ struct Params
|
||||
std::string m_tlsCert;
|
||||
std::string m_tlsCertKey;
|
||||
#endif
|
||||
bool m_enableStratumHTTP = true;
|
||||
};
|
||||
|
||||
} // namespace p2pool
|
||||
|
||||
@@ -29,6 +29,8 @@ LOG_CATEGORY(PoolBlock)
|
||||
|
||||
namespace p2pool {
|
||||
|
||||
ReadWriteLock* PoolBlock::s_precalculatedSharesLock = nullptr;
|
||||
|
||||
PoolBlock::PoolBlock()
|
||||
: m_majorVersion(0)
|
||||
, m_minorVersion(0)
|
||||
@@ -115,6 +117,10 @@ PoolBlock& PoolBlock::operator=(const PoolBlock& b)
|
||||
m_broadcasted = b.m_broadcasted;
|
||||
m_wantBroadcast = b.m_wantBroadcast;
|
||||
m_precalculated = b.m_precalculated;
|
||||
{
|
||||
WriteLock lock(*s_precalculatedSharesLock);
|
||||
m_precalculatedShares = b.m_precalculatedShares;
|
||||
}
|
||||
|
||||
m_localTimestamp = seconds_since_epoch();
|
||||
m_receivedTimestamp = b.m_receivedTimestamp;
|
||||
@@ -302,6 +308,11 @@ void PoolBlock::reset_offchain_data()
|
||||
m_wantBroadcast = false;
|
||||
|
||||
m_precalculated = false;
|
||||
{
|
||||
WriteLock lock(*s_precalculatedSharesLock);
|
||||
m_precalculatedShares.clear();
|
||||
m_precalculatedShares.shrink_to_fit();
|
||||
}
|
||||
|
||||
m_localTimestamp = seconds_since_epoch();
|
||||
m_receivedTimestamp = 0;
|
||||
|
||||
@@ -32,6 +32,7 @@ static FORCEINLINE constexpr int pool_block_debug() { return POOL_BLOCK_DEBUG; }
|
||||
|
||||
class RandomX_Hasher_Base;
|
||||
class SideChain;
|
||||
struct MinerShare;
|
||||
|
||||
/*
|
||||
* --------------------------------------------------
|
||||
@@ -161,6 +162,9 @@ struct PoolBlock
|
||||
|
||||
bool m_precalculated;
|
||||
|
||||
static ReadWriteLock* s_precalculatedSharesLock;
|
||||
std::vector<MinerShare> m_precalculatedShares;
|
||||
|
||||
uint64_t m_localTimestamp;
|
||||
uint64_t m_receivedTimestamp;
|
||||
|
||||
|
||||
+2
-2
@@ -26,7 +26,7 @@
|
||||
#endif
|
||||
#include "json_rpc_request.h"
|
||||
#include "json_parsers.h"
|
||||
#include <rapidjson/document.h>
|
||||
#include "rapidjson_wrapper.h"
|
||||
#include <thread>
|
||||
|
||||
LOG_CATEGORY(RandomX_Hasher)
|
||||
@@ -461,7 +461,7 @@ bool RandomX_Hasher_RPC::calculate(const void* data_ptr, size_t size, uint64_t h
|
||||
const Params& params = m_pool->params();
|
||||
const Params::Host& host = m_pool->current_host();
|
||||
|
||||
JSONRPCRequest::call(host.m_address, host.m_rpcPort, buf, host.m_rpcLogin, params.m_socks5Proxy,
|
||||
JSONRPCRequest::call(host.m_address, host.m_rpcPort, buf, host.m_rpcLogin, params.m_socks5Proxy, host.m_rpcSSL, host.m_rpcSSL_Fingerprint,
|
||||
[&result, &h](const char* data, size_t size, double)
|
||||
{
|
||||
rapidjson::Document doc;
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
#if defined(_MSC_VER) && defined(__cppcheck__)
|
||||
// cppcheck chokes on rapidjson headers in Windows
|
||||
#else
|
||||
#include <rapidjson/document.h>
|
||||
#endif
|
||||
+35
-27
@@ -34,8 +34,12 @@
|
||||
#include "json_parsers.h"
|
||||
#include "crypto.h"
|
||||
#include "hardforks/hardforks.h"
|
||||
|
||||
#if !defined(_MSC_VER) || !defined(__cppcheck__)
|
||||
#include <rapidjson/document.h>
|
||||
#include <rapidjson/istreamwrapper.h>
|
||||
#endif
|
||||
|
||||
#include <fstream>
|
||||
#include <iterator>
|
||||
#include <numeric>
|
||||
@@ -80,7 +84,7 @@ SideChain::SideChain(p2pool* pool, NetworkType type, const char* pool_name)
|
||||
|
||||
LOGINFO(1, log::LightCyan() << "network type = " << type);
|
||||
|
||||
if (m_pool && !load_config(m_pool->params().m_config)) {
|
||||
if (m_pool && !load_config(m_pool->params().m_sidechainConfig)) {
|
||||
PANIC_STOP();
|
||||
}
|
||||
|
||||
@@ -507,7 +511,6 @@ void SideChain::cleanup_incoming_blocks()
|
||||
MutexLock lock(m_incomingBlocksLock);
|
||||
|
||||
// Forget seen blocks that were added more than 10 minutes ago
|
||||
hash h;
|
||||
for (auto i = m_incomingBlocks.begin(); i != m_incomingBlocks.end();) {
|
||||
if (cur_time < i->second + 10 * 60) {
|
||||
++i;
|
||||
@@ -1677,7 +1680,13 @@ void SideChain::verify(PoolBlock* block)
|
||||
}
|
||||
|
||||
std::vector<MinerShare> shares;
|
||||
if (!get_shares(block, shares)) {
|
||||
|
||||
if (block->m_precalculated) {
|
||||
WriteLock lock(*PoolBlock::s_precalculatedSharesLock);
|
||||
shares = std::move(block->m_precalculatedShares);
|
||||
}
|
||||
|
||||
if (shares.empty() && !get_shares(block, shares)) {
|
||||
block->m_invalid = true;
|
||||
return;
|
||||
}
|
||||
@@ -2345,10 +2354,13 @@ void SideChain::launch_precalc(const PoolBlock* block)
|
||||
std::vector<MinerShare> shares;
|
||||
if (get_shares(b, shares, nullptr, true)) {
|
||||
b->m_precalculated = true;
|
||||
PrecalcJob* job = new PrecalcJob{ b, std::move(shares) };
|
||||
{
|
||||
WriteLock lock(*PoolBlock::s_precalculatedSharesLock);
|
||||
b->m_precalculatedShares = std::move(shares);
|
||||
}
|
||||
{
|
||||
MutexLock lock2(m_precalcJobsMutex);
|
||||
m_precalcJobs.push_back(job);
|
||||
m_precalcJobs.push_back(b);
|
||||
uv_cond_signal(&m_precalcJobsCond);
|
||||
}
|
||||
}
|
||||
@@ -2358,9 +2370,12 @@ void SideChain::launch_precalc(const PoolBlock* block)
|
||||
|
||||
void SideChain::precalc_worker()
|
||||
{
|
||||
std::vector<std::pair<size_t, const Wallet*>> wallets;
|
||||
wallets.reserve(m_chainWindowSize);
|
||||
|
||||
do {
|
||||
PrecalcJob* job;
|
||||
size_t num_inputs;
|
||||
const PoolBlock* job;
|
||||
|
||||
{
|
||||
MutexLock lock(m_precalcJobsMutex);
|
||||
|
||||
@@ -2381,32 +2396,28 @@ void SideChain::precalc_worker()
|
||||
|
||||
// Filter out duplicate inputs for get_eph_public_key()
|
||||
uint8_t t[HASH_SIZE * 2 + sizeof(size_t)];
|
||||
memcpy(t, job->b->m_txkeySec.h, HASH_SIZE);
|
||||
memcpy(t, job->m_txkeySec.h, HASH_SIZE);
|
||||
|
||||
const size_t n = job->shares.size();
|
||||
num_inputs = n;
|
||||
wallets.clear();
|
||||
|
||||
ReadLock lock2(*PoolBlock::s_precalculatedSharesLock);
|
||||
|
||||
const size_t n = job->m_precalculatedShares.size();
|
||||
|
||||
for (size_t i = 0; i < n; ++i) {
|
||||
memcpy(t + HASH_SIZE, job->shares[i].m_wallet->view_public_key().h, HASH_SIZE);
|
||||
memcpy(t + HASH_SIZE, job->m_precalculatedShares[i].m_wallet->view_public_key().h, HASH_SIZE);
|
||||
memcpy(t + HASH_SIZE * 2, &i, sizeof(i));
|
||||
if (!m_uniquePrecalcInputs->insert(robin_hood::hash_bytes(t, array_size(t))).second) {
|
||||
job->shares[i].m_wallet = nullptr;
|
||||
--num_inputs;
|
||||
if (m_uniquePrecalcInputs->insert(robin_hood::hash_bytes(t, array_size(t))).second) {
|
||||
wallets.emplace_back(i, job->m_precalculatedShares[i].m_wallet);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (num_inputs) {
|
||||
for (size_t i = 0, n = job->shares.size(); i < n; ++i) {
|
||||
if (job->shares[i].m_wallet) {
|
||||
hash eph_public_key;
|
||||
uint8_t view_tag;
|
||||
job->shares[i].m_wallet->get_eph_public_key(job->b->m_txkeySec, i, eph_public_key, view_tag);
|
||||
}
|
||||
}
|
||||
for (const std::pair<size_t, const Wallet*>& w : wallets) {
|
||||
hash eph_public_key;
|
||||
uint8_t view_tag;
|
||||
w.second->get_eph_public_key(job->m_txkeySec, w.first, eph_public_key, view_tag);
|
||||
}
|
||||
|
||||
delete job;
|
||||
} while (true);
|
||||
}
|
||||
|
||||
@@ -2420,9 +2431,6 @@ void SideChain::finish_precalc()
|
||||
{
|
||||
{
|
||||
MutexLock lock(m_precalcJobsMutex);
|
||||
for (PrecalcJob* job : m_precalcJobs) {
|
||||
delete job;
|
||||
}
|
||||
m_precalcJobs.clear();
|
||||
m_precalcJobs.shrink_to_fit();
|
||||
uv_cond_broadcast(&m_precalcJobsCond);
|
||||
|
||||
+1
-7
@@ -147,16 +147,10 @@ private:
|
||||
ChainMain m_watchBlock;
|
||||
hash m_watchBlockMerkleRoot;
|
||||
|
||||
struct PrecalcJob
|
||||
{
|
||||
const PoolBlock* b;
|
||||
std::vector<MinerShare> shares;
|
||||
};
|
||||
|
||||
uv_cond_t m_precalcJobsCond;
|
||||
uv_mutex_t m_precalcJobsMutex;
|
||||
|
||||
std::vector<PrecalcJob*> m_precalcJobs;
|
||||
std::vector<const PoolBlock*> m_precalcJobs;
|
||||
std::vector<std::thread> m_precalcWorkers;
|
||||
unordered_set<size_t>* m_uniquePrecalcInputs;
|
||||
|
||||
|
||||
+55
-33
@@ -24,6 +24,8 @@
|
||||
#include "p2pool_api.h"
|
||||
#include "p2p_server.h"
|
||||
|
||||
#include "rapidjson_wrapper.h"
|
||||
|
||||
LOG_CATEGORY(StratumServer)
|
||||
|
||||
static constexpr int DEFAULT_BACKLOG = 128;
|
||||
@@ -54,11 +56,13 @@ StratumServer::StratumServer(p2pool* pool)
|
||||
, m_hashrateDataTail_1h(0)
|
||||
, m_hashrateDataTail_24h(0)
|
||||
, m_cumulativeFoundSharesDiff(0.0)
|
||||
, m_totalFoundShares(0)
|
||||
, m_totalFailedShares(0)
|
||||
, m_totalFoundSidechainShares(0)
|
||||
, m_totalFailedSidechainShares(0)
|
||||
, m_totalStratumShares(0)
|
||||
, m_apiLastUpdateTime(0)
|
||||
{
|
||||
m_callbackBuf.resize(STRATUM_BUF_SIZE);
|
||||
// Need a bigger buffer for the TLS handshake
|
||||
m_callbackBuf.resize(STRATUM_CALLBACK_BUF_SIZE);
|
||||
|
||||
// Diffuse the initial state in case it has low quality
|
||||
m_rng.discard(10000);
|
||||
@@ -572,13 +576,13 @@ void StratumServer::show_workers()
|
||||
}
|
||||
|
||||
#ifdef WITH_TLS
|
||||
const bool is_tls = c->m_tls.is_empty();
|
||||
const bool is_tls = !c->m_tls.is_empty();
|
||||
#else
|
||||
constexpr bool is_tls = false;
|
||||
#endif
|
||||
|
||||
LOGINFO(0, log::pad_right(static_cast<const char*>(c->m_addrString), addr_len + 8)
|
||||
<< (is_tls ? "no " : "yes ")
|
||||
<< (is_tls ? "yes " : "no ")
|
||||
<< log::pad_right(log::Duration(cur_time - c->m_connectedTime), 20)
|
||||
<< log::pad_right(diff, 20)
|
||||
<< log::pad_right(log::Hashrate(c->m_autoDiff.lo / AUTO_DIFF_TARGET_TIME, m_autoDiff && (c->m_autoDiff != 0)), 15)
|
||||
@@ -595,8 +599,13 @@ void StratumServer::reset_share_counters()
|
||||
WriteLock lock(m_hashrateDataLock);
|
||||
|
||||
m_cumulativeHashesAtLastShare = m_cumulativeHashes;
|
||||
m_totalFoundShares = 0;
|
||||
m_totalFailedShares = 0;
|
||||
m_totalFoundSidechainShares = 0;
|
||||
m_totalFailedSidechainShares = 0;
|
||||
}
|
||||
|
||||
bool StratumServer::http_enabled() const
|
||||
{
|
||||
return m_pool->params().m_enableStratumHTTP;
|
||||
}
|
||||
|
||||
const char* StratumServer::get_log_category() const
|
||||
@@ -611,7 +620,8 @@ void StratumServer::print_stratum_status() const
|
||||
|
||||
uint64_t hashes_since_last_share;
|
||||
double average_effort;
|
||||
uint32_t shares_found, shares_failed;
|
||||
uint32_t sidechain_shares_found, sidechain_shares_failed;
|
||||
uint64_t total_stratum_shares;
|
||||
|
||||
{
|
||||
ReadLock lock(m_hashrateDataLock);
|
||||
@@ -640,8 +650,9 @@ void StratumServer::print_stratum_status() const
|
||||
average_effort = static_cast<double>(m_cumulativeHashesAtLastShare) * 100.0 / diff;
|
||||
}
|
||||
|
||||
shares_found = m_totalFoundShares;
|
||||
shares_failed = m_totalFailedShares;
|
||||
sidechain_shares_found = m_totalFoundSidechainShares;
|
||||
sidechain_shares_failed = m_totalFailedSidechainShares;
|
||||
total_stratum_shares = m_totalStratumShares;
|
||||
}
|
||||
|
||||
const uint64_t hashrate_15m = (dt_15m > 0) ? (hashes_15m / dt_15m) : 0;
|
||||
@@ -649,20 +660,21 @@ void StratumServer::print_stratum_status() const
|
||||
const uint64_t hashrate_24h = (dt_24h > 0) ? (hashes_24h / dt_24h) : 0;
|
||||
|
||||
char shares_failed_buf[64] = {};
|
||||
if (shares_failed) {
|
||||
if (sidechain_shares_failed) {
|
||||
log::Stream s(shares_failed_buf);
|
||||
s << log::Yellow() << "\nShares failed = " << shares_failed << log::NoColor();
|
||||
s << log::Yellow() << "\nP2Pool shares failed = " << sidechain_shares_failed << log::NoColor();
|
||||
}
|
||||
|
||||
LOGINFO(0, "status" <<
|
||||
"\nHashrate (15m est) = " << log::Hashrate(hashrate_15m) <<
|
||||
"\nHashrate (1h est) = " << log::Hashrate(hashrate_1h) <<
|
||||
"\nHashrate (24h est) = " << log::Hashrate(hashrate_24h) <<
|
||||
"\nTotal hashes = " << total_hashes <<
|
||||
"\nShares found = " << shares_found << static_cast<const char*>(shares_failed_buf) <<
|
||||
"\nAverage effort = " << average_effort << '%' <<
|
||||
"\nCurrent effort = " << static_cast<double>(hashes_since_last_share) * 100.0 / m_pool->side_chain().difficulty().to_double() << '%' <<
|
||||
"\nConnections = " << m_numConnections.load() << " (" << m_numIncomingConnections.load() << " incoming)"
|
||||
"\nHashrate (15m est) = " << log::Hashrate(hashrate_15m) <<
|
||||
"\nHashrate (1h est) = " << log::Hashrate(hashrate_1h) <<
|
||||
"\nHashrate (24h est) = " << log::Hashrate(hashrate_24h) <<
|
||||
"\nStratum hashes = " << total_hashes <<
|
||||
"\nStratum shares = " << total_stratum_shares <<
|
||||
"\nP2Pool shares found = " << sidechain_shares_found << static_cast<const char*>(shares_failed_buf) <<
|
||||
"\nAverage effort = " << average_effort << '%' <<
|
||||
"\nCurrent effort = " << static_cast<double>(hashes_since_last_share) * 100.0 / m_pool->side_chain().difficulty().to_double() << '%' <<
|
||||
"\nConnections = " << m_numConnections.load() << " (" << m_numIncomingConnections.load() << " incoming)"
|
||||
);
|
||||
}
|
||||
|
||||
@@ -876,7 +888,10 @@ void StratumServer::update_hashrate_data(uint64_t hashes, uint64_t timestamp)
|
||||
|
||||
WriteLock lock(m_hashrateDataLock);
|
||||
|
||||
m_cumulativeHashes += hashes;
|
||||
if (hashes) {
|
||||
m_cumulativeHashes += hashes;
|
||||
++m_totalStratumShares;
|
||||
}
|
||||
|
||||
HashrateData* data = m_hashrateData;
|
||||
HashrateData& head = data[m_hashrateDataHead];
|
||||
@@ -978,15 +993,15 @@ void StratumServer::on_share_found(uv_work_t* req)
|
||||
server->m_cumulativeHashesAtLastShare = n;
|
||||
|
||||
server->m_cumulativeFoundSharesDiff += diff;
|
||||
++server->m_totalFoundShares;
|
||||
++server->m_totalFoundSidechainShares;
|
||||
}
|
||||
|
||||
if (!pool->submit_sidechain_block(share->m_templateId, share->m_nonce, share->m_extraNonce)) {
|
||||
WriteLock lock(server->m_hashrateDataLock);
|
||||
|
||||
if (server->m_totalFoundShares > 0) {
|
||||
--server->m_totalFoundShares;
|
||||
++server->m_totalFailedShares;
|
||||
if (server->m_totalFoundSidechainShares > 0) {
|
||||
--server->m_totalFoundSidechainShares;
|
||||
++server->m_totalFailedSidechainShares;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1135,6 +1150,7 @@ StratumServer::StratumClient::StratumClient()
|
||||
, m_lastJobTarget(0)
|
||||
, m_score(0)
|
||||
{
|
||||
m_rawReadBuf[0] = '\0';
|
||||
m_stratumReadBuf[0] = '\0';
|
||||
}
|
||||
|
||||
@@ -1170,7 +1186,7 @@ bool StratumServer::StratumClient::on_connect()
|
||||
return true;
|
||||
}
|
||||
|
||||
bool StratumServer::StratumClient::on_read(char* data, uint32_t size)
|
||||
bool StratumServer::StratumClient::on_read(const char* data, uint32_t size)
|
||||
{
|
||||
#ifdef WITH_TLS
|
||||
if (!m_tlsChecked) {
|
||||
@@ -1185,7 +1201,7 @@ bool StratumServer::StratumClient::on_read(char* data, uint32_t size)
|
||||
}
|
||||
#endif
|
||||
|
||||
auto on_parse = [this](char* data, uint32_t size) {
|
||||
auto on_parse = [this](const char* data, uint32_t size) {
|
||||
if (static_cast<size_t>(m_stratumReadBufBytes) + size > STRATUM_BUF_SIZE) {
|
||||
LOGWARN(4, "client " << static_cast<const char*>(m_addrString) << " sent too long Stratum message");
|
||||
ban(DEFAULT_BAN_TIME);
|
||||
@@ -1196,10 +1212,11 @@ bool StratumServer::StratumClient::on_read(char* data, uint32_t size)
|
||||
m_stratumReadBufBytes += size;
|
||||
|
||||
char* line_start = m_stratumReadBuf;
|
||||
for (char *e = line_start + m_stratumReadBufBytes, *c = e - size; c < e; ++c) {
|
||||
const char* e = line_start + m_stratumReadBufBytes;
|
||||
for (char *c = line_start + m_stratumReadBufBytes - size; c < e; ++c) {
|
||||
if (*c == '\n') {
|
||||
// Check if the line starts with "GET " or "HEAD" (an HTTP request)
|
||||
if (c - line_start >= 4) {
|
||||
if (static_cast<StratumServer*>(m_owner)->http_enabled() && (c - line_start >= 4)) {
|
||||
const uint32_t line_start_data = read_unaligned(reinterpret_cast<uint32_t*>(line_start));
|
||||
|
||||
const bool is_http_get = (line_start_data == 0x20544547U);
|
||||
@@ -1308,7 +1325,8 @@ bool StratumServer::StratumClient::process_request(char* data, uint32_t size)
|
||||
return false;
|
||||
}
|
||||
|
||||
bool StratumServer::StratumClient::process_login(rapidjson::Document& doc, uint32_t id)
|
||||
template<typename T>
|
||||
bool StratumServer::StratumClient::process_login(T& doc, uint32_t id)
|
||||
{
|
||||
const auto params_it = doc.FindMember("params");
|
||||
if (params_it == doc.MemberEnd()) {
|
||||
@@ -1337,7 +1355,8 @@ bool StratumServer::StratumClient::process_login(rapidjson::Document& doc, uint3
|
||||
return static_cast<StratumServer*>(m_owner)->on_login(this, id, login.GetString());
|
||||
}
|
||||
|
||||
bool StratumServer::StratumClient::process_submit(rapidjson::Document& doc, uint32_t id)
|
||||
template<typename T>
|
||||
bool StratumServer::StratumClient::process_submit(T& doc, uint32_t id)
|
||||
{
|
||||
const auto params_it = doc.FindMember("params");
|
||||
if (params_it == doc.MemberEnd()) {
|
||||
@@ -1455,6 +1474,7 @@ void StratumServer::api_update_local_stats(uint64_t timestamp)
|
||||
uint64_t hashes_since_last_share;
|
||||
double average_effort;
|
||||
uint32_t shares_found, shares_failed;
|
||||
uint64_t total_stratum_shares;
|
||||
|
||||
{
|
||||
ReadLock lock(m_hashrateDataLock);
|
||||
@@ -1483,8 +1503,9 @@ void StratumServer::api_update_local_stats(uint64_t timestamp)
|
||||
average_effort = static_cast<double>(m_cumulativeHashesAtLastShare) * 100.0 / diff;
|
||||
}
|
||||
|
||||
shares_found = m_totalFoundShares;
|
||||
shares_failed = m_totalFailedShares;
|
||||
shares_found = m_totalFoundSidechainShares;
|
||||
shares_failed = m_totalFailedSidechainShares;
|
||||
total_stratum_shares = m_totalStratumShares;
|
||||
}
|
||||
|
||||
const uint64_t hashrate_15m = (dt_15m > 0) ? (hashes_15m / dt_15m) : 0;
|
||||
@@ -1504,6 +1525,7 @@ void StratumServer::api_update_local_stats(uint64_t timestamp)
|
||||
<< ",\"hashrate_1h\":" << hashrate_1h
|
||||
<< ",\"hashrate_24h\":" << hashrate_24h
|
||||
<< ",\"total_hashes\":" << total_hashes
|
||||
<< ",\"total_stratum_shares\":" << total_stratum_shares
|
||||
<< ",\"shares_found\":" << shares_found
|
||||
<< ",\"shares_failed\":" << shares_failed
|
||||
<< ",\"average_effort\":" << average_effort
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
#pragma once
|
||||
|
||||
#include "tcp_server.h"
|
||||
#include <rapidjson/document.h>
|
||||
|
||||
namespace p2pool {
|
||||
|
||||
@@ -26,6 +25,7 @@ class p2pool;
|
||||
class BlockTemplate;
|
||||
|
||||
static constexpr size_t STRATUM_BUF_SIZE = log::Stream::BUF_SIZE + 1;
|
||||
static constexpr size_t STRATUM_CALLBACK_BUF_SIZE = 16384;
|
||||
static constexpr int DEFAULT_STRATUM_PORT = 3333;
|
||||
|
||||
class StratumServer : public TCPServer
|
||||
@@ -46,11 +46,11 @@ public:
|
||||
|
||||
void reset() override;
|
||||
[[nodiscard]] bool on_connect() override;
|
||||
[[nodiscard]] bool on_read(char* data, uint32_t size) override;
|
||||
[[nodiscard]] bool on_read(const char* data, uint32_t size) override;
|
||||
|
||||
[[nodiscard]] bool process_request(char* data, uint32_t size);
|
||||
[[nodiscard]] bool process_login(rapidjson::Document& doc, uint32_t id);
|
||||
[[nodiscard]] bool process_submit(rapidjson::Document& doc, uint32_t id);
|
||||
template<typename T> [[nodiscard]] bool process_login(T& doc, uint32_t id);
|
||||
template<typename T> [[nodiscard]] bool process_submit(T& doc, uint32_t id);
|
||||
|
||||
bool send_http_response(bool send_content);
|
||||
|
||||
@@ -102,6 +102,8 @@ public:
|
||||
|
||||
void reset_share_counters();
|
||||
|
||||
bool http_enabled() const;
|
||||
|
||||
private:
|
||||
[[nodiscard]] const char* get_log_category() const override;
|
||||
|
||||
@@ -199,8 +201,9 @@ private:
|
||||
uint64_t m_hashrateDataTail_24h;
|
||||
|
||||
double m_cumulativeFoundSharesDiff;
|
||||
uint32_t m_totalFoundShares;
|
||||
uint32_t m_totalFailedShares;
|
||||
uint32_t m_totalFoundSidechainShares;
|
||||
uint32_t m_totalFailedSidechainShares;
|
||||
uint64_t m_totalStratumShares;
|
||||
|
||||
std::atomic<uint64_t> m_apiLastUpdateTime;
|
||||
|
||||
|
||||
+1
-1
@@ -1107,7 +1107,7 @@ void TCPServer::Client::on_read(uv_stream_t* stream, ssize_t nread, const uv_buf
|
||||
}
|
||||
}
|
||||
|
||||
bool TCPServer::Client::on_proxy_handshake(char* data, uint32_t size)
|
||||
bool TCPServer::Client::on_proxy_handshake(const char* data, uint32_t size)
|
||||
{
|
||||
if ((data != m_readBuf + m_numRead) || (data + size > m_readBuf + m_readBufSize)) {
|
||||
LOGERR(1, "peer " << static_cast<char*>(m_addrString) << " invalid data pointer or size in on_read()");
|
||||
|
||||
+2
-2
@@ -63,8 +63,8 @@ public:
|
||||
|
||||
virtual void reset();
|
||||
[[nodiscard]] virtual bool on_connect() = 0;
|
||||
[[nodiscard]] virtual bool on_read(char* data, uint32_t size) = 0;
|
||||
[[nodiscard]] bool on_proxy_handshake(char* data, uint32_t size);
|
||||
[[nodiscard]] virtual bool on_read(const char* data, uint32_t size) = 0;
|
||||
[[nodiscard]] bool on_proxy_handshake(const char* data, uint32_t size);
|
||||
virtual void on_read_failed(int /*err*/) {}
|
||||
virtual void on_disconnected() {}
|
||||
|
||||
|
||||
+1
-1
@@ -217,7 +217,7 @@ bool ServerTls::init()
|
||||
return true;
|
||||
}
|
||||
|
||||
bool ServerTls::on_read_internal(char* data, uint32_t size, ReadCallback::Base&& read_callback, WriteCallback::Base&& write_callback)
|
||||
bool ServerTls::on_read_internal(const char* data, uint32_t size, ReadCallback::Base&& read_callback, WriteCallback::Base&& write_callback)
|
||||
{
|
||||
SSL* ssl = m_ssl.get();
|
||||
if (!ssl) {
|
||||
|
||||
@@ -43,7 +43,7 @@ public:
|
||||
[[nodiscard]] bool init();
|
||||
|
||||
template<typename T, typename U>
|
||||
[[nodiscard]] FORCEINLINE bool on_read(char* data, uint32_t size, T&& read_callback, U&& write_callback)
|
||||
[[nodiscard]] FORCEINLINE bool on_read(const char* data, uint32_t size, T&& read_callback, U&& write_callback)
|
||||
{
|
||||
return on_read_internal(data, size, ReadCallback::Derived<T>(std::move(read_callback)), WriteCallback::Derived<U>(std::move(write_callback)));
|
||||
}
|
||||
@@ -60,7 +60,7 @@ private:
|
||||
typedef Callback<bool, char*, uint32_t> ReadCallback;
|
||||
typedef Callback<bool, const uint8_t*, size_t> WriteCallback;
|
||||
|
||||
[[nodiscard]] bool on_read_internal(char* data, uint32_t size, ReadCallback::Base&& read_callback, WriteCallback::Base&& write_callback);
|
||||
[[nodiscard]] bool on_read_internal(const char* data, uint32_t size, ReadCallback::Base&& read_callback, WriteCallback::Base&& write_callback);
|
||||
[[nodiscard]] bool on_write_internal(const uint8_t* data, size_t size, WriteCallback::Base&& write_callback);
|
||||
|
||||
private:
|
||||
|
||||
+3
-1
@@ -60,6 +60,8 @@ const char* VERSION = "v" STR2(P2POOL_VERSION_MAJOR) "." STR2(P2POOL_VERSION_MIN
|
||||
#endif
|
||||
" on " __DATE__ ")";
|
||||
|
||||
std::string DATA_DIR;
|
||||
|
||||
SoftwareID get_software_id(uint32_t value)
|
||||
{
|
||||
switch (value) {
|
||||
@@ -452,7 +454,7 @@ void BackgroundJobTracker::print_status()
|
||||
m_impl->print_status();
|
||||
}
|
||||
|
||||
BackgroundJobTracker bkg_jobs_tracker;
|
||||
BackgroundJobTracker* bkg_jobs_tracker = nullptr;
|
||||
|
||||
static thread_local bool main_thread = false;
|
||||
void set_main_thread() { main_thread = true; }
|
||||
|
||||
+6
-4
@@ -35,13 +35,15 @@
|
||||
namespace p2pool {
|
||||
|
||||
#define P2POOL_VERSION_MAJOR 4
|
||||
#define P2POOL_VERSION_MINOR 2
|
||||
#define P2POOL_VERSION_MINOR 4
|
||||
#define P2POOL_VERSION_PATCH 0
|
||||
|
||||
constexpr uint32_t P2POOL_VERSION = (P2POOL_VERSION_MAJOR << 16) | (P2POOL_VERSION_MINOR << 8) | P2POOL_VERSION_PATCH;
|
||||
|
||||
extern const char* VERSION;
|
||||
|
||||
extern std::string DATA_DIR;
|
||||
|
||||
enum class SoftwareID : uint32_t {
|
||||
P2Pool = 0,
|
||||
GoObserver = 0x624F6F47UL,
|
||||
@@ -233,10 +235,10 @@ private:
|
||||
Impl* m_impl;
|
||||
};
|
||||
|
||||
extern BackgroundJobTracker bkg_jobs_tracker;
|
||||
extern BackgroundJobTracker* bkg_jobs_tracker;
|
||||
|
||||
#define BACKGROUND_JOB_START(x) do { bkg_jobs_tracker.start(#x); } while (0)
|
||||
#define BACKGROUND_JOB_STOP(x) do { bkg_jobs_tracker.stop(#x); } while (0)
|
||||
#define BACKGROUND_JOB_START(x) do { bkg_jobs_tracker->start(#x); } while (0)
|
||||
#define BACKGROUND_JOB_STOP(x) do { bkg_jobs_tracker->stop(#x); } while (0)
|
||||
|
||||
void set_main_thread();
|
||||
bool is_main_thread();
|
||||
|
||||
@@ -25,6 +25,16 @@ static_assert(sizeof(in_addr) == 4, "struct in_addr has invalid size");
|
||||
|
||||
namespace p2pool {
|
||||
|
||||
struct ReadWriteLock : public nocopy_nomove {
|
||||
FORCEINLINE ReadWriteLock() { uv_rwlock_init(&m_lock); }
|
||||
FORCEINLINE ~ReadWriteLock() { uv_rwlock_destroy(&m_lock); }
|
||||
|
||||
FORCEINLINE operator uv_rwlock_t&() { return m_lock; }
|
||||
|
||||
private:
|
||||
uv_rwlock_t m_lock;
|
||||
};
|
||||
|
||||
struct MutexLock : public nocopy_nomove
|
||||
{
|
||||
explicit FORCEINLINE MutexLock(uv_mutex_t& handle) : m_handle(&handle) { uv_mutex_lock(&handle); }
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@
|
||||
#include "common.h"
|
||||
#include "zmq_reader.h"
|
||||
#include "json_parsers.h"
|
||||
#include <rapidjson/document.h>
|
||||
#include "rapidjson_wrapper.h"
|
||||
|
||||
LOG_CATEGORY(ZMQReader)
|
||||
|
||||
|
||||
+14
-9
@@ -18,10 +18,18 @@ set(INSTALL_GTEST OFF CACHE BOOL "Enable installation of googletest. (Projects e
|
||||
add_subdirectory(googletest)
|
||||
set(LIBS gtest)
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES MSVC)
|
||||
include(cmake/msvc_libs.cmake)
|
||||
endif()
|
||||
|
||||
add_subdirectory(../external/src/RandomX RandomX)
|
||||
set(LIBS ${LIBS} randomx)
|
||||
add_definitions(-DWITH_RANDOMX)
|
||||
|
||||
add_subdirectory(cmake/ssl)
|
||||
include_directories(../external/src/grpc/third_party/boringssl-with-bazel/src/include)
|
||||
add_definitions(-DWITH_TLS)
|
||||
|
||||
add_definitions(-DP2POOL_UNIT_TESTS)
|
||||
add_definitions(-DP2POOL_SIDECHAIN_EXTRA_1=1)
|
||||
|
||||
@@ -69,6 +77,7 @@ set(SOURCES
|
||||
../src/side_chain.cpp
|
||||
../src/stratum_server.cpp
|
||||
../src/tcp_server.cpp
|
||||
../src/tls.cpp
|
||||
../src/util.cpp
|
||||
../src/wallet.cpp
|
||||
../src/zmq_reader.cpp
|
||||
@@ -81,7 +90,7 @@ if (AMD64)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if (NOT STATIC_BINARY AND NOT STATIC_LIBS)
|
||||
if (NOT ((CMAKE_CXX_COMPILER_ID MATCHES MSVC) OR STATIC_BINARY OR STATIC_LIBS))
|
||||
include(FindCURL)
|
||||
endif()
|
||||
|
||||
@@ -132,14 +141,8 @@ if (STATIC_LIBS)
|
||||
set(CURL_LIBRARY "${CMAKE_SOURCE_DIR}/../external/src/curl/lib/.libs/libcurl.a")
|
||||
else()
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES MSVC)
|
||||
find_library(ZMQ_LIBRARY_DEBUG NAMES libzmq-v142-mt-sgd-4_3_6 PATHS "../external/lib/libzmq/Debug")
|
||||
find_library(ZMQ_LIBRARY NAMES libzmq-v142-mt-s-4_3_6 PATHS "../external/lib/libzmq/Release")
|
||||
find_library(UV_LIBRARY_DEBUG NAMES libuv PATHS "../external/lib/libuv/Debug")
|
||||
find_library(UV_LIBRARY NAMES libuv PATHS "../external/lib/libuv/Release")
|
||||
find_library(CURL_LIBRARY_DEBUG NAMES libcurl-d PATHS "../external/lib/libcurl/Debug")
|
||||
find_library(CURL_LIBRARY NAMES libcurl PATHS "../external/lib/libcurl/Release")
|
||||
add_definitions(-D_DISABLE_VECTOR_ANNOTATION)
|
||||
add_definitions(-D_DISABLE_STRING_ANNOTATION)
|
||||
find_library(CURL_LIBRARY_DEBUG NAMES libcurl-d PATHS "../external/lib/libcurl_tls/Debug")
|
||||
find_library(CURL_LIBRARY NAMES libcurl PATHS "../external/lib/libcurl_tls/Release")
|
||||
elseif (CMAKE_CXX_COMPILER_ID MATCHES GNU OR CMAKE_CXX_COMPILER_ID MATCHES Clang)
|
||||
find_library(ZMQ_LIBRARY_DEBUG NAMES zmq libzmq.a)
|
||||
find_library(ZMQ_LIBRARY NAMES zmq libzmq.a)
|
||||
@@ -178,6 +181,8 @@ if(APPLE)
|
||||
set(LIBS ${LIBS} ${FOUNDATION_LIB} ${CORE_FOUNDATION_LIB} ${SYSTEM_CONFIGURATION_LIB})
|
||||
endif()
|
||||
|
||||
set(LIBS ${LIBS} ssl crypto)
|
||||
|
||||
add_definitions(/DZMQ_STATIC /DP2POOL_LOG_DISABLE)
|
||||
|
||||
include(CheckCXXSourceCompiles)
|
||||
|
||||
@@ -0,0 +1,73 @@
|
||||
set(CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION 10.0)
|
||||
|
||||
add_definitions(-D_DISABLE_VECTOR_ANNOTATION)
|
||||
add_definitions(-D_DISABLE_STRING_ANNOTATION)
|
||||
|
||||
set(BUILD_TESTING OFF CACHE BOOL "")
|
||||
set(LIBUV_BUILD_SHARED OFF CACHE BOOL "")
|
||||
set(WITH_LIBSODIUM OFF CACHE BOOL "")
|
||||
set(WITH_LIBBSD OFF CACHE BOOL "")
|
||||
set(BUILD_TESTS OFF CACHE BOOL "")
|
||||
set(ZMQ_HAVE_IPC OFF CACHE BOOL "")
|
||||
set(WITH_DOCS OFF CACHE BOOL "")
|
||||
set(ENABLE_DRAFTS OFF CACHE BOOL "")
|
||||
set(BUILD_SHARED OFF CACHE BOOL "")
|
||||
set(ENABLE_CLANG OFF CACHE BOOL "")
|
||||
|
||||
set(CURL_TARGET_WINDOWS_VERSION "0x0600" CACHE STRING "")
|
||||
set(BUILD_CURL_EXE OFF CACHE BOOL "")
|
||||
set(BUILD_SHARED_LIBS OFF CACHE BOOL "")
|
||||
set(CURL_DISABLE_INSTALL ON CACHE BOOL "")
|
||||
set(CURL_ENABLE_EXPORT_TARGET OFF CACHE BOOL "")
|
||||
set(CURL_DISABLE_HEADERS_API ON CACHE BOOL "")
|
||||
set(CURL_DISABLE_BINDLOCAL ON CACHE BOOL "")
|
||||
set(BUILD_LIBCURL_DOCS OFF CACHE BOOL "")
|
||||
set(BUILD_MISC_DOCS OFF CACHE BOOL "")
|
||||
set(ENABLE_CURL_MANUAL OFF CACHE BOOL "")
|
||||
set(CURL_ZLIB OFF CACHE BOOL "")
|
||||
set(CURL_BROTLI OFF CACHE BOOL "")
|
||||
set(CURL_ZSTD OFF CACHE BOOL "")
|
||||
set(CURL_DISABLE_ALTSVC ON CACHE BOOL "")
|
||||
set(CURL_DISABLE_COOKIES ON CACHE BOOL "")
|
||||
set(CURL_DISABLE_DOH ON CACHE BOOL "")
|
||||
set(CURL_DISABLE_GETOPTIONS ON CACHE BOOL "")
|
||||
set(CURL_DISABLE_HSTS ON CACHE BOOL "")
|
||||
set(CURL_DISABLE_LIBCURL_OPTION ON CACHE BOOL "")
|
||||
set(CURL_DISABLE_MIME ON CACHE BOOL "")
|
||||
set(CURL_DISABLE_NETRC ON CACHE BOOL "")
|
||||
set(CURL_DISABLE_NTLM ON CACHE BOOL "")
|
||||
set(CURL_DISABLE_PARSEDATE ON CACHE BOOL "")
|
||||
set(CURL_DISABLE_PROGRESS_METER ON CACHE BOOL "")
|
||||
set(CURL_DISABLE_SHUFFLE_DNS ON CACHE BOOL "")
|
||||
set(CURL_DISABLE_SOCKETPAIR ON CACHE BOOL "")
|
||||
set(CURL_DISABLE_VERBOSE_STRINGS ON CACHE BOOL "")
|
||||
set(CURL_DISABLE_WEBSOCKETS ON CACHE BOOL "")
|
||||
set(HTTP_ONLY ON CACHE BOOL "")
|
||||
set(CURL_ENABLE_SSL OFF CACHE BOOL "")
|
||||
set(USE_LIBIDN2 OFF CACHE BOOL "")
|
||||
set(CURL_USE_LIBPSL OFF CACHE BOOL "")
|
||||
set(CURL_USE_LIBSSH2 OFF CACHE BOOL "")
|
||||
set(ENABLE_UNIX_SOCKETS OFF CACHE BOOL "")
|
||||
set(CURL_DISABLE_TESTS ON CACHE BOOL "")
|
||||
set(USE_NGHTTP2 OFF CACHE BOOL "")
|
||||
set(BUILD_EXAMPLES OFF CACHE BOOL "")
|
||||
set(CURL_DISABLE_SRP ON CACHE BOOL "")
|
||||
set(CURL_STATIC_CRT ON CACHE BOOL "")
|
||||
|
||||
if (WITH_TLS)
|
||||
set(P2POOL_BORINGSSL ON CACHE BOOL "")
|
||||
set(OPENSSL_INCLUDE_DIR "../grpc/third_party/boringssl-with-bazel/src/include" CACHE STRING "")
|
||||
endif()
|
||||
|
||||
add_subdirectory(../external/src/curl curl)
|
||||
add_subdirectory(../external/src/libuv libuv)
|
||||
add_subdirectory(../external/src/libzmq libzmq)
|
||||
|
||||
set(CURL_LIBRARY_DEBUG libcurl_static)
|
||||
set(CURL_LIBRARY libcurl_static)
|
||||
|
||||
set(UV_LIBRARY_DEBUG uv_a)
|
||||
set(UV_LIBRARY uv_a)
|
||||
|
||||
set(ZMQ_LIBRARY_DEBUG libzmq-static)
|
||||
set(ZMQ_LIBRARY libzmq-static)
|
||||
@@ -0,0 +1,31 @@
|
||||
cmake_minimum_required(VERSION 3.12)
|
||||
|
||||
project(P2Pool_SSL LANGUAGES C CXX)
|
||||
|
||||
if (CMAKE_CXX_COMPILER_ID MATCHES MSVC)
|
||||
set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} /W0 /Zi /Od /Ob0 /MP /MTd")
|
||||
set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} /W0 /Zi /Od /Ob0 /MP /MTd")
|
||||
set(CMAKE_C_FLAGS_RELEASE "${CMAKE_C_FLAGS_RELEASE} /W0 /O1 /Ob2 /Oi /Os /Oy /MP /MT")
|
||||
set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS_RELEASE} /W0 /O1 /Ob2 /Oi /Os /Oy /MP /MT")
|
||||
set(CMAKE_C_FLAGS_RELWITHDEBINFO "${CMAKE_C_FLAGS_RELWITHDEBINFO} /W0 /Ob1 /Ot /Zi /MP /MT")
|
||||
set(CMAKE_CXX_FLAGS_RELWITHDEBINFO "${CMAKE_CXX_FLAGS_RELWITHDEBINFO} /W0 /Ob1 /Ot /Zi /MP /MT")
|
||||
else()
|
||||
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Os -w")
|
||||
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Os -w")
|
||||
endif()
|
||||
|
||||
if(CMAKE_GENERATOR MATCHES "Visual Studio")
|
||||
if(CMAKE_VERSION VERSION_LESS 3.13)
|
||||
message(WARNING "Disabling SSL assembly support because CMake version ${CMAKE_VERSION} is too old (less than 3.13)")
|
||||
set(OPENSSL_NO_ASM ON)
|
||||
else()
|
||||
include(CheckLanguage)
|
||||
check_language(ASM_NASM)
|
||||
if(NOT CMAKE_ASM_NASM_COMPILER)
|
||||
message(WARNING "Disabling SSL assembly support because NASM could not be found")
|
||||
set(OPENSSL_NO_ASM ON)
|
||||
endif()
|
||||
endif()
|
||||
endif()
|
||||
|
||||
add_subdirectory(../../../external/src/grpc/third_party/boringssl-with-bazel BoringSSL)
|
||||
+1
-1
Submodule tests/googletest updated: e397860881...6910c9d916
@@ -294,6 +294,8 @@ allowedAPIs = {
|
||||
"OpenThreadToken",
|
||||
"GetOverlappedResult",
|
||||
"CryptGenRandom",
|
||||
"HeapQueryInformation",
|
||||
"AreFileApisANSI",
|
||||
}
|
||||
|
||||
f = open(sys.argv[1], 'r')
|
||||
|
||||
+15
-3
@@ -15,14 +15,26 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "common.h"
|
||||
#include "util.h"
|
||||
#include "pool_block.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
void p2pool_usage() {}
|
||||
namespace p2pool { void set_main_thread(); }
|
||||
|
||||
using namespace p2pool;
|
||||
|
||||
int main(int argc, char** argv)
|
||||
{
|
||||
p2pool::set_main_thread();
|
||||
set_main_thread();
|
||||
|
||||
PoolBlock::s_precalculatedSharesLock = new ReadWriteLock();
|
||||
|
||||
testing::InitGoogleTest(&argc, argv);
|
||||
return RUN_ALL_TESTS();
|
||||
const int result = RUN_ALL_TESTS();
|
||||
|
||||
delete PoolBlock::s_precalculatedSharesLock;
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "keccak.h"
|
||||
#include "merkle.h"
|
||||
#include "pool_block.h"
|
||||
#include "side_chain.h"
|
||||
#include "keccak.h"
|
||||
#include "gtest/gtest.h"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user