Repository navigation
refactor(platform-wallet): check a converted evonode address map with rust-dashcore's Core rules - #5817
Conversation
… rust-dashcore's Core rules The V24 conversion of a legacy evonode into a version-3 address map was checked against a copy of Dash Core v24's port and duplicate-entry rules (IsBadPort ports, port 0, 443 only for Platform HTTPS, one address listed twice). rust-dashcore now ships those rules as ExtNetInfo::validate_ports_and_duplicates, so the wallet builds the map first and checks it with that helper; the copied port list and the two wallet checks are removed. The helper's error does not name the refused entry, so the wallet finds it by port in the converted map (one entry per purpose, all at the legacy IP) and keeps its existing messages: the purpose and port Core refuses, or the two services that would share a port. A future error variant falls back to a message carrying the helper's error. The accept/refuse set is unchanged. When a conversion breaks both rules at once, the duplicate is now reported first, the order Core applies. Tests: the existing conversion tests pass unchanged. Mutation checks through the new path: skipping the helper call fails both tests; naming the purpose of a different port fails the bad-port test; naming a different pair fails the repeated-address test. Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
No actionable comments were generated in the recent review. Walkthrough
Merge Risk:
|
|
Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post |
|
✅ Final review complete — no blockers (commit 8333330) · triage: low |
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Phase 1 + Phase 2
Verified the patch at 8333330 against the pinned rust-dashcore implementation: it preserves acceptance and rejection for converted maps, delegates validation to its owner, and safely retains wallet-specific diagnostics. No actionable defects remain; the proposed fallback test exercises an unreachable input shape, and richer upstream errors are an optional API enhancement. This was a static review; current CI reports wallet tests and Swift/Kotlin checks passing, with review and hygiene checks pending, while the earlier policy failure was an unrelated Python-download HTTP 504 and subsequent runs passed.
Review provenance
Source: reviewer 1: glm-5.3-flash (agent: phase1-reviewer, role: general); reviewer 2: glm-5.3-flash (agent: phase1-reviewer, role: rust-quality); reviewer 3: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 4: gpt-6.1-sol (agent: phase2-reviewer, role: architecture-layering); reviewer 5: gpt-6.1-sol (agent: phase2-reviewer, role: rust-quality); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)
- Triage:
lowbygpt-6.1-sol(effort low) — This is a contained single-file refactor replacing duplicated address-map validation with an existing Core helper while preserving rejection behavior and diagnostic messages apart from error precedence. - Phase 1 reviewers:
glm-5.3-flash— general (completed, effort high); agentphase1-reviewer,glm-5.3-flash— rust-quality (completed, effort high); agentphase1-reviewer - Phase 1 model:
glm-5.3-flash— zai quota: 5h 100% left, weekly 28% left; passed overgemini-3.8-flash-high(antigravity quota lookup failed) - Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort medium); agentphase2-reviewer,gpt-6.1-sol— architecture-layering (completed, effort medium); agentphase2-reviewer,gpt-6.1-sol— rust-quality (completed, effort medium); agentphase2-reviewer
|
Bots are done — your move: post |
…let-private-contact-requests v5.1-dev now carries #5809 (squash a8b4b49), #5817 and the v5.0-dev merge #5818. The one conflict, packages/rs-sdk/src/mock/provider.rs, was #5809's last commit (f597cd8, the mock context provider rechecking its cache), which this branch had not merged yet: it takes v5.1-dev's version, #5809's head. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…vate-contact-requests v5.1-dev now carries #5809 (squash a8b4b49), #5817 and the v5.0-dev merge #5818. Both conflicts were #5809 arriving twice: - packages/wasm-sdk/src/sdk.rs keeps this branch's version, which is #5809's unchanged file plus this branch's own changes; - packages/rs-sdk/src/mock/provider.rs takes v5.1-dev's version, #5809's last commit (f597cd8), which this branch had not merged yet. Co-Authored-By: Claude Opus 5.5 <[email protected]>
Issue being fixed or feature implemented
#5629 (shipped in 5.0.2, forward-merged into v5.1-dev) made
prepare_masternode_update_servicerefuse a legacy evonode's V24 conversion when Dash Core v24 would refuse the resulting version-3 address map. It did this with a copy of Core's rules:IsBadPort(ports 1–1023 plus Core's list of well-known ports) and port 0, with 443 allowed only for Platform HTTPS;That PR noted the copy would be replaced in v5.1 by rust-dashcore's
ExtNetInfo::validate_ports_and_duplicates(dashpay/rust-dashcore#1226). v5.1-dev's pin has carried that helper since #5729, so this PR makes the replacement.What was done?
In
packages/rs-platform-wallet/src/masternode/update_service.rs:ExtNetInfo::validate_ports_and_duplicates, in the newrequire_core_accepts_converted_net_info.CORE_PRIVILEGED_PORTS_THRESHOLD/CORE_BAD_PORTSconstants and the wallet's ownrequire_port_core_accepts/require_distinct_portschecks.ExtNetInfoErrordoesn't say which entry it refuses (BadPort(u16),Duplicate). A converted map has one entry per purpose, all at the legacy IP, so the wallet finds the entry by its port and keeps its two existing messages word for word:Dash Core v24 refuses {purpose} port {port}, … move the service to another port and register it with Dash Core's protx update_service_evo{other} and {purpose} would both use port {port}, … give each service its own portExtNetInfoErroris#[non_exhaustive]. A future variant, or a lookup that finds nothing, falls back to a refusal that includes the helper's error. It is never accepted.Behaviour: the set of conversions accepted and refused doesn't change. The map holds only IPv4/IPv6 service entries (never I2P or domain entries, never two entries for one purpose), and for that shape the helper applies the same rules the copy did. One difference: if a conversion breaks both rules at once (for example Core P2P and Platform P2P both on port 1), the duplicate is now reported first, because that is the order Core applies them in. Before, the bad port was reported first. The conversion is refused in both cases.
The error variant is still
PlatformWalletError::InvalidParameter, so the FFI, Swift and Kotlin error mappings don't change.Version-3 re-assertion and pre-V24 version-2 payloads still skip this check, as in #5629. Core has already accepted the on-chain map, and Core doesn't apply these rules to version-2 payloads.
How Has This Been Tested?
should_refuse_a_legacy_evonode_conversion_with_a_port_core_v24_refuses: every system and well-known port, 0, 443 outside Platform HTTPS, the 1/1023 boundaries; 443 and 1024+ accepted; each error names the purpose and port.should_refuse_a_legacy_evonode_conversion_that_repeats_an_address: Platform P2P on the Core P2P or Platform HTTPS port; the error names both services and the port.port_and_duplicate_rulestest cases in rust-dashcore.CoreP2P port 1reported asPlatformP2P port 1);cargo test -p platform-wallet -p platform-wallet-storage -p platform-wallet-ffi --all-features --locked --lib --bins --tests -- --skip wallet::shielded::, with CI's env (RUST_MIN_STACK=4194304,CARGO_PROFILE_DEV_DEBUG=0,CARGO_PROFILE_DEV_CODEGEN_UNITS=256): 3,095 passed, 0 failed (10 tests are#[ignore]on the base).platform-wallet,platform-wallet-storage,platform-wallet-ffi,rs-unified-sdk-ffi,rs-unified-sdk-jni;--all-targets --all-features --locked -- --no-deps -D warnings): clean.cargo fmt --check --all: clean.Breaking Changes
None. This only changes how the wallet builds a transaction; there is no consensus or protocol-version change.
Checklist:
structure.rs, regeneratedgrovedb-structure.json, and checked the structure viewer link posted on this pull requestFor repository code-owners and collaborators only
🤖 Generated with Claude Code
PR Hygiene ·
8333330/self-reviewedrs-platform-wallet(packages/rs-platform-wallet/src/masternode/update_service.rs) — HashEngineering or ZocoLini or llbartekll or romchornyiWhen every merge requirement is met, the
PR Hygienecheck passes. Reviewer limits do not block merging; other required GitHub checks and protections still apply.Summary by CodeRabbit