diff --git a/.editorconfig b/.editorconfig index c5f3028c5036..d7fe7ad5e244 100644 --- a/.editorconfig +++ b/.editorconfig @@ -13,7 +13,7 @@ trim_trailing_whitespace = true [*.{h,cpp,rs,py,sh}] indent_size = 4 -# .cirrus.yml, etc. +# ci.yml, etc. [*.yml] indent_size = 2 diff --git a/.github/ISSUE_TEMPLATE/good_first_issue.yml b/.github/ISSUE_TEMPLATE/good_first_issue.yml deleted file mode 100644 index 44c1994763b5..000000000000 --- a/.github/ISSUE_TEMPLATE/good_first_issue.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Good First Issue -description: (Regular devs only) Suggest a new good first issue -labels: [good first issue] -body: - - type: markdown - attributes: - value: | - Please add the label "good first issue" manually before or after opening - - A good first issue is an uncontroversial issue, that has a relatively unique and obvious solution - - Motivate the issue and explain the solution briefly - - type: textarea - id: motivation - attributes: - label: Motivation - description: Motivate the issue - validations: - required: true - - type: textarea - id: solution - attributes: - label: Possible solution - description: Describe a possible solution - validations: - required: false - - type: textarea - id: useful-skills - attributes: - label: Useful Skills - description: For example, “`std::thread`”, “async design” or “basic understanding of Bitcoin mining and the Bitcoin Core RPC interface”. - value: | - * Compiling Bitcoin Core from source - * Running the C++ unit tests and the Python functional tests - * ... - - type: textarea - attributes: - label: Guidance for new contributors - description: Please leave this to automatically add the footer for new contributors - value: | - Want to work on this issue? - - For guidance on contributing, please read [CONTRIBUTING.md](https://github.com/bitcoin/bitcoin/blob/master/CONTRIBUTING.md) before opening your pull request. - diff --git a/.github/actions/restore-caches/action.yml b/.github/actions/cache/restore/action.yml similarity index 77% rename from .github/actions/restore-caches/action.yml rename to .github/actions/cache/restore/action.yml index ee07d68b9070..2cc5b53a1e1f 100644 --- a/.github/actions/restore-caches/action.yml +++ b/.github/actions/cache/restore/action.yml @@ -1,43 +1,51 @@ name: 'Restore Caches' description: 'Restore ccache, depends sources, and built depends caches' +inputs: + provider: + description: 'The cache provider to use' + required: true runs: using: 'composite' steps: - name: Restore Ccache cache id: ccache-cache - uses: actions/cache/restore@v5 + uses: ./.github/actions/cache/restore/internal with: path: ${{ env.CCACHE_DIR }} key: ccache-${{ env.CONTAINER_NAME }}-${{ github.run_id }} restore-keys: | ccache-${{ env.CONTAINER_NAME }}- + provider: ${{ inputs.provider }} - name: Restore depends sources cache id: depends-sources - uses: actions/cache/restore@v5 + uses: ./.github/actions/cache/restore/internal with: path: ${{ env.SOURCES_PATH }} key: depends-sources-${{ env.CONTAINER_NAME }}-${{ env.DEPENDS_HASH }} restore-keys: | depends-sources-${{ env.CONTAINER_NAME }}- + provider: ${{ inputs.provider }} - name: Restore built depends cache id: depends-built - uses: actions/cache/restore@v5 + uses: ./.github/actions/cache/restore/internal with: path: ${{ env.BASE_CACHE }} key: depends-built-${{ env.CONTAINER_NAME }}-${{ env.DEPENDS_HASH }} restore-keys: | depends-built-${{ env.CONTAINER_NAME }}- + provider: ${{ inputs.provider }} - name: Restore previous releases cache id: previous-releases - uses: actions/cache/restore@v5 + uses: ./.github/actions/cache/restore/internal with: path: ${{ env.PREVIOUS_RELEASES_DIR }} key: previous-releases-${{ env.CONTAINER_NAME }}-${{ env.PREVIOUS_RELEASES_HASH }} restore-keys: | previous-releases-${{ env.CONTAINER_NAME }}- + provider: ${{ inputs.provider }} - name: export cache hits shell: bash diff --git a/.github/actions/cache/restore/internal/action.yml b/.github/actions/cache/restore/internal/action.yml new file mode 100644 index 000000000000..43dd206345df --- /dev/null +++ b/.github/actions/cache/restore/internal/action.yml @@ -0,0 +1,43 @@ +name: 'Cache Restore' +description: 'Restore a cache with WarpBuild on Warp runners and GitHub Actions cache otherwise' +inputs: + path: + description: 'A list of files, directories, and wildcard patterns to restore' + required: true + key: + description: 'An explicit key for restoring the cache' + required: true + restore-keys: + description: 'An ordered multiline string listing prefix-matched restore keys' + required: false + default: '' + provider: + description: 'The cache provider to use' + required: true +outputs: + cache-hit: + description: 'A boolean value to indicate an exact match was found for the primary key' + value: ${{ steps.warp.outputs.cache-hit || steps.gha.outputs.cache-hit }} + cache-primary-key: + description: 'The primary key used to restore the cache' + value: ${{ steps.warp.outputs.cache-primary-key || steps.gha.outputs.cache-primary-key }} +runs: + using: 'composite' + steps: + - name: Restore cache with WarpBuild + id: warp + if: ${{ inputs.provider == 'warp' }} + uses: WarpBuilds/cache/restore@v1 + with: + path: ${{ inputs.path }} + key: ${{ inputs.key }} + restore-keys: ${{ inputs.restore-keys }} + + - name: Restore cache with GitHub Actions + id: gha + if: ${{ inputs.provider == 'gha' }} + uses: actions/cache/restore@v5 + with: + path: ${{ inputs.path }} + key: ${{ inputs.key }} + restore-keys: ${{ inputs.restore-keys }} diff --git a/.github/actions/save-caches/action.yml b/.github/actions/cache/save/action.yml similarity index 79% rename from .github/actions/save-caches/action.yml rename to .github/actions/cache/save/action.yml index 8667c91473df..5c543b3f9e78 100644 --- a/.github/actions/save-caches/action.yml +++ b/.github/actions/cache/save/action.yml @@ -1,5 +1,9 @@ name: 'Save Caches' description: 'Save ccache, depends sources, and built depends caches' +inputs: + provider: + description: 'The cache provider to use' + required: true runs: using: 'composite' steps: @@ -11,29 +15,33 @@ runs: echo "previous releases direct cache hit to primary key: ${{ env.previous-releases-cache-hit }}" - name: Save Ccache cache - uses: actions/cache/save@v5 + uses: ./.github/actions/cache/save/internal if: ${{ (github.event_name == 'push') && (github.ref_name == github.event.repository.default_branch) }} with: path: ${{ env.CCACHE_DIR }} key: ccache-${{ env.CONTAINER_NAME }}-${{ github.run_id }} + provider: ${{ inputs.provider }} - name: Save depends sources cache - uses: actions/cache/save@v5 + uses: ./.github/actions/cache/save/internal if: ${{ (github.event_name == 'push') && (github.ref_name == github.event.repository.default_branch) && (env.depends-sources-cache-hit != 'true') }} with: path: ${{ env.SOURCES_PATH }} key: depends-sources-${{ env.CONTAINER_NAME }}-${{ env.DEPENDS_HASH }} + provider: ${{ inputs.provider }} - name: Save built depends cache - uses: actions/cache/save@v5 + uses: ./.github/actions/cache/save/internal if: ${{ (github.event_name == 'push') && (github.ref_name == github.event.repository.default_branch) && (env.depends-built-cache-hit != 'true' )}} with: path: ${{ env.BASE_CACHE }} key: depends-built-${{ env.CONTAINER_NAME }}-${{ env.DEPENDS_HASH }} + provider: ${{ inputs.provider }} - name: Save previous releases cache - uses: actions/cache/save@v5 + uses: ./.github/actions/cache/save/internal if: ${{ (github.event_name == 'push') && (github.ref_name == github.event.repository.default_branch) && (env.previous-releases-cache-hit != 'true' )}} with: path: ${{ env.PREVIOUS_RELEASES_DIR }} key: previous-releases-${{ env.CONTAINER_NAME }}-${{ env.PREVIOUS_RELEASES_HASH }} + provider: ${{ inputs.provider }} diff --git a/.github/actions/cache/save/internal/action.yml b/.github/actions/cache/save/internal/action.yml new file mode 100644 index 000000000000..12f4156a072f --- /dev/null +++ b/.github/actions/cache/save/internal/action.yml @@ -0,0 +1,28 @@ +name: 'Cache Save' +description: 'Save a cache with WarpBuild on Warp runners and GitHub Actions cache otherwise' +inputs: + path: + description: 'A list of files, directories, and wildcard patterns to cache' + required: true + key: + description: 'An explicit key for saving the cache' + required: true + provider: + description: 'The cache provider to use' + required: true +runs: + using: 'composite' + steps: + - name: Save cache with WarpBuild + if: ${{ inputs.provider == 'warp' }} + uses: WarpBuilds/cache/save@v1 + with: + path: ${{ inputs.path }} + key: ${{ inputs.key }} + + - name: Save cache with GitHub Actions + if: ${{ inputs.provider == 'gha' }} + uses: actions/cache/save@v5 + with: + path: ${{ inputs.path }} + key: ${{ inputs.key }} diff --git a/.github/actions/configure-docker/action.yml b/.github/actions/configure-docker/action.yml index 6f89dc8bd045..074b47ce348b 100644 --- a/.github/actions/configure-docker/action.yml +++ b/.github/actions/configure-docker/action.yml @@ -1,9 +1,22 @@ name: 'Configure Docker' description: 'Set up Docker build driver and configure build cache args' +inputs: + provider: + description: 'The cache provider to use' + required: false + default: 'gha' runs: using: 'composite' steps: + - name: Set up Docker Buildx for Warp cache + if: ${{ inputs.provider == 'warp' }} + uses: docker/setup-buildx-action@v4 + with: + driver-opts: | + network=host + - name: Set up Docker Buildx + if: ${{ inputs.provider != 'warp' }} uses: docker/setup-buildx-action@v4 # This is required when using the gha cache backend with a manual docker buildx invocation. @@ -23,13 +36,18 @@ runs: - name: Construct docker build cache args shell: bash run: | + cache_options="scope=${CONTAINER_NAME}" + if [[ "${{ inputs.provider }}" == "warp" ]]; then + cache_options="url=http://127.0.0.1:49160/,version=1,${cache_options}" + fi + # Configure docker build cache backend # Always optimistically --cache‑from in case a cache blob exists - args=(--cache-from "type=gha,scope=${CONTAINER_NAME}") + args=(--cache-from "type=gha,${cache_options}") # Only add --cache-to when pushing to the default branch. if [[ ${{ github.event_name }} == "push" && ${{ github.ref_name }} == ${{ github.event.repository.default_branch }} ]]; then - args+=(--cache-to "type=gha,mode=max,ignore-error=true,scope=${CONTAINER_NAME}") + args+=(--cache-to "type=gha,mode=max,ignore-error=true,${cache_options}") fi # Always `--load` into docker images (needed when using the `docker-container` build driver). diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 920c1f46047d..66db58aa7095 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -19,7 +19,7 @@ concurrency: env: CI_FAILFAST_TEST_LEAVE_DANGLING: 1 # GHA does not care about dangling processes and setting this variable avoids killing the CI script itself on error - REPO_USE_CIRRUS_RUNNERS: 'bitcoin/bitcoin' # Use cirrus runners for this repo, instead of falling back to the slow GHA runners + REPO_USE_WARP_RUNNERS: 'bitcoin/bitcoin' # Use warp runners for this repo, instead of falling back to the slow GHA runners defaults: run: @@ -46,9 +46,9 @@ jobs: fi - id: runners run: | - if [[ "${REPO_USE_CIRRUS_RUNNERS}" == "${{ github.repository }}" ]]; then - echo "provider=cirrus" >> "$GITHUB_OUTPUT" - echo "::notice title=Runner Selection::Using Cirrus Runners" + if [[ "${REPO_USE_WARP_RUNNERS}" == "${{ github.repository }}" ]]; then + echo "provider=warp" >> "$GITHUB_OUTPUT" + echo "::notice title=Runner Selection::Using Warp Runners" else echo "provider=gha" >> "$GITHUB_OUTPUT" echo "::notice title=Runner Selection::Using GitHub-hosted runners" @@ -57,7 +57,7 @@ jobs: test-each-commit: name: 'test ancestor commits' needs: runners - runs-on: ${{ needs.runners.outputs.provider == 'cirrus' && 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-md' || 'ubuntu-24.04' }} + runs-on: ${{ needs.runners.outputs.provider == 'warp' && 'warp-ubuntu-latest-x64-8x' || 'ubuntu-latest' }} env: TEST_RUNNER_PORT_MIN: "14000" # Use a larger port range to avoid colliding with other CI services. if: github.event_name == 'pull_request' && github.event.pull_request.commits != 1 @@ -215,7 +215,7 @@ jobs: ci-matrix: name: ${{ matrix.name }} needs: runners - runs-on: ${{ needs.runners.outputs.provider == 'cirrus' && matrix.cirrus-runner || matrix.fallback-runner }} + runs-on: ${{ needs.runners.outputs.provider == 'warp' && matrix.warp-runner || matrix.fallback-runner }} if: ${{ vars.SKIP_BRANCH_PUSH != 'true' || github.event_name == 'pull_request' }} timeout-minutes: ${{ matrix.timeout-minutes }} @@ -228,87 +228,87 @@ jobs: matrix: include: - name: 'iwyu' - cirrus-runner: 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-md' - fallback-runner: 'ubuntu-24.04' + warp-runner: 'warp-ubuntu-latest-x64-8x' + fallback-runner: 'ubuntu-latest' timeout-minutes: 120 file-env: './ci/test/00_setup_env_native_iwyu.sh' - name: '32 bit ARM' - cirrus-runner: 'ubuntu-24.04-arm' # Cirrus' Arm runners are Apple (with virtual Linux aarch64), which doesn't support 32-bit mode + warp-runner: 'ubuntu-24.04-arm' # Warp's Arm runners don't support 32-bit mode currently fallback-runner: 'ubuntu-24.04-arm' timeout-minutes: 120 file-env: './ci/test/00_setup_env_arm.sh' provider: 'gha' - name: 'ASan + LSan + UBSan + integer' - cirrus-runner: 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-md' # has to match container in ci/test/00_setup_env_native_asan.sh for tracing tools + warp-runner: 'warp-ubuntu-2404-x64-8x' # has to match container in ci/test/00_setup_env_native_asan.sh for tracing tools fallback-runner: 'ubuntu-24.04' timeout-minutes: 120 file-env: './ci/test/00_setup_env_native_asan.sh' - name: 'macOS-cross to arm64' - cirrus-runner: 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-sm' - fallback-runner: 'ubuntu-24.04' + warp-runner: 'warp-ubuntu-latest-x64-4x' + fallback-runner: 'ubuntu-latest' timeout-minutes: 120 file-env: './ci/test/00_setup_env_mac_cross.sh' - name: 'macOS-cross to x86_64' - cirrus-runner: 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-sm' - fallback-runner: 'ubuntu-24.04' + warp-runner: 'warp-ubuntu-latest-x64-4x' + fallback-runner: 'ubuntu-latest' timeout-minutes: 120 file-env: './ci/test/00_setup_env_mac_cross_intel.sh' - name: 'FreeBSD Cross' - cirrus-runner: 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-md' - fallback-runner: 'ubuntu-24.04' + warp-runner: 'warp-ubuntu-latest-x64-8x' + fallback-runner: 'ubuntu-latest' timeout-minutes: 120 file-env: './ci/test/00_setup_env_freebsd_cross.sh' - name: 'i686' - cirrus-runner: 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-md' - fallback-runner: 'ubuntu-24.04' + warp-runner: 'warp-ubuntu-latest-x64-8x' + fallback-runner: 'ubuntu-latest' timeout-minutes: 120 file-env: './ci/test/00_setup_env_i686.sh' - name: 'fuzzer,address,undefined,integer' - cirrus-runner: 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-lg' - fallback-runner: 'ubuntu-24.04' + warp-runner: 'warp-ubuntu-latest-x64-16x' + fallback-runner: 'ubuntu-latest' timeout-minutes: 240 file-env: './ci/test/00_setup_env_native_fuzz.sh' - name: 'previous releases' - cirrus-runner: 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-md' - fallback-runner: 'ubuntu-24.04' + warp-runner: 'warp-ubuntu-latest-x64-8x' + fallback-runner: 'ubuntu-latest' timeout-minutes: 120 file-env: './ci/test/00_setup_env_native_previous_releases.sh' - name: 'Alpine (musl)' - cirrus-runner: 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-md' - fallback-runner: 'ubuntu-24.04' + warp-runner: 'warp-ubuntu-latest-x64-8x' + fallback-runner: 'ubuntu-latest' timeout-minutes: 120 file-env: './ci/test/00_setup_env_native_alpine_musl.sh' - name: 'tidy' - cirrus-runner: 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-md' - fallback-runner: 'ubuntu-24.04' + warp-runner: 'warp-ubuntu-latest-x64-8x' + fallback-runner: 'ubuntu-latest' timeout-minutes: 120 file-env: './ci/test/00_setup_env_native_tidy.sh' - name: 'TSan' - cirrus-runner: 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-md' - fallback-runner: 'ubuntu-24.04' + warp-runner: 'warp-ubuntu-latest-x64-8x' + fallback-runner: 'ubuntu-latest' timeout-minutes: 120 file-env: './ci/test/00_setup_env_native_tsan.sh' - name: 'MSan, fuzz' - cirrus-runner: 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-md' - fallback-runner: 'ubuntu-24.04' + warp-runner: 'warp-ubuntu-latest-x64-8x' + fallback-runner: 'ubuntu-latest' timeout-minutes: 150 file-env: './ci/test/00_setup_env_native_fuzz_with_msan.sh' - name: 'MSan' - cirrus-runner: 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-lg' - fallback-runner: 'ubuntu-24.04' + warp-runner: 'warp-ubuntu-latest-x64-16x' + fallback-runner: 'ubuntu-latest' timeout-minutes: 120 file-env: './ci/test/00_setup_env_native_msan.sh' @@ -322,10 +322,14 @@ jobs: - name: Restore caches id: restore-cache - uses: ./.github/actions/restore-caches + uses: ./.github/actions/cache/restore + with: + provider: ${{ matrix.provider || needs.runners.outputs.provider }} - name: Configure Docker uses: ./.github/actions/configure-docker + with: + provider: ${{ matrix.provider || needs.runners.outputs.provider }} - name: Clear unnecessary files if: ${{ needs.runners.outputs.provider == 'gha' && true || false }} # Only needed on GHA runners @@ -346,12 +350,14 @@ jobs: run: ./ci/test_run_all.sh - name: Save caches - uses: ./.github/actions/save-caches + uses: ./.github/actions/cache/save + with: + provider: ${{ matrix.provider || needs.runners.outputs.provider }} lint: name: 'lint' needs: runners - runs-on: ${{ needs.runners.outputs.provider == 'cirrus' && 'ghcr.io/cirruslabs/ubuntu-runner-amd64:24.04-xs' || 'ubuntu-24.04' }} + runs-on: ${{ needs.runners.outputs.provider == 'warp' && 'warp-ubuntu-latest-x64-2x' || 'ubuntu-latest' }} if: ${{ vars.SKIP_BRANCH_PUSH != 'true' || github.event_name == 'pull_request' }} timeout-minutes: 20 env: @@ -367,6 +373,8 @@ jobs: - name: Configure Docker uses: ./.github/actions/configure-docker + with: + provider: ${{ needs.runners.outputs.provider }} - name: CI script run: | diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index c8892cc21891..14e9e91d907f 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -19,38 +19,18 @@ Getting Started New contributors are very welcome and needed. -Reviewing and testing is highly valued and the most effective way you can contribute -as a new contributor. It also will teach you much more about the code and -process than opening pull requests. Please refer to the [peer review](#peer-review) -section below. +In-depth reviewing and testing are the bottleneck of the project, and are the +most effective way anyone can start to contribute. It will teach you much more +about the code and process than opening pull requests, and may help you uncover +related issues and follow-ups to contribute code for. Please refer to the [peer +review](#peer-review) section below. Before you start contributing, familiarize yourself with the Bitcoin Core build system and tests. Refer to the documentation in the repository on how to build Bitcoin Core and how to run the unit tests, functional tests, and fuzz tests. -There are many open issues of varying difficulty waiting to be fixed. -If you're looking for somewhere to start contributing, check out the -[good first issue](https://github.com/bitcoin/bitcoin/issues?q=is%3Aopen+is%3Aissue+label%3A%22good+first+issue%22) -list or changes that are -[up for grabs](https://github.com/bitcoin/bitcoin/issues?utf8=%E2%9C%93&q=label%3A%22Up+for+grabs%22). -Some of them might no longer be applicable. So if you are interested, but -unsure, you might want to leave a comment on the issue first. - You may also participate in the [Bitcoin Core PR Review Club](https://bitcoincore.reviews/). -### Good First Issue Label - -The purpose of the `good first issue` label is to highlight which issues are -suitable for a new contributor without a deep understanding of the codebase. - -However, good first issues can be solved by anyone. If they remain unsolved -for a longer time, a frequent contributor might address them. - -You do not need to request permission to start working on an issue. However, -you are encouraged to leave a comment if you are planning to work on it. This -will help other contributors monitor which issues are actively being addressed -and is also an effective way to request assistance if and when you need it. - Communication Channels ---------------------- diff --git a/ci/README.md b/ci/README.md index 0f43b4f1f630..0b6a34460ca1 100644 --- a/ci/README.md +++ b/ci/README.md @@ -80,20 +80,22 @@ trigger cache-invalidation and rebuilds as necessary. To configure the primary repository, follow these steps: -1. Register with [Cirrus Runners](https://cirrus-runners.app/) and purchase runners. -2. Install the Cirrus Runners GitHub app against the GitHub organization. +1. Register with [WarpBuild](https://www.warpbuild.com/) and purchase runners. +2. Install the WarpBuild GitHub app against the GitHub organization. 3. Enable organisation-level runners to be used in public repositories: 1. `Org settings -> Actions -> Runner Groups -> Default -> Allow public repos` 4. Permit the following actions to run: 1. actions/cache/restore@\* 1. actions/cache/save@\* - 1. docker/setup-buildx-action@\* 1. actions/github-script@\* + 1. docker/setup-buildx-action@\* + 1. warpbuilds/cache/restore@\* + 1. warpbuilds/cache/save@\* ### Forked repositories When used in a fork the CI will run on GitHub's free hosted runners by default. In this case, GitHub's cache size limitations may cause caches to be frequently evicted and missed, but the workflows will run (slowly). -It is also possible to use your own Cirrus Runners in your own fork with an appropriate patch to the `REPO_USE_CIRRUS_RUNNERS` variable in ../.github/workflows/ci.yml -NB that Cirrus Runners only work at an organisation level, therefore in order to use your own Cirrus Runners, *the fork must be within your own organisation*. +It is also possible to use your own WarpBuild Runners in your own fork with an appropriate patch to the `REPO_USE_WARP_RUNNERS` variable in ../.github/workflows/ci.yml +NB that WarpBuild Runners only work at an organisation level, therefore in order to use your own WarpBuild Runners, *the fork must be within your own organisation*. diff --git a/ci/test/03_test_script.sh b/ci/test/03_test_script.sh index 8729b7c7cb18..837e661a9cc9 100755 --- a/ci/test/03_test_script.sh +++ b/ci/test/03_test_script.sh @@ -197,7 +197,7 @@ fi if [[ "${RUN_IWYU}" == true ]]; then # TODO: Consider enforcing IWYU across the entire codebase. - FILES_WITH_ENFORCED_IWYU="/src/(((crypto|index|kernel|primitives|univalue/(lib|test)|util)/.*|bench/(block_assemble|connectblock)|common/license_info|node/(blockstorage|interfaces|miner|mining_args|utxo_snapshot)|rpc/mining|clientversion|core_io|signet|init)\\.cpp)" + FILES_WITH_ENFORCED_IWYU="/src/(((crypto|index|kernel|primitives|script|univalue/(lib|test)|util)/.*|bench/(block_assemble|connectblock)|common/license_info|node/(blockstorage|interfaces|miner|mining_args|utxo_snapshot)|rpc/mining|clientversion|core_io|signet|init)\\.cpp)" jq --arg patterns "$FILES_WITH_ENFORCED_IWYU" 'map(select(.file | test($patterns)))' "${BASE_BUILD_DIR}/compile_commands.json" > "${BASE_BUILD_DIR}/compile_commands_iwyu_errors.json" jq --arg patterns "$FILES_WITH_ENFORCED_IWYU" 'map(select(.file | test($patterns) | not))' "${BASE_BUILD_DIR}/compile_commands.json" > "${BASE_BUILD_DIR}/compile_commands_iwyu_warnings.json" diff --git a/cmake/leveldb.cmake b/cmake/leveldb.cmake index cff8c61f96ca..b9246cf81030 100644 --- a/cmake/leveldb.cmake +++ b/cmake/leveldb.cmake @@ -56,7 +56,6 @@ target_compile_definitions(leveldb HAVE_FDATASYNC=$ HAVE_FULLFSYNC=$ HAVE_O_CLOEXEC=$ - FALLTHROUGH_INTENDED=[[fallthrough]] $<$>:LEVELDB_PLATFORM_POSIX> $<$:LEVELDB_PLATFORM_WINDOWS> $<$:_UNICODE;UNICODE> @@ -84,9 +83,6 @@ if(MSVC) _CRT_NONSTDC_NO_WARNINGS ) else() - try_append_cxx_flags("-Wconditional-uninitialized" TARGET nowarn_leveldb_interface SKIP_LINK - IF_CHECK_PASSED "-Wno-conditional-uninitialized" - ) try_append_cxx_flags("-Wcovered-switch-default" TARGET nowarn_leveldb_interface SKIP_LINK IF_CHECK_PASSED "-Wno-covered-switch-default" ) diff --git a/contrib/guix/guix-attest b/contrib/guix/guix-attest index b0ef28dc3f92..3d70731cbdb4 100755 --- a/contrib/guix/guix-attest +++ b/contrib/guix/guix-attest @@ -139,14 +139,6 @@ fi ## Attest ## ############## -# Usage: out_name $outdir -# -# HOST: The output directory being attested -# -out_name() { - basename "$(dirname "$1")" -} - shasum_already_exists() { cat < "${VAR_BASE}/precious_dirs" @@ -305,22 +286,6 @@ for host in $HOSTS; do make -C "${PWD}/depends" -j"$JOBS" download-"$(host_to_commonname "$host")" ${V:+V=1} ${SOURCES_PATH:+SOURCES_PATH="$SOURCES_PATH"} done -# Usage: outdir_for_host HOST SUFFIX -# -# HOST: The current platform triple we're building for -# -outdir_for_host() { - echo "${OUTDIR_BASE}/${1}${2:+-${2}}" -} - -# Usage: profiledir_for_host HOST SUFFIX -# -# HOST: The current platform triple we're building for -# -profiledir_for_host() { - echo "${PROFILES_BASE}/${1}${2:+-${2}}" -} - ######### # BUILD # @@ -356,7 +321,6 @@ for host in $HOSTS; do # for the particular $HOST we're building for export HOST="$host" - # shellcheck disable=SC2030 cat << EOF INFO: Building ${VERSION:?not set} for platform triple ${HOST:?not set}: ...using reference timestamp: ${SOURCE_DATE_EPOCH:?not set} @@ -364,9 +328,9 @@ INFO: Building ${VERSION:?not set} for platform triple ${HOST:?not set}: ...from worktree directory: '${PWD}' ...bind-mounted in container to: '/bitcoin' ...in build directory: '$(distsrc_for_host "$HOST")' - ...bind-mounted in container to: '$(DISTSRC_BASE=/distsrc-base && distsrc_for_host "$HOST")' + ...bind-mounted in container to: '$(distsrc_for_host "$HOST" "" /distsrc-base)' ...outputting in: '$(outdir_for_host "$HOST")' - ...bind-mounted in container to: '$(OUTDIR_BASE=/outdir-base && outdir_for_host "$HOST")' + ...bind-mounted in container to: '$(outdir_for_host "$HOST" "" /outdir-base)' ADDITIONAL FLAGS (if set) ADDITIONAL_GUIX_COMMON_FLAGS: ${ADDITIONAL_GUIX_COMMON_FLAGS} ADDITIONAL_GUIX_ENVIRONMENT_FLAGS: ${ADDITIONAL_GUIX_ENVIRONMENT_FLAGS} @@ -440,7 +404,7 @@ EOF # Please read the README.md in the same directory as this file for # more information. # - # shellcheck disable=SC2086,SC2031 + # shellcheck disable=SC2086 time-machine shell --manifest="${PWD}/contrib/guix/manifest_build.scm" \ --container \ --writable-root \ @@ -468,8 +432,8 @@ EOF ${SOURCES_PATH:+SOURCES_PATH="$SOURCES_PATH"} \ ${BASE_CACHE:+BASE_CACHE="$BASE_CACHE"} \ ${SDK_PATH:+SDK_PATH="$SDK_PATH"} \ - DISTSRC="$(DISTSRC_BASE=/distsrc-base && distsrc_for_host "$HOST")" \ - OUTDIR="$(OUTDIR_BASE=/outdir-base && outdir_for_host "$HOST")" \ + DISTSRC="$(distsrc_for_host "$HOST" "" /distsrc-base)" \ + OUTDIR="$(outdir_for_host "$HOST" "" /outdir-base)" \ DIST_ARCHIVE_BASE=/outdir-base/dist-archive \ bash -c "cd /bitcoin && bash contrib/guix/libexec/build.sh" ) diff --git a/contrib/guix/guix-codesign b/contrib/guix/guix-codesign index 8c8682ddd0af..8cc6993b824d 100755 --- a/contrib/guix/guix-codesign +++ b/contrib/guix/guix-codesign @@ -99,18 +99,10 @@ fi # Default to building for all supported HOSTs (overridable by environment) export HOSTS="${HOSTS:-x86_64-w64-mingw32 x86_64-apple-darwin arm64-apple-darwin}" -# Usage: distsrc_for_host HOST -# -# HOST: The current platform triple we're building for -# -distsrc_for_host() { - echo "${DISTSRC_BASE}/distsrc-${VERSION}-${1}-codesigned" -} - # Accumulate a list of build directories that already exist... hosts_distsrc_exists="" for host in $HOSTS; do - if [ -e "$(distsrc_for_host "$host")" ]; then + if [ -e "$(distsrc_for_host "$host" codesigned)" ]; then hosts_distsrc_exists+=" ${host}" fi done @@ -134,7 +126,7 @@ packages cache, the garbage collector roots for Guix environments, and the output directory. EOF for host in $hosts_distsrc_exists; do - echo " ${host} '$(distsrc_for_host "$host")'" + echo " ${host} '$(distsrc_for_host "$host" codesigned)'" done exit 1 else @@ -146,22 +138,18 @@ fi # Codesigning tarballs SHOULD exist ################ -# Usage: outdir_for_host HOST SUFFIX +# Usage: codesigning_tarball_for_host HOST [BASE] # # HOST: The current platform triple we're building for +# BASE: Optional. If provided, replaces ${OUTDIR_BASE} # -outdir_for_host() { - echo "${OUTDIR_BASE}/${1}${2:+-${2}}" -} - - codesigning_tarball_for_host() { case "$1" in *mingw*) - echo "$(outdir_for_host "$1")/${DISTNAME}-win64-codesigning.tar.gz" + echo "$(outdir_for_host "$1" "" "$2")/${DISTNAME}-win64-codesigning.tar.gz" ;; *darwin*) - echo "$(outdir_for_host "$1")/${DISTNAME}-${1}-codesigning.tar.gz" + echo "$(outdir_for_host "$1" "" "$2")/${DISTNAME}-${1}-codesigning.tar.gz" ;; *) exit 1 @@ -232,14 +220,6 @@ SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:-$(git -c log.showSignature=false log --f OUTDIR_BASE="${OUTDIR_BASE:-${VERSION_BASE}/output}" mkdir -p "$OUTDIR_BASE" -# Usage: profiledir_for_host HOST SUFFIX -# -# HOST: The current platform triple we're building for -# -profiledir_for_host() { - echo "${PROFILES_BASE}/${1}${2:+-${2}}" -} - ######### # BUILD # ######### @@ -274,16 +254,15 @@ for host in $HOSTS; do # for the particular $HOST we're building for export HOST="$host" - # shellcheck disable=SC2030 cat << EOF INFO: Codesigning ${VERSION:?not set} for platform triple ${HOST:?not set}: ...using reference timestamp: ${SOURCE_DATE_EPOCH:?not set} ...from worktree directory: '${PWD}' ...bind-mounted in container to: '/bitcoin' - ...in build directory: '$(distsrc_for_host "$HOST")' - ...bind-mounted in container to: '$(DISTSRC_BASE=/distsrc-base && distsrc_for_host "$HOST")' + ...in build directory: '$(distsrc_for_host "$HOST" codesigned)' + ...bind-mounted in container to: '$(distsrc_for_host "$HOST" codesigned /distsrc-base)' ...outputting in: '$(outdir_for_host "$HOST" codesigned)' - ...bind-mounted in container to: '$(OUTDIR_BASE=/outdir-base && outdir_for_host "$HOST" codesigned)' + ...bind-mounted in container to: '$(outdir_for_host "$HOST" codesigned /outdir-base)' ...using detached signatures in: '${DETACHED_SIGS_REPO:?not set}' ...bind-mounted in container to: '/detached-sigs' EOF @@ -340,7 +319,7 @@ EOF # Please read the README.md in the same directory as this file for # more information. # - # shellcheck disable=SC2086,SC2031 + # shellcheck disable=SC2086 time-machine shell --manifest="${PWD}/contrib/guix/manifest_codesign.scm" \ --container \ --writable-root \ @@ -364,11 +343,11 @@ EOF JOBS="$JOBS" \ SOURCE_DATE_EPOCH="${SOURCE_DATE_EPOCH:?unable to determine value}" \ ${V:+V=1} \ - DISTSRC="$(DISTSRC_BASE=/distsrc-base && distsrc_for_host "$HOST")" \ - OUTDIR="$(OUTDIR_BASE=/outdir-base && outdir_for_host "$HOST" codesigned)" \ + DISTSRC="$(distsrc_for_host "$HOST" codesigned /distsrc-base)" \ + OUTDIR="$(outdir_for_host "$HOST" codesigned /outdir-base)" \ DIST_ARCHIVE_BASE=/outdir-base/dist-archive \ DETACHED_SIGS_REPO=/detached-sigs \ - CODESIGNING_TARBALL="$(OUTDIR_BASE=/outdir-base && codesigning_tarball_for_host "$HOST")" \ + CODESIGNING_TARBALL="$(codesigning_tarball_for_host "$HOST" /outdir-base)" \ bash -c "cd /bitcoin && bash contrib/guix/libexec/codesign.sh" ) diff --git a/contrib/guix/libexec/prelude.bash b/contrib/guix/libexec/prelude.bash index 166675e8bf09..238527678979 100644 --- a/contrib/guix/libexec/prelude.bash +++ b/contrib/guix/libexec/prelude.bash @@ -2,10 +2,7 @@ export LC_ALL=C set -e -o pipefail -# shellcheck source=contrib/shell/realpath.bash source contrib/shell/realpath.bash - -# shellcheck source=contrib/shell/git-utils.bash source contrib/shell/git-utils.bash ################ @@ -80,6 +77,34 @@ time-machine() { -- "$@" } +# Usage: distsrc_for_host HOST [SUFFIX] [BASE] +# +# HOST: The current platform triple we're building for +# SUFFIX: Optional. If provided, appended to the directory name as "-SUFFIX" +# BASE: Optional. If provided, replaces ${DISTSRC_BASE} +# +distsrc_for_host() { + echo "${3:-${DISTSRC_BASE}}/distsrc-${VERSION}-${1}${2:+-${2}}" +} + +# Usage: outdir_for_host HOST [SUFFIX] [BASE] +# +# HOST: The current platform triple we're building for +# SUFFIX: Optional. If provided, appended to the directory name as "-SUFFIX" +# BASE: Optional. If provided, replaces ${OUTDIR_BASE} +# +outdir_for_host() { + echo "${3:-${OUTDIR_BASE}}/${1}${2:+-${2}}" +} + +# Usage: profiledir_for_host HOST [SUFFIX] +# +# HOST: The current platform triple we're building for +# SUFFIX: Optional. If provided, appended to the directory name as "-SUFFIX" +# +profiledir_for_host() { + echo "${PROFILES_BASE}/${1}${2:+-${2}}" +} ################ # Set common variables diff --git a/doc/bips.md b/doc/bips.md index 03ddf085cc02..5a9248bd83b7 100644 --- a/doc/bips.md +++ b/doc/bips.md @@ -40,6 +40,7 @@ BIPs that are implemented by Bitcoin Core: * [`BIP 155`](https://github.com/bitcoin/bips/blob/master/bip-0155.mediawiki): The 'addrv2' and 'sendaddrv2' messages which enable relay of Tor V3 addresses (and other networks) are supported as of **v0.21.0** ([PR 19954](https://github.com/bitcoin/bitcoin/pull/19954)). * [`BIP 159`](https://github.com/bitcoin/bips/blob/master/bip-0159.mediawiki): The `NODE_NETWORK_LIMITED` service bit is signalled as of **v0.16.0** ([PR 11740](https://github.com/bitcoin/bitcoin/pull/11740)), and such nodes are connected to as of **v0.17.0** ([PR 10387](https://github.com/bitcoin/bitcoin/pull/10387)). * [`BIP 173`](https://github.com/bitcoin/bips/blob/master/bip-0173.mediawiki): Bech32 addresses for native Segregated Witness outputs are supported as of **v0.16.0** ([PR 11167](https://github.com/bitcoin/bitcoin/pull/11167)). Bech32 addresses are generated by default as of **v0.20.0** ([PR 16884](https://github.com/bitcoin/bitcoin/pull/16884)). +* [`BIP 323`](https://github.com/bitcoin/bips/blob/master/bip-0323.mediawiki): BIP 9 bits 5 to 28 (inclusive) are ignored for soft-fork signalling and unknown soft fork warnings as of **v32.0**. * [`BIP 324`](https://github.com/bitcoin/bips/blob/master/bip-0324.mediawiki): The v2 transport protocol specified by BIP324 and the associated `NODE_P2P_V2` service bit are supported as of **v26.0**, but off by default ([PR 28331](https://github.com/bitcoin/bitcoin/pull/28331)). On by default as of **v27.0** ([PR 29347](https://github.com/bitcoin/bitcoin/pull/29347)). * [`BIP 325`](https://github.com/bitcoin/bips/blob/master/bip-0325.mediawiki): Signet test network is supported as of **v0.21.0** ([PR 18267](https://github.com/bitcoin/bitcoin/pull/18267)). * [`BIP 327`](https://github.com/bitcoin/bips/blob/master/bip-0327.mediawiki): Key aggregation via `musig()` descriptors is supported as of **v30.0** ([PR 31244](https://github.com/bitcoin/bitcoin/pull/31244)). Signing is supported as of **v31.0** ([PR 29675](https://github.com/bitcoin/bitcoin/pull/29675)) diff --git a/doc/build-unix.md b/doc/build-unix.md index 4b823566f762..e80158cc5501 100644 --- a/doc/build-unix.md +++ b/doc/build-unix.md @@ -1,11 +1,10 @@ -UNIX BUILD NOTES -==================== +# UNIX BUILD NOTES + Some notes on how to build Bitcoin Core in Unix. (For BSD specific instructions, see `build-*bsd.md` in this directory.) -To Build ---------------------- +## To Build ```bash cmake -B build @@ -18,8 +17,7 @@ cmake --install build # Optional ``` See below for instructions on how to [install the dependencies on popular Linux -distributions](#linux-distribution-specific-instructions), or the -[dependencies](#dependencies) section for a complete overview. +distributions](#dependencies). ## Memory Requirements @@ -40,15 +38,18 @@ Finally, clang (often less resource hungry) can be used instead of gcc, which is cmake -B build -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -## Linux Distribution Specific Instructions - -### Ubuntu & Debian - -#### Dependency Build Instructions +## Dependencies -Build requirements for the latest Debian "stable" release, or the latest Ubuntu LTS release: +You can either build from self-compiled [depends](/depends/README.md) or +install the dependencies from your distribution package manager. Dependencies +for additional features in later columns are optional. - sudo apt-get install build-essential cmake pkgconf python3 +| Package manager | Required build dependencies | SQLite (wallet) | Cap'n Proto (IPC) | ZMQ | USDT | Qt and libqrencode (GUI) | +| ----------------------- | --------------------------- | --------------- | ----------------- | --- | ---- | ------------------------ | +| Debian / Ubuntu (`apt`) | `build-essential cmake pkgconf python3 libevent-dev libboost-dev` | `libsqlite3-dev` | `libcapnp-dev capnproto` | `libzmq3-dev` | `systemtap-sdt-dev` | `qt6-base-dev qt6-tools-dev qt6-l10n-tools qt6-tools-dev-tools libgl-dev qt6-wayland libqrencode-dev` | +| Fedora (`dnf`) | `gcc-c++ cmake make python3 libevent-devel boost-devel` | `sqlite-devel` | `capnproto capnproto-devel` | `zeromq-devel` | `systemtap-sdt-devel` | `qt6-qtbase-devel qt6-qttools-devel qt6-qtwayland qrencode-devel` | +| Alpine (`apk`) | `build-base cmake linux-headers pkgconf python3 libevent-dev boost-dev` | `sqlite-dev` | `capnproto capnproto-dev` | `zeromq-dev` | Not supported | `qt6-qtbase-dev qt6-qttools-dev libqrencode-dev` | +| Arch (`pacman`) | `gcc make cmake pkgconf python libevent boost` | `sqlite` | `capnproto` | `zeromq` | `systemtap` | `qt6-base qt6-tools qt6-wayland qrencode` | For Debian "oldstable", or earlier Ubuntu LTS releases, you may need to pick a later compiler version, according to the [dependencies](/doc/dependencies.md) diff --git a/doc/release-notes-34779.md b/doc/release-notes-34779.md new file mode 100644 index 000000000000..7f1f5099d064 --- /dev/null +++ b/doc/release-notes-34779.md @@ -0,0 +1,5 @@ +Logging +------- + +- BIP 9 bits 5 to 28 inclusive are now ignored for soft fork signaling, as per BIP 323. We won't + warn about unknown deployments when receiving blocks that set any of those bits in their version. diff --git a/doc/release-notes-35319.md b/doc/release-notes-35319.md new file mode 100644 index 000000000000..6b7299693105 --- /dev/null +++ b/doc/release-notes-35319.md @@ -0,0 +1,20 @@ +P2P and network changes +----------------------- + +- Fix a possible leak of the originator's IP address for transactions sent with +`sendrawtransaction` RPC when `-privatebroadcast=1`. When Bitcoin Core connects +to a peer, if that peer has been advertised to support P2P protocol v2, then +Bitcoin Core tries to use the v2 protocol and if that fails it retries the +connection using the v1 protocol. When the private broadcast is about to send a +transaction to an IPv4 or IPv6 peer it overrides the normal proxy selection and +forces the connection through the Tor proxy (and thus through the Tor network, +protecting the sender's IP address). However if v2 protocol is tried and it +fails, then the v1 retry connection would be made disregarding the "override +proxy" request, possibly making an IPv4 or IPv6 direct connection. In other +words, for this to happen the following must be true: + 1. An IPv4 or IPv6 address has been advertised to the sender, indicating v2 + support. + 2. The sender must have Tor configured. + 3. The sender's configuration must be such that connections to IPv4 or IPv6 + are made directly (no `-proxy=` is used for IPv4 or IPv6). + 4. The recipient does not support v2 (the flags from 1. are bogus). (#35319) diff --git a/src/bench/verify_script.cpp b/src/bench/verify_script.cpp index 8f07fd34fd17..63a9544ad981 100644 --- a/src/bench/verify_script.cpp +++ b/src/bench/verify_script.cpp @@ -4,6 +4,7 @@ #include #include +#include #include #include #include diff --git a/src/chainparams.cpp b/src/chainparams.cpp index 32c3bff73482..cba8fd27894d 100644 --- a/src/chainparams.cpp +++ b/src/chainparams.cpp @@ -23,29 +23,8 @@ using util::SplitString; -void ReadSigNetArgs(const ArgsManager& args, CChainParams::SigNetOptions& options) -{ - if (!args.GetArgs("-signetseednode").empty()) { - options.seeds.emplace(args.GetArgs("-signetseednode")); - } - if (!args.GetArgs("-signetchallenge").empty()) { - const auto signet_challenge = args.GetArgs("-signetchallenge"); - if (signet_challenge.size() != 1) { - throw std::runtime_error("-signetchallenge cannot be multiple values."); - } - const auto val{TryParseHex(signet_challenge[0])}; - if (!val) { - throw std::runtime_error(strprintf("-signetchallenge must be hex, not '%s'.", signet_challenge[0])); - } - options.challenge.emplace(*val); - } -} - -void ReadRegTestArgs(const ArgsManager& args, CChainParams::RegTestOptions& options) +static void HandleDeploymentArgs(const ArgsManager& args, CChainParams::DeploymentOptions& options) { - if (auto value = args.GetBoolArg("-fastprune")) options.fastprune = *value; - if (HasTestOption(args, "bip94")) options.enforce_bip94 = true; - for (const std::string& arg : args.GetArgs("-testactivationheight")) { const auto found{arg.find('@')}; if (found == std::string::npos) { @@ -107,6 +86,43 @@ void ReadRegTestArgs(const ArgsManager& args, CChainParams::RegTestOptions& opti } } +void ReadMainNetArgs(const ArgsManager& args, CChainParams::MainNetOptions& options) +{ + HandleDeploymentArgs(args, options.dep_opts); +} + +void ReadTestNetArgs(const ArgsManager& args, CChainParams::TestNetOptions& options) +{ + HandleDeploymentArgs(args, options.dep_opts); +} + +void ReadSigNetArgs(const ArgsManager& args, CChainParams::SigNetOptions& options) +{ + if (!args.GetArgs("-signetseednode").empty()) { + options.seeds.emplace(args.GetArgs("-signetseednode")); + } + if (!args.GetArgs("-signetchallenge").empty()) { + const auto signet_challenge = args.GetArgs("-signetchallenge"); + if (signet_challenge.size() != 1) { + throw std::runtime_error("-signetchallenge cannot be multiple values."); + } + const auto val{TryParseHex(signet_challenge[0])}; + if (!val) { + throw std::runtime_error(strprintf("-signetchallenge must be hex, not '%s'.", signet_challenge[0])); + } + options.challenge.emplace(*val); + } + HandleDeploymentArgs(args, options.dep_opts); +} + +void ReadRegTestArgs(const ArgsManager& args, CChainParams::RegTestOptions& options) +{ + if (auto value = args.GetBoolArg("-fastprune")) options.fastprune = *value; + if (HasTestOption(args, "bip94")) options.enforce_bip94 = true; + + HandleDeploymentArgs(args, options.dep_opts); +} + static std::unique_ptr globalChainParams; const CChainParams &Params() { @@ -117,12 +133,21 @@ const CChainParams &Params() { std::unique_ptr CreateChainParams(const ArgsManager& args, const ChainType chain) { switch (chain) { - case ChainType::MAIN: - return CChainParams::Main(); - case ChainType::TESTNET: - return CChainParams::TestNet(); - case ChainType::TESTNET4: - return CChainParams::TestNet4(); + case ChainType::MAIN: { + auto opts = CChainParams::MainNetOptions{}; + ReadMainNetArgs(args, opts); + return CChainParams::Main(opts); + } + case ChainType::TESTNET: { + auto opts = CChainParams::TestNetOptions{}; + ReadTestNetArgs(args, opts); + return CChainParams::TestNet(opts); + } + case ChainType::TESTNET4: { + auto opts = CChainParams::TestNetOptions{}; + ReadTestNetArgs(args, opts); + return CChainParams::TestNet4(opts); + } case ChainType::SIGNET: { auto opts = CChainParams::SigNetOptions{}; ReadSigNetArgs(args, opts); diff --git a/src/chainparamsbase.cpp b/src/chainparamsbase.cpp index d816d1af91c3..f62e455fac45 100644 --- a/src/chainparamsbase.cpp +++ b/src/chainparamsbase.cpp @@ -16,10 +16,10 @@ void SetupChainParamsBaseOptions(ArgsManager& argsman) argsman.AddArg("-chain=", "Use the chain (default: main). Allowed values: " LIST_CHAIN_NAMES, ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS); argsman.AddArg("-regtest", "Enter regression test mode, which uses a special chain in which blocks can be solved instantly. " "This is intended for regression testing tools and app development. Equivalent to -chain=regtest.", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::CHAINPARAMS); - argsman.AddArg("-testactivationheight=name@height.", "Set the activation height of 'name' (segwit, bip34, dersig, cltv, csv). (regtest-only)", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST); + argsman.AddArg("-testactivationheight=name@height.", "Set the activation height of 'name' (segwit, bip34, dersig, cltv, csv). (test-only)", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::DEBUG_TEST); argsman.AddArg("-testnet", "Use the testnet3 chain. Equivalent to -chain=test. Support for testnet3 is deprecated and will be removed in an upcoming release. Consider moving to testnet4 now by using -testnet4.", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS); argsman.AddArg("-testnet4", "Use the testnet4 chain. Equivalent to -chain=testnet4.", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS); - argsman.AddArg("-vbparams=deployment:start:end[:min_activation_height]", "Use given start/end times and min_activation_height for specified version bits deployment (regtest-only)", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::CHAINPARAMS); + argsman.AddArg("-vbparams=deployment:start:end[:min_activation_height]", "Use given start/end times and min_activation_height for specified version bits deployment (test-only)", ArgsManager::ALLOW_ANY | ArgsManager::DEBUG_ONLY, OptionsCategory::CHAINPARAMS); argsman.AddArg("-signet", "Use the signet chain. Equivalent to -chain=signet. Note that the network is defined by the -signetchallenge parameter", ArgsManager::ALLOW_ANY, OptionsCategory::CHAINPARAMS); argsman.AddArg("-signetchallenge", "Blocks must satisfy the given script to be considered valid (only for signet networks; defaults to the global default signet test network challenge)", ArgsManager::ALLOW_ANY | ArgsManager::DISALLOW_NEGATION, OptionsCategory::CHAINPARAMS); argsman.AddArg("-signetseednode", "Specify a seed node for the signet network, in the hostname[:port] format, e.g. sig.net:1234 (may be used multiple times to specify multiple seed nodes; defaults to the global default signet test network seed node(s))", ArgsManager::ALLOW_ANY | ArgsManager::DISALLOW_NEGATION, OptionsCategory::CHAINPARAMS); diff --git a/src/core_io.cpp b/src/core_io.cpp index 584f823bae23..3650d70810a9 100644 --- a/src/core_io.cpp +++ b/src/core_io.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include