Skip to content

fix(identity): reconcile address-funded identity registration through platform-wallet - #1166

Open
Claudius-Maginificent wants to merge 2 commits into
fix/platform-address-ops-via-platform-walletfrom
fix/identity-registration-via-platform-wallet
Open

Claudius-Maginificent wants to merge 2 commits into
fix/platform-address-ops-via-platform-walletfrom
fix/identity-registration-via-platform-wallet

Conversation

@Claudius-Maginificent

Copy link
Copy Markdown
Collaborator

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

  1. Open a wallet with funded Platform addresses.
  2. Create a new identity and pay for it from those Platform addresses.
  3. Right after it succeeds, look at the wallet's Platform balance, the per-address list, and Shield's "Max".

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_proof resolves the paying wallet and calls upstream's public reconcile_address_infos at 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_proof passes the committed entries to apply_platform_address_spend: DET's per-address view, the height-pinned ledger merge and the frame-safe wallet total, all in one step.
  • The reconcile runs after a successful broadcast and cannot fail the registration. If platform-wallet does not hold the paying wallet (backend not wired, or the wallet is not registered upstream), DET's per-address view takes the proof at its height, the way it did before this change, and a warning is logged.

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 PlatformAddressNonceMismatch text 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 warnings is clean on the branch and on a trial merge with v1.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

…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>
@coderabbitai

coderabbitai Bot commented Nov 4, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

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

🗂️ Base branches to auto review: 2
  • master
  • v1.0-dev

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

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
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Tip

🎯 Customize your risk assessments

Guide how CodeRabbit assesses merge risk and security architecture risk. Highlight sensitive changes and explain your security boundaries using Merge Risk Instructions and Security Risk Instructions in your review settings. Security architecture risk assessments require the Advanced plan or above.

✅ Automatic approvals, with your rules

Let CodeRabbit approve pull requests once required threads are resolved, pre-merge checks pass, and your risk limits are met. Enable Automatic approvals in review settings, with overrides for teams or file paths.

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

@thepastaclaw

thepastaclaw commented Nov 4, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Final review complete — no blockers (commit b28d55c) · triage: normal · Phase 2 only (no Phase 1 for this repository)

@Claudius-Maginificent
Claudius-Maginificent marked this pull request as ready for review November 4, 2026 12:41

@thepastaclaw thepastaclaw left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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: normal by gpt-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; agent sol-verifier
  • Phase 2 reviewers: gpt-6.1-sol — general (completed, effort high); agent phase2-reviewer, gpt-6.1-sol — rust-quality (completed, effort high); agent phase2-reviewer

@Claudius-Maginificent Claudius-Maginificent added priority: high High priority — address soon priority: medium Medium priority and removed priority: high High priority — address soon labels Nov 5, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

priority: medium Medium priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants