Skip to content

refactor: remove newly defined redundant constants with Network methods equivalents - #681

Merged
QuantumExplorer merged 1 commit into
claude/angry-panini-9132b2from
refactor/duplicated-const-drop
Apr 23, 2026
Merged

refactor: remove newly defined redundant constants with Network methods equivalents#681
QuantumExplorer merged 1 commit into
claude/angry-panini-9132b2from
refactor/duplicated-const-drop

Conversation

@ZocoLini

Copy link
Copy Markdown
Collaborator

No description provided.

@coderabbitai

coderabbitaiBot commented Apr 23, 2026

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 9cbbef59-ee7e-4962-8a9d-e8ae7a6b56de

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/duplicated-const-drop

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@codecov

codecovBot commented Apr 23, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.00000% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 69.81%. Comparing base (52a1353) to head (1664d42).
⚠️ Report is 1 commits behind head on claude/angry-panini-9132b2.

Files with missing linesPatch %Lines
dash-spv/src/network/discovery.rs80.00%1 Missing ⚠️
Additional details and impacted files
@@ Coverage Diff @@## claude/angry-panini-9132b2 #681 +/- ##
==============================================================
- Coverage 69.84% 69.81% -0.04% 
==============================================================
Files 320 319 -1 Lines 66705 66686 -19 ==============================================================
- Hits 46591 46556 -35 - Misses 20114 20130 +16 
FlagCoverage Δ
core75.81% <ø> (ø)
ffi42.20% <ø> (ø)
rpc20.00% <ø> (ø)
spv86.46% <80.00%> (-0.14%)⬇️
wallet68.79% <ø> (ø)
Files with missing linesCoverage Δ
dash-spv/src/network/discovery.rs71.21% <80.00%> (+5.03%)⬆️

... and 5 files with indirect coverage changes

@ZocoLini
ZocoLiniforce-pushed the claude/angry-panini-9132b2 branch from aa2ce5b to 52a1353CompareApril 23, 2026 19:03
@github-actionsgithub-actionsBot added the merge-conflict The PR conflicts with the target branch. label Apr 23, 2026
@github-actions

Copy link
Copy Markdown
Contributor

This PR has merge conflicts with the base branch. Please rebase or merge the base branch into your branch to resolve them.

@ZocoLini
ZocoLiniforce-pushed the refactor/duplicated-const-drop branch from 14fefb1 to 5c35147CompareApril 23, 2026 19:21
@github-actionsgithub-actionsBot removed the merge-conflict The PR conflicts with the target branch. label Apr 23, 2026
@ZocoLini
ZocoLiniforce-pushed the refactor/duplicated-const-drop branch from 5c35147 to 1664d42CompareApril 23, 2026 19:22
@QuantumExplorer
QuantumExplorer merged commit ac9f1a1 into claude/angry-panini-9132b2Apr 23, 2026
33 checks passed
@QuantumExplorer
QuantumExplorer deleted the refactor/duplicated-const-drop branch April 23, 2026 19:26
QuantumExplorer added a commit that referenced this pull request Apr 23, 2026
…#678)
* feat(dash-spv): hardcode masternode seed files with weekly auto-refresh
Replaces the small inline `TESTNET_FIXED_PEERS` list with versioned
seed files (`dash-spv/seeds/{mainnet,testnet}.txt`) embedded via
`include_str!`. Peer discovery now treats these as the primary source
and DNS resolution as a best-effort backup — DNS failures are logged
but never prevent bootstrap.
A new `masternode-seeds-fetcher` tooling crate queries
`masternode list json` via dashd RPC, filters to `ENABLED`, sorts &
dedupes, and writes the seed file. A scheduled workflow runs it
weekly for both networks and opens a PR when the output changes.
Closes#658
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(dash-spv): spell "unparsable" to satisfy typos hook
Pre-commit `typos` hook rejects "unparseable"; use "unparsable" in both
doc comment and tracing message.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* refactor(masternode-seeds-fetcher): source mnlist via P2P, drop RPC
The fetcher now connects to a peer from DNS seeds or the existing seed
file, runs the Dash P2P handshake, sends `sendheaders`, and waits for
the peer's next new-block announcement to obtain a fresh chain tip
hash. It then sends `getmnlistd` with base_block_hash=0 and uses the
returned `mnlistdiff` to extract valid masternode service addresses.
Removes all RPC-related args, env vars, and secrets plumbing — the
weekly CI workflow no longer needs `{MAINNET,TESTNET}_DASHD_RPC_*`
secrets and runs fully self-contained.
Verified end-to-end against live testnet peer 44.225.73.155:19999:
39s total runtime, 543 masternodes → 86 valid addresses written.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* feat(dash-network-seeds): extract seeds into standalone crate, differentiate evo/regular
Split the masternode IP seed lists out of `dash-spv` into a new,
lightweight `dash-network-seeds` crate. Consumers that only need a
bootstrap peer list (wallets, explorers, light clients) can now
depend on this crate directly without pulling in dash-spv's full
async/sync/storage stack.
Seed file format now differentiates regular vs Evo (HPMN) masternodes:
regular 1.2.3.4:9999
evo 68.67.122.1:19999
Lines with only a bare address are still accepted and default to
Regular for backwards compatibility.
The `dash-network-seeds` crate exposes:
- `seeds(Network)` — all entries
- `addresses(Network)` — addresses only
- `regular_seeds(Network)` / `evo_seeds(Network)` — filtered views
- `parse(raw, default_port)` — for tooling
- Optional `dashcore` feature provides `TryFrom<dashcore::Network>`
Counts at this commit (fetched live from the P2P network):
- mainnet: 2031 seeds = 1671 regular + 360 evo
- testnet: 86 seeds = 55 regular + 31 evo
`dash-spv` now pulls its seeds from the new crate; the fetcher writes
the new format to `dash-network-seeds/seeds/`; the weekly workflow and
`ci-groups.yml` are updated accordingly.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* fix(dash-network-seeds): keep dashcore default features to unblock CI
CI invokes `cargo test -p dash-network-seeds --all-features`, which
activates the `dashcore` optional feature. With `default-features =
false` that pulled dashcore in without `secp-recovery`, and dashcore's
own `signer.rs` uses `RecoverableSignature` / `RecoveryId` /
`sign_ecdsa_recoverable` / `recover_ecdsa` unconditionally — so
dashcore itself failed to compile.
Drop `default-features = false` so dashcore builds with its usual
defaults when our `dashcore` feature is enabled. Since `dashcore` is
still `optional = true`, users who don't turn it on still pull in
nothing beyond std.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* feat(dash-network-seeds): add per-node status columns (core/platform reach+sync, SSL)
Each seed line now carries best-effort probe results captured at the
moment the list was refreshed, alongside the masternode type and
Core P2P address.
Columns: <type> <addr> <platform_http_port|-> <core_reach> <core_sync> <plat_reach> <plat_live> <plat_ssl>
New probe types exposed from `dash-network-seeds`:
- Reachability: Unknown | Ok | Timeout | Refused | Error
- SyncStatus: Unknown | Synced | Behind(N) | Ahead(N)
- PlatformLiveness: Unknown | Ok | None
- SslStatus: Unknown | Valid | Expired | SelfSigned | Untrusted | NoHandshake
Plus:
- New `reachable_seeds` / `reachable_addresses` public functions for
consumers that only want nodes whose last probe succeeded.
- `MasternodeSeed::to_line()` / `Display` round-trip the full format.
- Legacy 1- and 2-column formats still parse for backwards compat.
`masternode-seeds-fetcher` now runs a probe phase after fetching the
mnlistdiff. For each masternode it:
* Opens TCP + Dash P2P handshake to the Core port, capturing
`start_height` for sync classification against the coinbase tip.
* For Evo nodes, opens TLS on `platform_http_port` with a custom
verifier that accepts any chain (we connect by IP, not hostname),
inspects the leaf cert via x509-parser for expired / self-signed
classification, then does a minimal HTTP GET to gauge liveness.
Probes run with bounded concurrency via tokio + FuturesUnordered;
`--skip-probes` and `--probe-concurrency` flags control behavior.
Live refresh results pushed in the same commit:
- mainnet: 2034 seeds (1674 regular + 360 evo), core_ok 1987/2034,
platform_ok 352/360, ssl_valid 294/360. Probes ran in 25 s.
- testnet: 86 seeds (55 regular + 31 evo), core_ok 85/86,
platform_ok 31/31, ssl_valid 28/31. Probes ran in 10 s.
CI workflow timeout bumped to 60 min and the run commands now pass
--probe-concurrency=100 for mainnet (64 for testnet).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
* replace new Network enum definition with dashcore::Network
* remove newly defined redundant constants with Network methods equivalents (#681)
* replace dashcore dep with dash-network
---------
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-authored-by: Borja Castellano <borjacastellano1@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants

@ZocoLini@QuantumExplorer