feat: use canonical peer priority to decide which peers to keep (#6981)

* feat: CRC32-C

* feat: canonical peer priority calculation bep-40

* test: add test cases for IPv4 canonical peer priority

* refactor: compare by canonical priority

* fix: use network byte order for peer ports

* test: more cases

* build: xcode

Co-authored-by: Dzmitry Neviadomski <nevack.d@gmail.com>

* ci: test system crc32c library

---------

Co-authored-by: Dzmitry Neviadomski <nevack.d@gmail.com>
This commit is contained in:
Yat Ho
2025-10-26 01:05:20 +08:00
committed by GitHub
parent e7d4a69107
commit 0715897fc8
14 changed files with 560 additions and 15 deletions

View File

@@ -362,7 +362,7 @@ jobs:
echo '${{ toJSON(runner) }}'
sw_vers
- name: Get Dependencies
run: brew install --formulae cmake gettext libdeflate libevent libpsl miniupnpc ninja node pkgconf
run: brew install --formulae cmake gettext libdeflate libevent libpsl miniupnpc ninja node pkgconf crc32c
- name: Get Dependencies (GTK)
if: ${{ needs.what-to-make.outputs.make-gtk == 'true' }}
run: brew install --formula gtkmm3
@@ -393,7 +393,8 @@ jobs:
-DENABLE_UTILS=${{ (needs.what-to-make.outputs.make-utils == 'true') && 'ON' || 'OFF' }} \
-DREBUILD_WEB=${{ (needs.what-to-make.outputs.make-web == 'true') && 'ON' || 'OFF' }} \
-DENABLE_WERROR=ON \
-DRUN_CLANG_TIDY=OFF
-DRUN_CLANG_TIDY=OFF \
-DUSE_SYSTEM_Crc32c=ON
- name: Make
run: cmake --build obj --config RelWithDebInfo
- name: Test
@@ -420,7 +421,7 @@ jobs:
echo '${{ toJSON(runner) }}'
sw_vers
- name: Get Dependencies
run: brew install --formulae cmake gettext libdeflate libevent libpsl miniupnpc ninja node pkgconf
run: brew install --formulae cmake gettext libdeflate libevent libpsl miniupnpc ninja node pkgconf crc32c
- name: Get Source
uses: actions/checkout@v4
with:
@@ -445,7 +446,8 @@ jobs:
-DENABLE_QT=OFF \
-DENABLE_TESTS=OFF \
-DENABLE_WERROR=ON \
-DRUN_CLANG_TIDY=OFF
-DRUN_CLANG_TIDY=OFF \
-DUSE_SYSTEM_CRC32C=ON
- name: Make
run: cmake --build obj --config RelWithDebInfo
@@ -468,6 +470,7 @@ jobs:
apk add \
ca-certificates \
cmake \
crc32c-dev \
curl-dev \
fmt-dev \
g++ \
@@ -509,7 +512,8 @@ jobs:
-DENABLE_UTILS=${{ (needs.what-to-make.outputs.make-utils == 'true') && 'ON' || 'OFF' }} \
-DREBUILD_WEB=${{ (needs.what-to-make.outputs.make-web == 'true') && 'ON' || 'OFF' }} \
-DENABLE_WERROR=ON \
-DRUN_CLANG_TIDY=OFF
-DRUN_CLANG_TIDY=OFF \
-DUSE_SYSTEM_CRC32C=ON
- name: Make
run: cmake --build obj --config RelWithDebInfo
- name: Test
@@ -864,6 +868,7 @@ jobs:
fmt-devel \
gcc-c++ \
gettext \
google-crc32c-devel \
libcurl-devel \
libdeflate-devel \
libevent-devel \
@@ -905,7 +910,8 @@ jobs:
-DREBUILD_WEB=${{ (needs.what-to-make.outputs.make-web == 'true') && 'ON' || 'OFF' }} \
-DENABLE_DEPRECATED=ON \
-DENABLE_WERROR=OFF \
-DRUN_CLANG_TIDY=OFF
-DRUN_CLANG_TIDY=OFF \
-DUSE_SYSTEM_Crc32c=ON
- name: Build
run: cmake --build obj --config RelWithDebInfo
- name: Test