Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/ci-groups.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ groups:

spv:
- dash-spv
- dash-network-seeds

wallet:
- key-wallet
Expand All @@ -27,3 +28,4 @@ groups:
excluded:
- integration_test # Requires live Dash node
- dash-fuzz # Honggfuzz binary targets, tested by fuzz.yml
- masternode-seeds-fetcher # Tooling binary; needs live dashd RPC, exercised by update-masternode-seeds.yml

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

Exclusion comment is stale.

Per the PR summary and the fetcher refactor, masternode-seeds-fetcher no longer uses dashd RPC — it connects to the P2P network (getmnlistd/mnlistdiff) with no credentials. Update the comment so maintainers don't look for RPC plumbing that isn't there.

-  - masternode-seeds-fetcher  # Tooling binary; needs live dashd RPC, exercised by update-masternode-seeds.yml
+  - masternode-seeds-fetcher  # Tooling binary; connects to the live Dash P2P network, exercised by update-masternode-seeds.yml
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- masternode-seeds-fetcher # Tooling binary; needs live dashd RPC, exercised by update-masternode-seeds.yml
- masternode-seeds-fetcher # Tooling binary; connects to the live Dash P2P network, exercised by update-masternode-seeds.yml
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/ci-groups.yml at line 31, Update the stale exclusion comment for
"masternode-seeds-fetcher" in the .github/ci-groups.yml entry: replace the
existing note about requiring live dashd RPC with a concise statement that the
tool uses the P2P mesh (getmnlistd/mnlistdiff) and does not require dashd RPC or
credentials, so maintainers know to look at P2P behavior rather than RPC
plumbing.

82 changes: 82 additions & 0 deletions .github/workflows/update-masternode-seeds.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
name: Update masternode seeds

# Refreshes the hardcoded masternode IP lists shipped in `dash-network-seeds`
# by connecting to the Dash P2P network, discovering a recent chain tip via a
# new-block announcement, issuing a `getmnlistd` request, and writing the
# resulting masternode IP list (differentiated by regular/evo type). Opens a
# pull request if any seed file changed.
#
# Runs fully self-contained: no RPC credentials or repository secrets needed.
# The fetcher bootstraps peers from DNS seeds and the existing seed files.

on:
schedule:
# Every Monday at 06:00 UTC.
- cron: '0 6 * * 1'
workflow_dispatch:

permissions:
contents: write
pull-requests: write

jobs:
refresh:
name: Refresh masternode seed files
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v6

- uses: dtolnay/rust-toolchain@stable

- uses: Swatinem/rust-cache@v2
with:
shared-key: "masternode-seeds-fetcher"

- name: Build fetcher
run: cargo build --release -p masternode-seeds-fetcher

- name: Refresh mainnet seeds (with probes)
env:
RUST_LOG: info
run: |
./target/release/masternode-seeds-fetcher \
--network mainnet \
--out dash-network-seeds/seeds/mainnet.txt \
--max-peers 16 \
--probe-concurrency 100

- name: Refresh testnet seeds (with probes)
env:
RUST_LOG: info
run: |
./target/release/masternode-seeds-fetcher \
--network testnet \
--out dash-network-seeds/seeds/testnet.txt \
--max-peers 16 \
--probe-concurrency 64

- name: Verify parsed seed files still build
run: cargo test -p dash-network-seeds --lib

- name: Open pull request on change
uses: peter-evans/create-pull-request@v7
with:
commit-message: "chore(dash-spv): refresh masternode seed files"
title: "chore(dash-spv): refresh masternode seed files"
body: |
Weekly automated refresh of the hardcoded masternode IP lists
embedded in `dash-spv` (`dash-network-seeds/seeds/mainnet.txt`,
`dash-network-seeds/seeds/testnet.txt`).

Generated by `.github/workflows/update-masternode-seeds.yml`
via the `masternode-seeds-fetcher` crate, which fetches the
current masternode list from the Dash P2P network using a
`getmnlistd` request against a peer discovered through DNS
seeds and the existing seed files.
branch: chore/refresh-masternode-seeds
delete-branch: true
add-paths: |
dash-network-seeds/seeds/mainnet.txt
dash-network-seeds/seeds/testnet.txt
labels: automated
Comment on lines +62 to +82

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

find .github/workflows -name "*.yml" -o -name "*.yaml" | head -20

Repository: dashpay/rust-dashcore

Length of output: 373


🏁 Script executed:

cat -n .github/workflows/update-masternode-seeds.yml

Repository: dashpay/rust-dashcore

Length of output: 3471


🏁 Script executed:

cat -n .github/workflows/rust.yml | head -100

Repository: dashpay/rust-dashcore

Length of output: 2986


🏁 Script executed:

rg "spv" .github/workflows/ -A 3 -B 3

Repository: dashpay/rust-dashcore

Length of output: 5151


🏁 Script executed:

rg "pull_request" .github/workflows/rust.yml

Repository: dashpay/rust-dashcore

Length of output: 80


🏁 Script executed:

rg "dash-network-seeds" .github/scripts/ -l

Repository: dashpay/rust-dashcore

Length of output: 47


🌐 Web query:

GitHub Actions GITHUB_TOKEN pull_request workflow limitation

💡 Result:

The primary limitation of the GITHUB_TOKEN in GitHub Actions workflows triggered by pull_request events is that actions performed with it (e.g., pushing commits to the base branch or creating pull requests) will not trigger new workflow runs for most events (except workflow_dispatch and repository_dispatch). This prevents recursive or infinite workflow loops. For pull_request workflows (not pull_request_target) from forked repositories, the GITHUB_TOKEN has read-only permissions by default (write permissions are downgraded to read-only unless the repository setting "Send write tokens to workflows from pull requests" is enabled by an admin). This limits what the workflow can do, such as preventing pushes or modifications. Additionally, GITHUB_TOKEN has a rate limit of 1,000 requests per hour per repository (15,000 for GitHub Enterprise Cloud resources). To trigger workflows from a pull_request workflow using GITHUB_TOKEN actions, use a Personal Access Token (PAT) or GitHub App token instead.

Citations:


🏁 Script executed:

cat -n .github/scripts/ci_config.py | head -200

Repository: dashpay/rust-dashcore

Length of output: 7152


🏁 Script executed:

rg "dash-network-seeds|spv" .github/scripts/ci_config.py -A 2 -B 2

Repository: dashpay/rust-dashcore

Length of output: 47


🏁 Script executed:

cat .github/ci-groups.yml

Repository: dashpay/rust-dashcore

Length of output: 751


Auto-opened PRs won't trigger CI with the default GITHUB_TOKEN.

peter-evans/create-pull-request using the default GITHUB_TOKEN will open the PR, but per GitHub's documented limitation, events created by that token don't trigger on: pull_request workflows. The weekly seed-refresh PR will therefore land without running the normal CI suite (including the spv group that covers dash-network-seeds). Either use a PAT (or GitHub App token) via a token: input to enable automatic CI, or document that a maintainer must close/reopen the PR to trigger CI.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In @.github/workflows/update-masternode-seeds.yml around lines 62 - 82, The
workflow opens PRs using peter-evans/create-pull-request@v7 with the default
GITHUB_TOKEN which prevents on: pull_request CI from running; update the action
invocation (the block that includes uses: peter-evans/create-pull-request@v7 and
the with: inputs like commit-message/title/body/branch) to pass a token: input
referencing a repository secret (e.g., token: ${{ secrets.GITHUB_PAT }} or a
GitHub App token) so the created PR will trigger workflows, or alternatively add
a clear comment in the workflow body describing that maintainers must manually
close/reopen the PR to run CI if you prefer not to use a PAT.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[workspace]
members = ["dash", "dash-network", "hashes", "internals", "fuzz", "rpc-client", "rpc-json", "rpc-integration-test", "key-wallet", "key-wallet-manager", "key-wallet-ffi", "dash-spv", "dash-spv-ffi"]
members = ["dash", "dash-network", "hashes", "internals", "fuzz", "rpc-client", "rpc-json", "rpc-integration-test", "key-wallet", "key-wallet-manager", "key-wallet-ffi", "dash-spv", "dash-spv-ffi", "dash-network-seeds", "masternode-seeds-fetcher"]
resolver = "2"

[workspace.package]
Expand Down
11 changes: 11 additions & 0 deletions dash-network-seeds/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
[package]
name = "dash-network-seeds"
version = { workspace = true }
edition = "2024"
authors = ["Dash Core Team"]
description = "Hardcoded masternode IP seed lists for Dash mainnet and testnet, differentiated by regular/evo type. Refreshed weekly via CI from the live Dash P2P network."
license = "MIT"
repository = "https://github.com/dashpay/rust-dashcore"

[dependencies]
dash-network = { path = "../dash-network" }
Loading
Loading