Repository navigation
refactor(dpns): use the SDK for name registration, lookups and the voting-key check - #1073
Conversation
A contest refresh pass asked Platform for the contenders of every contest the app had ever seen, finished ones included: one request per contest, about a thousand on Testnet, 24 at a time. Since #901 that pass also runs on arrival at Masternodes > Votes and from a background timer, so it fired every few minutes. The SDK sends requests to five endpoints at a time and each allows 150 a minute; one pass went past that, the endpoints answered ResourceExhausted and were banned, and every other action shared the loss. - A stored contest that already has its outcome (awarded or locked) is final: a refresh that lists it stamps it as current and no longer queues a contender query for it. A pass now costs the contest list plus the contests that are still open. - Only one refresh pass runs at a time. The timer and a user refresh used to overlap and each walk the same unfilled cache. - Contender queries of a pass start no closer than 125 ms apart, so the first load of a long history stays inside the request budget instead of arriving as one burst. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012YneRVSNLhVnGiedWDr3fw
Pacing the contender queries made the first load of a long contest history take about two minutes, with the contests that can still be voted on sitting at a random alphabetical position in that queue. - The pass now waits for the contest end times (a query it already made) before it starts the contender queries, and reads the contests whose end time is in the future first. The unread history is back-filled after them. - The first 100 contender queries of a pass start at once; only the ones after them are paced. With 480 paced queries a minute that keeps a pass within 580 of the roughly 750 requests a minute the app has. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012YneRVSNLhVnGiedWDr3fw
On a first load the voting choices and the Votes badge waited for the whole paced back-fill, about two minutes for a thousand contests: both need each node's proved votes, and the pass read those only after its last contender query. Reading them earlier was not safe as it stood. A listed contest nobody has read yet has no end time and counts as open, so every unread finished contest would have shown as waiting for a vote. - While a pass runs, the names it has listed but not read, and has no end time to call open, are left out of the open contests. Each returns as soon as its contenders arrive, and whatever is left returns when the pass ends, however it ends. The set lives in memory only. - When a pass has such unread history, it proves the nodes' votes right after the open contests are read and refreshes the screen, then back-fills. The proof at the end of the pass is kept. A pass on a filled cache has nothing unread, takes neither step and sends the same requests as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012YneRVSNLhVnGiedWDr3fw
…tart The names a first load had listed but not read were kept out of the open contests by a set held in memory for the length of the pass. The early vote proof, however, is stored. Quitting during a first load and starting again within the proof's lifetime — or a pass that ended with names still unread — left every unread name counted as an open contest the node had not voted on: a badge in the hundreds and enabled choices on finished contests. - A name that was only listed (never read, no end time, no contenders) is not an open contest, wherever the open contests are read. The rule lives on the contest itself, so it holds in a new process and after any pass. The in-memory set, its guard and its lock are gone. - While a pass is running and unread names remain, To decide and Voted say the contests are still loading instead of saying none are open. Tests that seeded such a bare name as an open contest now give it an end time. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012YneRVSNLhVnGiedWDr3fw
…ntest data The contest refresh pass reported progress with TaskResult::Refresh: per list page, after the end-time read, per contender read and after the early vote proof. AppState answers each one with refresh() on the visible screen, so since the pass also runs by itself on a timer, any screen the user was on was told to start over several times a second: lookups lost their spinner and result, typed search text was cleared, amount fields disappeared while their limit was re-checked. The pass now sends TaskResult::DpnsContestsChanged. AppState merges it with adjacent cache notifications as it merges refreshes, and answers it with refresh() only when the visible screen is the Masternodes screen, the one screen that caches contest data. The badge, the attention chip and the identity home's pending-username indicator read live each frame, and the sender already requests the repaint they need. Unchanged: the pass's requests, order and pacing, the early vote proof, what the voting screen does per notification, and every other TaskResult::Refresh sender. Tests: a pass against a mock SDK sends the scoped notification and no TaskResult::Refresh; a withdrawal form on screen is not refreshed by it while a TaskResult::Refresh still refreshes it; an open Votes view shows a contest cached just before the notification. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012YneRVSNLhVnGiedWDr3fw
The pace only spaced out the spawning of contender queries; each spawned query then waited for one of the 24 slots on its own. While answers were slow the pace kept spawning, so queries piled up behind the slots and all started at once when the answers arrived, well above the request allowance. The dispatcher now takes the slot first and waits for the pace second, so a query starts as soon as it is spawned and no sooner than one pace after the query before it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012YneRVSNLhVnGiedWDr3fw
…ld-load-early-vote-state Brings in the fix that takes a query slot before waiting for the pace. Both dispatch calls of this branch, for the open contests and for the rest, now pass the shared slots and the contender query to start_in_order. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012YneRVSNLhVnGiedWDr3fw
The first-load test sampled the vote state for a second and relied on the paced back-fill outlasting that. A loaded machine could stretch the sampling past the end of the pass and fail the test. The pass now reports to a channel with room for one report, so it gets only as far as the reports the test takes: the proof is awaited report by report and the back-fill stays held while the vote state is checked. A second test answers every contender read. It checks that the votes are not proved before the read of the open contest has finished, and that history read to its outcome does not show as waiting for a vote while the rest is still unread. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012YneRVSNLhVnGiedWDr3fw
…contest-refresh-notifies-voting-screens-only Brings in the fix that takes a query slot before waiting for the pace and the first-load tests that hold the back-fill by its reports. No conflicts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012YneRVSNLhVnGiedWDr3fw
…r the proof The helper took reports until the stored proof became visible. Another worker could publish the proof right after an earlier report was taken, so the helper returned with a report still filling the one-slot channel. The pass then stayed blocked on its proof report and never began the back-fill, and the answered-history test failed with "no history was read". A pass sends its reports in a fixed order. Both tests now take exactly the reports up to and including the proof report, which puts the pass in the back-fill whichever task ran first, and then check the vote state. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012YneRVSNLhVnGiedWDr3fw
…contest-refresh-notifies-voting-screens-only Brings in the first-load tests that take a fixed number of pass reports instead of polling for the proof. No conflicts. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012YneRVSNLhVnGiedWDr3fw
Conflict in CHANGELOG.md: both entries kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012YneRVSNLhVnGiedWDr3fw
…-early-vote-state Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012YneRVSNLhVnGiedWDr3fw
…-refresh-notifies-voting-screens-only Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012YneRVSNLhVnGiedWDr3fw
* fix(dpns): let operators vote while a long contest history loads On a first load the voting choices and the Votes badge waited for the whole paced back-fill, about two minutes for a thousand contests: both need each node's proved votes, and the pass read those only after its last contender query. Reading them earlier was not safe as it stood. A listed contest nobody has read yet has no end time and counts as open, so every unread finished contest would have shown as waiting for a vote. - While a pass runs, the names it has listed but not read, and has no end time to call open, are left out of the open contests. Each returns as soon as its contenders arrive, and whatever is left returns when the pass ends, however it ends. The set lives in memory only. - When a pass has such unread history, it proves the nodes' votes right after the open contests are read and refreshes the screen, then back-fills. The proof at the end of the pass is kept. A pass on a filled cache has nothing unread, takes neither step and sends the same requests as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012YneRVSNLhVnGiedWDr3fw * fix(dpns): keep unread contest names out of the open list after a restart The names a first load had listed but not read were kept out of the open contests by a set held in memory for the length of the pass. The early vote proof, however, is stored. Quitting during a first load and starting again within the proof's lifetime — or a pass that ended with names still unread — left every unread name counted as an open contest the node had not voted on: a badge in the hundreds and enabled choices on finished contests. - A name that was only listed (never read, no end time, no contenders) is not an open contest, wherever the open contests are read. The rule lives on the contest itself, so it holds in a new process and after any pass. The in-memory set, its guard and its lock are gone. - While a pass is running and unread names remain, To decide and Voted say the contests are still loading instead of saying none are open. Tests that seeded such a bare name as an open contest now give it an end time. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012YneRVSNLhVnGiedWDr3fw * test(dpns): hold the contest back-fill by its reports instead of by time The first-load test sampled the vote state for a second and relied on the paced back-fill outlasting that. A loaded machine could stretch the sampling past the end of the pass and fail the test. The pass now reports to a channel with room for one report, so it gets only as far as the reports the test takes: the proof is awaited report by report and the back-fill stays held while the vote state is checked. A second test answers every contender read. It checks that the votes are not proved before the read of the open contest has finished, and that history read to its outcome does not show as waiting for a vote while the rest is still unread. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012YneRVSNLhVnGiedWDr3fw * test(dpns): take a fixed number of pass reports instead of polling for the proof The helper took reports until the stored proof became visible. Another worker could publish the proof right after an earlier report was taken, so the helper returned with a report still filling the one-slot channel. The pass then stayed blocked on its proof report and never began the back-fill, and the answered-history test failed with "no history was read". A pass sends its reports in a fixed order. Both tests now take exactly the reports up to and including the proof report, which puts the pass in the back-fill whichever task ran first, and then check the vote state. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012YneRVSNLhVnGiedWDr3fw --------- Co-authored-by: Lukasz Klimek <842586+lklimek@users.noreply.github.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
…x/contest-refresh-notifies-voting-screens-only The squash commit's tree equals this branch's already-merged view of #1067 on top of its parent, so it is recorded as merged without changes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012YneRVSNLhVnGiedWDr3fw
Conflict in CHANGELOG.md: both entries kept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012YneRVSNLhVnGiedWDr3fw
…-notifies-voting-screens-only Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012YneRVSNLhVnGiedWDr3fw
…voting-key helpers Loading a masternode or evonode now uses `voter_identity_id` and `select_voting_key` from the SDK instead of DET's own derivation and key matching. The typed `ProTxHash` guards the byte-order trap the raw derivation left open. Behaviour change: a voting key the network has disabled (what replacing the key leaves behind) is refused at load time with its own message. Before, such a node loaded fine and only failed later, when voting. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012YneRVSNLhVnGiedWDr3fw
Name -> identity lookups (load identity by name, DashPay contact requests), the DashPay prefix search and the per-contact username read now call `Sdk::resolve_dpns_name`, `Sdk::search_dpns_names` and `Sdk::get_dpns_usernames_by_identity` instead of hand-written DPNS document queries. `extract_identity_id_from_dpns_document` loses its last caller and goes. Behaviour: a name whose record carries its identity as plain bytes now resolves; a name document without a readable record is reported as "name not found" rather than as an invalid document. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012YneRVSNLhVnGiedWDr3fw
Four identity-loading paths (by id, by name, from a wallet, discovery) each carried a copy of the `records.identity` name query and its decoding. They now call the existing `fetch_owned_dpns_names`. The SDK's owned-names reader was not used on purpose: it drops the document timestamps DET shows as the registration date, and the platform-wallet reader that keeps them needs a wallet handle a masternode-only install does not have. Behaviour: a failed name read while loading by name now carries the same "could not look up names" message as the other loading paths, and a name document whose label is not text is skipped instead of being listed with an empty name. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012YneRVSNLhVnGiedWDr3fw
`register_dpns_name` no longer builds the `preorder` and `domain` documents or broadcasts them itself: `Sdk::register_dpns_name` does. Every guard around the broadcast is unchanged: name validation, the vote-fee approval, the availability re-check before paying, and `resolve_failed_domain_broadcast` for a name request that failed after the first document was paid for. The SDK reports one error for both documents. Its `preorder_callback` fires between them, once the first is confirmed, and that is what keeps "nothing was sent" apart from "the name request failed and may have been applied" - the distinction that stops a user paying twice. The contest rule is asked of the network's DPNS contract through Platform's own `contested_vote_poll_for_document_properties`, so the approval check needs no document to classify. A registered name and its date now come from the confirmed document instead of a second read of the identity's names; a registration accepted as sent after an error keeps the local-time entry. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012YneRVSNLhVnGiedWDr3fw
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012YneRVSNLhVnGiedWDr3fw
…ent fixture The contest rule is now asked about all four name fields of a `domain` document, not only the two the current contract matches on, so a contract that matches on another name field cannot read as "no vote" while the approval check is deciding a fee. Three test modules built their own DPNS name document; they share one fixture now. The `model::dpns` module note no longer mentions the document helper that was removed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012YneRVSNLhVnGiedWDr3fw
The branch was cut from the pre-squash head of #1071, whose tree equals f4962f0, so this records the base without changing any file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012YneRVSNLhVnGiedWDr3fw
|
Waiting for bot review — coderabbitai ✓ · thepastaclaw not yet. Wait for the missing reviews, or a writer can post |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
📝 Walkthrough
Merge Risk: ⚪ Minimal · up to No newly established issue prevents merging after normal checks. Pre-merge checks |
|
|
✅ Final review complete — no blockers (commit 44fcc5c) · triage: critical · Phase 2 only (no Phase 1 for this repository) |
thepastaclaw
left a comment
There was a problem hiding this comment.
Final validation — Phase 2 only (no Phase 1 for this repository)
The production callback is correctly wired, and the pinned SDK invokes it after preorder confirmation and before submitting the domain document; no blocking issue was confirmed. The new tests leave that callback-to-failure-classification connection unexercised, so one non-blocking coverage suggestion remains. Validation was static only: the supplied CI snapshot shows Clippy passing and the Test Suite still running.
🟡 1 suggestion(s)
Review provenance
Source: reviewer 1: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 2: gpt-6.1-sol (agent: phase2-reviewer, role: rust-quality); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)
- Triage:
criticalbygpt-6.1-sol(effort low) — The cross-cutting refactor includes intricate changes in src/backend_task/identity/register_dpns_name.rs to paid registration broadcasts, fee-approval classification, and post-payment failure handling that prevents duplicate payments, directly changing a funds-movement surface. - Phase 1 reviewers: not run (disabled for this repository)
- Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort xhigh); agentphase2-reviewer,gpt-6.1-sol— rust-quality (completed, effort xhigh); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.
In `src/backend_task/identity/register_dpns_name.rs`:
- [SUGGESTION] src/backend_task/identity/register_dpns_name.rs:569-578: Exercise the actual preorder callback in the paid-stage failure test
This test passes `true` directly to `BroadcastFailure::at_stage`, so it verifies the classifier but not the new callback wiring that records preorder confirmation. The adapter test at lines 582–601 exercises only failure before confirmation, while the reconciliation tests call `resolve_failed_domain_broadcast` directly. Removing `preorder_callback` or updating a different flag would therefore leave these tests green while incorrectly routing a post-preorder failure through the plain failure path instead of payment reconciliation. The production wiring and the pinned SDK's callback ordering are correct today, making this a non-blocking regression-coverage gap. Add a narrow injectable SDK invocation seam that receives the production `SdkRegistrationInput`, invokes its actual callback, and returns an SDK error; assert that the adapter returns `BroadcastFailure::Domain` rather than `Preorder`.
|
Policy satisfied — this can merge. |
Nothing checked that `broadcast_name_registration` hands the SDK a callback that sets the flag it reads afterwards: dropping the callback kept every test green while a failure after the paid first document would have been reported as a plain failure. The SDK call is now passed into `broadcast_name_registration_with`, so a test can stand in for the SDK: invoke the real callback from the input production code built, fail, and expect the paid stage. Production calls the same function with `Sdk::register_dpns_name`; behaviour is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012YneRVSNLhVnGiedWDr3fw
…platform addresses Adds `test_register_dpns_name_funded_from_platform_addresses` next to the Core-funded test. It spends no Core funds: it reads the credits already on the framework wallet's platform addresses, fails early with needed vs available credits when one address cannot cover the run, registers an identity from that address and then a 20+ character name, and verifies the name by search. The identity index is drawn from 1,000,000..2,000,000 and confirmed unused by asking the network for every key derived at that index. The amounts come from the app's fee estimator; the name allowance covers 4 KiB of stored data. Passed on testnet against this branch: the creation fee was charged to the credits left on the funding address, and the name cost 75,646,740 credits against an allowance of 112,510,400. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012YneRVSNLhVnGiedWDr3fw
|
Waiting for bot review — coderabbitai not yet · thepastaclaw ✓. Wait for the missing reviews, or a writer can post |
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 2 only (no Phase 1 for this repository)
Verified the complete diff at head 7faaacf and the relevant pinned SDK implementations; no blocking defects were found, and the prior preorder-callback coverage finding is fixed. One non-blocking coverage gap remains in the successful registration's confirmation-date wiring. This was a static review: the supplied exact-head CI snapshot reports successful Test Suite, Clippy, and Platform pin guard checks, with PR Hygiene pending; the ignored live-network test was not independently reproduced.
🟡 1 suggestion(s)
Review provenance
Source: reviewer 1: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 2: gpt-6.1-sol (agent: phase2-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: rust-quality); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)
- Triage:
criticalbygpt-6.1-sol(effort low) — The cross-cutting refactor changes paid DPNS registration in src/backend_task/identity/register_dpns_name.rs, replacing document construction and broadcasts with an SDK call whose callback determines whether a failure occurred after payment and how double-payment protection applies. - Phase 1 reviewers: not run (disabled for this repository)
- Fresh final gate: an independent Phase-2 review ran after iterative findings were reconciled
- Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort xhigh); agentphase2-reviewer,gpt-6.1-sol— rust-quality (completed, effort xhigh); agentphase2-reviewer,gpt-6.1-sol— general (completed, effort xhigh); agentphase2-reviewer,gpt-6.1-sol— rust-quality (completed, effort xhigh); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify each finding against the current code and only fix it if needed.
In `src/backend_task/identity/register_dpns_name.rs`:
- [SUGGESTION] src/backend_task/identity/register_dpns_name.rs:532-541: Exercise the successful registration’s confirmation-date wiring
This test passes `Some(4_242)` directly to `finish_username_registration`, so it verifies persistence of a supplied date but bypasses extraction from the successful SDK response at line 207. Changing that success arm to `Ok(_) => None` would restore local-time dates without affecting this assertion. The new backend-e2e test also checks only the registration outcome and resolved identity, then loads the identity by name, which re-fetches and saves its names. Add a success-path test with a controlled confirmed document timestamp that reaches persistence through the production registration wiring. Alternatively, extend the live test to compare the locally saved date with the network document's timestamp immediately after registration, before `SearchIdentityByDpnsName` refreshes the owned names.
…ent's date Nothing checked that the success arm of the registration broadcast feeds the confirmed name document's date into what is saved: the only date test handed a timestamp straight to `finish_username_registration`, so `Ok(_) => None` would have brought local-time dates back unnoticed. The SDK call is now passed into `register_dpns_name_through`, one level above the previous seam, which `broadcast_name_registration` absorbs. A test runs the whole registration with a stand-in that returns a name document dated 4242 and expects that date on the saved name. Production passes `Sdk::register_dpns_name`; behaviour is unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Waiting for bot review — coderabbitai ✓ · thepastaclaw not yet. Wait for the missing reviews, or a writer can post |
thepastaclaw
left a comment
There was a problem hiding this comment.
Re-review — Final validation — Phase 2 only (no Phase 1 for this repository)
Independently reviewed the complete diff at 44fcc5c against the pinned SDK implementation and found no actionable in-scope issues. Both prior coverage suggestions are fixed: the tests now exercise production preorder-callback wiring and confirmed-document date persistence. This was static verification only; the supplied CI snapshot shows Clippy and Test Suite still running, with Platform pin guard passing.
🔴 0 blocking | 🟡 0 suggestion(s) | 💬 0 nitpick(s)
Review provenance
Source: reviewer 1: gpt-6.1-sol (agent: phase2-reviewer, role: general); reviewer 2: gpt-6.1-sol (agent: phase2-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: rust-quality); final verifier: gpt-6.1-sol (agent: sol-verifier, role: final-verifier)
- Triage:
criticalbygpt-6.1-sol(effort low) — The substantial refactor in src/backend_task/identity/register_dpns_name.rs changes paid registration broadcasts, signer handoff, and callback-based failure classification that prevents repeat payment, meeting the intricate-change and funds-movement criteria. - Phase 1 reviewers: not run (disabled for this repository)
- Fresh final gate: an independent Phase-2 review ran after iterative findings were reconciled
- Fresh verifier:
gpt-6.1-sol— final-verifier; agentsol-verifier - Phase 2 reviewers:
gpt-6.1-sol— general (completed, effort xhigh); agentphase2-reviewer,gpt-6.1-sol— rust-quality (completed, effort xhigh); agentphase2-reviewer,gpt-6.1-sol— general (completed, effort xhigh); agentphase2-reviewer,gpt-6.1-sol— rust-quality (completed, effort xhigh); agentphase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review. Verify the current code and confirm that no unresolved issues remain.
No unresolved findings remain from the prior review on this head.
|
Ready for review — files with no dedicated owner: lklimek. |
|
Policy satisfied — this can merge. |
TL;DR: The app now uses the Dash SDK's own functions to register usernames, look names up and check a masternode's voting key, instead of keeping its own copies. One visible fix: a node whose voting key was replaced on the network is refused when you add it, not later when a vote fails.
User story
As a masternode owner, I want to be told right away that the voting key I entered is no longer active on my node, so that I do not find out only when my vote is refused.
As a user registering a username, I want registration to behave exactly as before, including never being invited to pay twice, and I want the new name to show the date the network confirmed it.
Scenario
Base flow
Actual behavior
Expected behavior
Detailed discussion
What was done
Three areas move from hand-written code to SDK functions. No stored data changes and the
dashpay/platformpin is unchanged.Sdk::register_dpns_name; the preorder and domain documents are no longer built in DETSdk::resolve_dpns_nameSdk::search_dpns_namesSdk::get_dpns_usernames_by_identityvoter_identity_id,select_voting_keyKept on DET's side, on purpose:
Sdk::register_dpns_namereturns one error for both broadcasts. Itspreorder_callbackruns after the preorder is confirmed, so a flag set there sorts the failure into "first document not confirmed" (plain failure) or "name request failed after payment" (goes throughresolve_failed_domain_broadcast, as before). The SDK call is passed in as a parameter of the privateregister_dpns_name_through, so tests can drive the real callback and the whole success path without a network.classify_dpns_registration_outcomestays, but asks the network's DPNS contract (contested_vote_poll_for_document_properties) whether the label is contested, instead of classifying a document DET built.fetch_owned_dpns_names.finish_username_registration.Behaviour changes:
TaskError::MasternodeVotingKeyNotUsable: a voting key that is disabled on the voter identity is refused at node load. The match coversECDSA_HASH160keys only. The vote path itself is untouched.DpnsFetchError, like the other paths. A document whose label is not text is skipped.Line counts against the base (15 files, +991 −725):
Testing
cargo clippy --all-features --lib --tests -- -D warningsis clean.node_voting_key_disabled_on_the_network_is_refused,a_username_resolves_when_its_identity_arrives_as_bytes,loading_by_name_follows_the_identity_the_name_points_at.failure_after_the_sdk_confirms_the_first_document_is_the_paid_stagefails when thepreorder_callbackwiring is removed.registration_saves_the_date_of_the_confirmed_name_documentruns the whole registration with a stand-in for the SDK call and fails when the confirmed document's date stops reaching the saved name. The rest cover the failure-stage sorting, the date taken from the confirmed document, and the contest rule read from the contract.#[ignore]backend-e2e testtest_register_dpns_name_funded_from_platform_addressespassed on testnet against this PR's production code. It funds a fresh identity from credits already held on the framework wallet's platform addresses (no Core funds), registers a non-contested name and finds the identity by that name. It is not part of CI.test_register_dpns_namedid not reach the registration step: its identity funding failed in the test harness, in code this PR does not touch.Breaking changes
None.
Prior work
🤖 Co-authored by Claudius the Magnificent AI Agent
🤖 Generated with Claude Code
https://claude.ai/code/session_012YneRVSNLhVnGiedWDr3fw
PR Hygiene ·
44fcc5cCHANGELOG.md,src/backend_task/dashpay/contact_requests.rs,src/backend_task/dashpay/contacts.rsand 12 more) — approved by lklimekWhen 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