Repository navigation
fix(identity): reconcile address-funded identity registration through platform-wallet - #1166
Conversation
…ugh platform-wallet Identity registration funded from Platform addresses still submits through the SDK, and its proof only updated DET's per-address view. Platform-wallet's own balances (read by Shield's Max) and the wallet total lagged until the next sync. - the registration proof is reconciled with upstream's public reconcile_address_infos, pinned at the proof height, and the committed entries go through apply_platform_address_spend (DET view, ledger merge, frame-safe total), like the other Platform-address spends - reconciling runs after the broadcast and cannot fail the registration: when platform-wallet does not hold the paying wallet, DET's view takes the proof as before Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. 🗂️ Base branches to auto review: 2
Please check the settings in the CodeRabbit UI or the
|
|
✅ Final review complete — no blockers (commit b28d55c) · triage: normal · 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)
Verified the Phase-2 reviewers’ conclusions against the exact base-to-head diff at b28d55c, surrounding DET code, and pinned and current upstream platform-wallet implementations. No actionable in-scope findings remain: registration preserves typed error handling and applies successful proofs through the existing reconciliation and height-pinned balance paths. This was a static verification only; current PR checks report successful Test Suite, Clippy, and Platform pin guard results.
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:
normalbygpt-6.1-sol(effort low) — The change coordinates post-registration balance reconciliation and stale-proof protection across three Rust modules, but does not itself change funds movement, signing, or another critical 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 high); agentphase2-reviewer,gpt-6.1-sol— rust-quality (completed, effort high); agentphase2-reviewer
TL;DR
When you create an identity paid for from your Platform addresses, the wallet's Platform balance, each address's balance and the Shield "Max" amount all show what is left right away. They no longer wait for the next sync, and an older sync result arriving later cannot bring the pre-payment figures back.
User story
As an Everyday User who creates an identity using credits from my Platform addresses, I want my wallet to show what I have left as soon as the identity is created, so I don't move or shield credits I've already spent.
Scenario
Base flow
Actual behavior
The per-address list shows the reduced balances, but the wallet's Platform total and Shield's "Max" still show the pre-payment amount until the next Platform sync finishes.
Expected behavior
The total, the per-address list and Shield's "Max" all show the post-payment amounts straight away, and stay that way when an older sync result comes in later.
Detailed discussion
Stacked atop #1165.
Address-funded identity registration still submits through the SDK (
put_with_address_funding), because upstream has no registration path for it that keeps DET's per-input signer and typed errors. Its proof is now recorded the same way #1165 records an identity top-up:WalletBackend::reconcile_platform_address_proofresolves the paying wallet and calls upstream's publicreconcile_address_infosat the proof height. Platform-wallet keeps only the wallet's own addresses and skips any address it already holds at an equal or newer height.AppContext::record_platform_address_spend_proofpasses the committed entries toapply_platform_address_spend: DET's per-address view, the height-pinned ledger merge and the frame-safe wallet total, all in one step.The registration error mapping and user-facing messages are unchanged. The stale-nonce promotion from #1165 is not applied: registration fetches fresh nonces right before it submits, and the
PlatformAddressNonceMismatchtext is written for payments.Testing
New tests in
src/wallet_backend/platform_address_ops.rs, written to fail before the change:spend_proof_reaches_platform_wallet_det_model_and_total: a registration proof updates platform-wallet's per-address balance, DET's per-address view, the wallet total and the ledger pin together, and leaves out a foreign recipient. A later, older proof and an older coordinator pass change none of them.spend_proof_without_platform_wallet_still_updates_det_model: with no wired backend, DET's view still takes the proof, and a later, older proof cannot undo it.cargo clippy --all-features --lib --tests -D warningsis clean on the branch and on a trial merge withv1.0-dev. The live registration call goes over the network, so this PR has no automated test for it.🤖 Co-authored by Claudius the Magnificent AI Agent
🤖 Generated with Claude Code