diff --git a/.clang-tidy b/.clang-tidy index dd95153ff5..fc067fde6f 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -100,9 +100,9 @@ Checks: "-*, # bugprone-crtp-constructor-accessibility, # bugprone-move-forwarding-reference, # bugprone-switch-missing-default-case, +# bugprone-unused-raii, # bugprone-unused-return-value, # bugprone-use-after-move, -# bugprone-unused-raii, # # cppcoreguidelines-misleading-capture-default-by-value, # cppcoreguidelines-init-variables, diff --git a/.github/workflows/on-pr.yml b/.github/workflows/on-pr.yml index b0010fe0ba..66893d19d3 100644 --- a/.github/workflows/on-pr.yml +++ b/.github/workflows/on-pr.yml @@ -141,9 +141,8 @@ jobs: needs: - should-run - build-test - # Only run when committing to a PR that targets a release branch in the - # XRPLF repository. - if: ${{ github.repository_owner == 'XRPLF' && needs.should-run.outputs.go == 'true' && startsWith(github.ref, 'refs/heads/release') }} + # Only run when committing to a PR that targets a release branch. + if: ${{ github.repository == 'XRPLF/rippled' && needs.should-run.outputs.go == 'true' && github.event_name == 'pull_request' && startsWith(github.event.pull_request.base.ref, 'release') }} uses: ./.github/workflows/reusable-upload-recipe.yml secrets: remote_username: ${{ secrets.CONAN_REMOTE_USERNAME }} diff --git a/.github/workflows/on-tag.yml b/.github/workflows/on-tag.yml index c6361b4016..af3ea4309e 100644 --- a/.github/workflows/on-tag.yml +++ b/.github/workflows/on-tag.yml @@ -17,8 +17,7 @@ defaults: jobs: upload-recipe: - # Only run when a tag is pushed to the XRPLF repository. - if: ${{ github.repository_owner == 'XRPLF' }} + if: ${{ github.repository == 'XRPLF/rippled' }} uses: ./.github/workflows/reusable-upload-recipe.yml secrets: remote_username: ${{ secrets.CONAN_REMOTE_USERNAME }} diff --git a/.github/workflows/on-trigger.yml b/.github/workflows/on-trigger.yml index c7e0e8c3aa..5856c67bd3 100644 --- a/.github/workflows/on-trigger.yml +++ b/.github/workflows/on-trigger.yml @@ -92,8 +92,8 @@ jobs: upload-recipe: needs: build-test - # Only run when pushing to the develop branch in the XRPLF repository. - if: ${{ github.repository_owner == 'XRPLF' && github.event_name == 'push' && github.ref == 'refs/heads/develop' }} + # Only run when pushing to the develop branch. + if: ${{ github.repository == 'XRPLF/rippled' && github.event_name == 'push' && github.ref == 'refs/heads/develop' }} uses: ./.github/workflows/reusable-upload-recipe.yml secrets: remote_username: ${{ secrets.CONAN_REMOTE_USERNAME }} diff --git a/.github/workflows/reusable-build-test-config.yml b/.github/workflows/reusable-build-test-config.yml index 75fe546b18..66f46709cd 100644 --- a/.github/workflows/reusable-build-test-config.yml +++ b/.github/workflows/reusable-build-test-config.yml @@ -176,7 +176,7 @@ jobs: fi - name: Upload the binary (Linux) - if: ${{ github.repository_owner == 'XRPLF' && runner.os == 'Linux' }} + if: ${{ github.repository == 'XRPLF/rippled' && runner.os == 'Linux' }} uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0 with: name: xrpld-${{ inputs.config_name }} @@ -266,7 +266,7 @@ jobs: --target coverage - name: Upload coverage report - if: ${{ github.repository_owner == 'XRPLF' && !inputs.build_only && env.COVERAGE_ENABLED == 'true' }} + if: ${{ github.repository == 'XRPLF/rippled' && !inputs.build_only && env.COVERAGE_ENABLED == 'true' }} uses: codecov/codecov-action@671740ac38dd9b0130fbe1cec585b89eea48d3de # v5.5.2 with: disable_search: true diff --git a/.github/workflows/reusable-clang-tidy.yml b/.github/workflows/reusable-clang-tidy.yml index 5319c1627a..3d4bc3b2e3 100644 --- a/.github/workflows/reusable-clang-tidy.yml +++ b/.github/workflows/reusable-clang-tidy.yml @@ -51,5 +51,5 @@ jobs: if: ${{ always() && !cancelled() && (!inputs.check_only_changed || needs.determine-files.outputs.any_cpp_changed == 'true' || needs.determine-files.outputs.clang_tidy_config_changed == 'true') }} uses: ./.github/workflows/reusable-clang-tidy-files.yml with: - files: ${{ (needs.determine-files.outputs.clang_tidy_config_changed == 'true' && '') || (inputs.check_only_changed && needs.determine-files.outputs.all_changed_files || '') }} + files: ${{ needs.determine-files.outputs.clang_tidy_config_changed == 'true' && '' || (inputs.check_only_changed && needs.determine-files.outputs.all_changed_files || '') }} create_issue_on_failure: ${{ inputs.create_issue_on_failure }} diff --git a/.github/workflows/reusable-upload-recipe.yml b/.github/workflows/reusable-upload-recipe.yml index 6245fd06e1..178dd65b8e 100644 --- a/.github/workflows/reusable-upload-recipe.yml +++ b/.github/workflows/reusable-upload-recipe.yml @@ -69,22 +69,28 @@ jobs: conan export . --version=${{ steps.version.outputs.version }} conan upload --confirm --check --remote="${REMOTE_NAME}" xrpl/${{ steps.version.outputs.version }} + # When this workflow is triggered by a push event, it will always be when merging into the + # 'develop' branch, see on-trigger.yml. - name: Upload Conan recipe (develop) - if: ${{ github.ref == 'refs/heads/develop' }} + if: ${{ github.event_name == 'push' }} env: REMOTE_NAME: ${{ inputs.remote_name }} run: | conan export . --version=develop conan upload --confirm --check --remote="${REMOTE_NAME}" xrpl/develop + # When this workflow is triggered by a pull request event, it will always be when merging into + # one of the 'release' branches, see on-pr.yml. - name: Upload Conan recipe (rc) - if: ${{ startsWith(github.ref, 'refs/heads/release') }} + if: ${{ github.event_name == 'pull_request' }} env: REMOTE_NAME: ${{ inputs.remote_name }} run: | conan export . --version=rc conan upload --confirm --check --remote="${REMOTE_NAME}" xrpl/rc + # When this workflow is triggered by a tag event, it will always be when tagging a final + # release, see on-tag.yml. - name: Upload Conan recipe (release) if: ${{ github.event_name == 'tag' }} env: diff --git a/.github/workflows/upload-conan-deps.yml b/.github/workflows/upload-conan-deps.yml index df8aa43a18..d0fea4b8ae 100644 --- a/.github/workflows/upload-conan-deps.yml +++ b/.github/workflows/upload-conan-deps.yml @@ -103,11 +103,11 @@ jobs: sanitizers: ${{ matrix.sanitizers }} - name: Log into Conan remote - if: ${{ github.repository_owner == 'XRPLF' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') }} + if: ${{ github.repository == 'XRPLF/rippled' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') }} run: conan remote login "${CONAN_REMOTE_NAME}" "${{ secrets.CONAN_REMOTE_USERNAME }}" --password "${{ secrets.CONAN_REMOTE_PASSWORD }}" - name: Upload Conan packages - if: ${{ github.repository_owner == 'XRPLF' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') }} + if: ${{ github.repository == 'XRPLF/rippled' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch') }} env: FORCE_OPTION: ${{ github.event.inputs.force_upload == 'true' && '--force' || '' }} run: conan upload "*" --remote="${CONAN_REMOTE_NAME}" --confirm ${FORCE_OPTION} diff --git a/src/xrpld/app/ledger/detail/LedgerReplayer.cpp b/src/xrpld/app/ledger/detail/LedgerReplayer.cpp index f649eb4d95..5aacf5b5a6 100644 --- a/src/xrpld/app/ledger/detail/LedgerReplayer.cpp +++ b/src/xrpld/app/ledger/detail/LedgerReplayer.cpp @@ -98,8 +98,12 @@ LedgerReplayer::createDeltas(std::shared_ptr task) { auto skipListItem = std::find(parameter.skipList_.begin(), parameter.skipList_.end(), parameter.startHash_); - if (skipListItem == parameter.skipList_.end() || - ++skipListItem == parameter.skipList_.end()) + auto const wasLast = skipListItem == parameter.skipList_.end(); + if (not wasLast) + ++skipListItem; + auto const isLast = skipListItem == parameter.skipList_.end(); + + if (wasLast || isLast) { JLOG(j_.error()) << "Task parameter error when creating deltas " << parameter.finishHash_;