fix: disable geo IP diversity checks in devnet#19
Conversation
Devnet nodes were using production diversity defaults (geo checks, ASN limits, subnet limits), which is unnecessary for local testing. Set IPDiversityConfig::permissive() to disable all diversity enforcement in devnet nodes. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Greptile SummaryThis PR fixes a gap in the devnet code path where The one-line fix mirrors what Key points:
Confidence Score: 5/5
|
| Filename | Overview |
|---|---|
| src/devnet.rs | One-line fix that sets IPDiversityConfig::permissive() on devnet node configs during start_node; logically correct and scoped only to the devnet code path. Minor style inconsistency in how the type is referenced (inline submodule path vs. crate-root import used elsewhere). |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[saorsa-node binary\nNodeBuilder::build] -->|NetworkMode::Production| B[CoreDiversityConfig::default\ngeo checks + ASN + subnet limits]
A -->|NetworkMode::Testnet| C[CoreDiversityConfig::testnet\ncustomizable geo / ASN]
A -->|NetworkMode::Development| D[CoreDiversityConfig::permissive\nno checks]
E[saorsa-devnet binary\nDevnet::start_node] -->|Before this PR| F[No diversity_config set\nfalls back to saorsa-core default\nstrict checks block local nodes]
E -->|After this PR ✅| G[CoreDiversityConfig::permissive\nno diversity enforcement\nnodes connect freely]
style F fill:#ffcccc,stroke:#cc0000
style G fill:#ccffcc,stroke:#009900
style D fill:#ccffcc,stroke:#009900
Last reviewed commit: 6cd0d5e
There was a problem hiding this comment.
Pull request overview
This PR updates devnet node startup to disable IP diversity enforcement so local devnet nodes don’t get rejected due to production diversity defaults (geo/ASN/subnet limits).
Changes:
- Set a permissive
diversity_configon devnetCoreNodeConfigduring node startup to relax diversity checks.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
src/devnet.rs
Outdated
| .bootstrap_peers | ||
| .clone_from(&node.bootstrap_addrs); | ||
| core_config.max_message_size = Some(crate::ant_protocol::MAX_WIRE_MESSAGE_SIZE); | ||
| core_config.diversity_config = Some(CoreDiversityConfig::permissive()); |
There was a problem hiding this comment.
CoreDiversityConfig isn’t imported in this module, so this line won’t compile. Import saorsa_core::IPDiversityConfig (aliased as CoreDiversityConfig, consistent with src/node.rs) or use the fully-qualified path here.
Simplify import statement by directly using IPDiversityConfig in devnet.rs.
48bd6f2 to
230e9b4
Compare
dirvine
left a comment
There was a problem hiding this comment.
Thanks Mick. I checked this change and the devnet-only diversity override is scoped correctly.
Add unit and e2e tests covering the remaining Section 18 scenarios: Unit tests (32 new): - Quorum: #4 fail→abandoned, #16 timeout→inconclusive, #27 single-round dual-evidence, #28 dynamic threshold undersized, #33 batched per-key, #34 partial response unresolved, #42 quorum-derived paid-list auth - Admission: #5 unauthorized peer, #7 out-of-range rejected - Config: #18 invalid config rejected, #26 dynamic paid threshold - Scheduling: #8 dedup safety, #8 replica/paid collapse - Neighbor sync: #35 round-robin cooldown skip, #36 cycle completion, #38 snapshot stability mid-join, #39 unreachable removal + slot fill, #40 cooldown peer removed, #41 cycle termination guarantee, consecutive rounds, cycle preserves sync times - Pruning: #50 hysteresis prevents premature delete, #51 timestamp reset on heal, #52 paid/record timestamps independent, #23 entry removal - Audit: #19/#53 partial failure mixed responsibility, #54 all pass, #55 empty failure discard, #56 repair opportunity filter, response count validation, digest uses full record bytes - Types: #13 bootstrap drain, repair opportunity edge cases, terminal state variants - Bootstrap claims: #46 first-seen recorded, #49 cleared on normal E2e tests (4 new): - #2 fresh offer with empty PoP rejected - #5/#37 neighbor sync request returns response - #11 audit challenge multi-key (present + absent) - Fetch not-found for non-existent key Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Summary
IPDiversityConfigdefaults (geo checks, ASN limits, subnet limits), causing unnecessary restrictions during local testingIPDiversityConfig::permissive()on devnet node configs to disable all diversity enforcementTest plan
🤖 Generated with Claude Code