Skip to content

chore: merge v5.1-dev into v5.2-dev - #6283

Merged
QuantumExplorer merged 154 commits into
v5.2-devfrom
chore/merge-v5.1-dev-into-v5.2-dev
Nov 25, 2026
Merged

QuantumExplorer merged 154 commits into
v5.2-devfrom
chore/merge-v5.1-dev-into-v5.2-dev

Conversation

@QuantumExplorer

@QuantumExplorer QuantumExplorer commented Nov 25, 2026 •

Copy link
Copy Markdown
Member

Basic explanation

What this does: Brings everything merged into v5.1-dev since 17 November (149 commits, up to 544efd7ec7, which includes the 5.1.0-rc.1 release) into v5.2-dev. The two branches had drifted apart: 34 files conflicted, and some 5.1 code no longer compiled against changes 5.2 had made. This PR resolves both.

Value: 5.2 work builds on the current 5.1 code again: the protocol version 15 changes, GroveDB 7.0.0, and the wallet, Swift and Kotlin work of the last week. Every later sync is small again, and the roughly 50 pull requests open against v5.2-dev keep their history, because this is a merge and not a rebase.

Risks: Medium, and limited to 5.2. No shipped behaviour changes and no consensus rule is added. The risk is a wrong resolution in the wallet code, where both branches changed the same functions; see "Where to look" below. Two things other 5.2 work has to know about: the wallet storage migrations v5.2-dev added are renumbered (below), and open pull requests against v5.2-dev will need a merge of v5.2-dev once this lands.

Important

Merge this with "Create a merge commit", not "Squash and merge". A squash drops the link to v5.1-dev, the merge base stays at 17 November, and the same 34 conflicts return at the next sync.

Issue being fixed or feature implemented

v5.1-dev and v5.2-dev diverged after the last sync (#5952, 17 November): 149 commits only on v5.1-dev, 39 only on v5.2-dev.

What was done?

v5.1-dev is merged into v5.2-dev. Most conflicts were both branches adding lines next to each other and keep both sides. The ones that needed a decision:

Dependencies

  • GroveDB: 7.0.0 (5a39eaaf), from v5.1-dev.
  • rust-dashcore: stays on the dev revision v5.2-dev pins (f0ddfd45, 0.47.0). It contains every fix of the v0.46.1 release v5.1-dev uses, so nothing is lost.
  • Workspace version: 5.1.0-rc.1, as on v5.1-dev. Moving v5.2-dev to a 5.2 prerelease is left to the release process, as in chore: merge v5.1-dev into v5.2-dev #5952.

Wallet storage migrations are renumbered

Both branches added a SQLite migration numbered V021.

Migration Before, on v5.2-dev After
Profile address encoding (from v5.1-dev, released in 5.1.0-rc.1) not present V021
Core transaction accounting V021 V022
Core locked outpoints V022 V023

The 5.1 migration keeps its number because it is in a published prerelease. The rename covers the migration files, the v022 backfill module and its hook, rewind_v022, the tests, SCHEMA.md and the two fingerprints in sqlite_schema_pinning.rs.

Effect: a wallet database created by a v5.2-dev development build has V021 recorded with another checksum and will not open with a build of this branch; it has to be recreated. Databases from any 5.1 release are unaffected. An open pull request against v5.2-dev that adds a migration has to take the next free number, V024.

Wallet result codes

No number collides: v5.2-dev holds 80 (ErrorIdentityLookupFailed), v5.1-dev holds 83 to 87. Both sets are kept in Rust, Swift and Kotlin, and ERROR_CODE_REGISTRY.md lists both.

Both branches added Kotlin's IdentityBalanceUnavailable (code 58). It is now one class and reports isRetryable == true, as v5.2-dev had it and as the Rust and Swift documentation of the code say. On v5.1-dev it was not marked retryable.

Wallet code both branches changed

  • Shielded operations (wallet/shielded/operations.rs): v5.1-dev restructured this file (token pool spends, private documents, tips), so Git's line matching was unreliable. The result is the v5.1-dev file with each v5.2-dev change applied to it and checked function by function. The recorded-anchor cache (perf(platform-wallet)!: reuse a recent recorded-anchor set on the shielded spend path #5280) covers the same five spend paths as before; in transfer, whose body v5.1-dev moved into transfer_once_claimed, the cache is passed along. The proved-balance refusal of an identity shield and fetch_recorded_anchor_set, which both branches added, are kept once.
  • Identity sync (manager/identity_sync.rs): v5.2-dev made a pass return its summary; v5.1-dev added a pass attempt that says busy, closed or ran. The attempt now carries the summary when it ran.
  • Identity refresh (loading.rs): an identity removed while its fetch was in flight is reported as not found (v5.1-dev), and a failed store is handled as the caller asked (v5.2-dev).
  • Contact request send: the shielded address check v5.1-dev added runs before the broadcast, which takes the settings argument v5.2-dev added.
  • Top-up screens (Swift and Kotlin example apps): the shielded funding source from v5.1-dev and the pending state for an unconfirmed address top-up from v5.2-dev are both kept.
  • Test helpers: two identical mock-manager helpers under different names became one (mock_manager_over); two tests with the same name were told apart.

Swift: a Clear refused while an operation is in flight

PlatformWalletManager.clearShielded() has two refusals for an operation in flight: Rust's own (from v5.1-dev, shieldedOperationInProgress) and this manager's admission gate for an async native operation such as a shielded spend (from v5.2-dev, which threw invalidHandle). The gate now throws shieldedOperationInProgress too.

  • Before, on the merged tree: Clear tapped during a shielded spend threw invalidHandle, and the example app from v5.1-dev treated that as a reset Rust had attempted: it dropped its binding and sync subscriptions although nothing had changed.
  • After: both refusals are one typed error, and the app shows "A shielded payment or wallet setup is in progress. Try Clear again when it finishes." and keeps its state.

A caller that matched invalidHandle for this case on v5.2-dev has to match shieldedOperationInProgress. Shutdown in progress still throws invalidHandle.

Identity refresh reports a failed store

refresh_identity returns a failed store (as v5.2-dev made it) where the docs taken from v5.1-dev said it was only logged. The C export, Swift and Kotlin docs say so now, and the two Update Key Limits screens no longer tell the user to wait for the network on every refresh failure.

5.1 code adapted to 5.2

Code that merged without a conflict but did not compile, all in tests:

Protocol version 16

The version tables merged without a conflict. PLATFORM_V16 takes every table it does not name from PLATFORM_V15, so the protocol version 15 changes made on v5.1-dev reach 16 as designed.

Values pinned at the latest version that both branches had re-pinned were taken again on the merged tree:

  • nullifier_batch_guard.rs: the state root and the nine settled-state hashes. The nine validation hashes are those of v5.1-dev, unchanged.
  • restore_constraints.rs: the rule-free restore fee is 1,493,040 at protocol version 16 and 1,443,040 at 15. v5.1-dev raised it by 160, and the token market contract of 16 adds 50,000 as before.
  • The wasm-sdk contract-cache fixture (signed-responses.json) is regenerated at protocol version 16; two runs were byte-identical.

Generated files

PARITY_SUMMARY.md is regenerated from the merged manifest (56 capabilities: 54 from v5.1-dev plus the 2 v5.2-dev added). Swift's schema-models.json and DashSchemaV5 list the entities of both branches.

Second merge commit

v5.2-dev gained #6162 while this was in progress. It is merged in as a second commit: two test modules where both sides appended tests, and one test fixture.

Where to look

A review of the whole diff is not practical (it is the 5.1 diff). The hand-made part is git diff 544efd7ec7 HEAD -- packages/rs-platform-wallet packages/rs-platform-wallet-ffi packages/rs-platform-wallet-storage read against v5.2-dev, and above all wallet/shielded/operations.rs and manager/identity_sync.rs.

How Has This Been Tested?

Locally on macOS, on the merged tree:

  • cargo check --workspace --all-targets --all-features: clean. platform-wallet and platform-wallet-ffi also with default features (the first review found the default build broken by a feature-gated import; fixed).
  • cargo clippy --all-targets --all-features -- --no-deps -D warnings on platform-wallet, platform-wallet-ffi, drive-abci, drive-proof-verifier: clean. platform-wallet-storage is clean for the library; its test target has one unused import that only macOS reports (it is used under a Linux-only test) and that v5.2-dev has too.
  • cargo fmt --all -- --check: clean.
  • platform-wallet: 1,070 tests of the shielded, identity sync, core bridge, platform address, asset lock and loading modules, then the 288 sync manager tests after test(platform-wallet): pin sync coordinator lifecycle behaviour #6162. platform-wallet-ffi: 176 tests of the error, shielded send, identity sync, balance history and top-up modules.
  • platform-wallet-storage: the whole crate (it is small and holds the migrations). All pass except should_open_under_insecure_ancestor_reached_through_parent_symlink_and_warn, which compares a path that macOS reports as /private/var/...; its file is identical to v5.2-dev.
  • drive-abci: nullifier_batch_guard, restore_constraints, the shielded token tests, query::document_history and the protocol upgrade events.
  • drive: document history verification, ranked queries, document deletes, the order escrow, deterministic_root_hash and the structure tests that compare grovedb-structure.json with a real database. dpp: stored contract compatibility, system data contracts, document validation v2, the shielded builder. platform-version: all.
  • wasm-sdk: the 229 library tests, which read the regenerated fixture.
  • Kotlin: :sdk:compileDebugKotlin, :app:compileDebugKotlin and the 44 tests of DashSdkErrorTest.
  • Swift: freeze_schema_models.py --check and --check-inventory, and a syntax parse of the eleven Swift files both branches changed.
  • scripts/check_sdk_parity_manifest.py.

Not run locally, left to CI: the full Rust suites, the Swift build and tests (they need the xcframework), the Kotlin instrumented tests and the JS suites. Pinned values in tests I did not run may still need re-pinning for protocol version 16; I will fix what CI reports.

Breaking Changes

Those of the merged v5.1-dev commits. None of them is new here.

For work on v5.2-dev only: the wallet storage migrations V021 and V022 of v5.2-dev are now V022 and V023 (see above).

Checklist:

  • I have performed a self-review of my own code
  • My Rust, FFI, WASM, Swift or Kotlin changes follow the coding conventions
  • I have commented my code, particularly in hard-to-understand areas
  • I have added or updated relevant unit/integration/functional/e2e tests
  • I have added "!" to the title and described breaking changes in the corresponding section if my code contains any
  • I have made corresponding changes to the documentation if needed
  • If I added or changed GroveDB structure, I described it in the area's structure.rs, regenerated grovedb-structure.json, and checked the structure viewer link posted on this pull request
  • If I added or changed a system contract's document schemas, I checked the contract viewer link posted on this pull request

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

🤖 Generated with Claude Code

PR Hygiene · 3984eee

  • Bots — thepastaclaw ✓
  • Self-review — post /self-reviewed
  • Build running
  • Approvals
    • claude — you own it
    • github (.github/actions/docker/action.yaml, .github/actions/nodejs/action.yaml, .github/actions/npm-release-build/action.yaml and 15 more) — ktechmidas or shumkov
    • files with no dedicated owner — you own it
    • sdk-parity — you own it
    • dashmate (packages/dashmate/configs/defaults/getBaseConfigFactory.js, packages/dashmate/configs/defaults/tenderdash-seeds.json, packages/dashmate/configs/getConfigFileMigrationsFactory.js and 17 more) — ktechmidas or shumkov
    • system-contracts — you own it
    • js-wasm-sdk (packages/js-dash-sdk/package.json, packages/js-evo-sdk/README.md, packages/js-evo-sdk/package.json and 21 more) — shumkov
    • kotlin-sdk (packages/kotlin-sdk/KotlinExampleApp/TEST_PLAN.md, packages/kotlin-sdk/KotlinExampleApp/app/build.gradle.kts, packages/kotlin-sdk/KotlinExampleApp/app/src/main/java/org/dashfoundation/example/MainActivity.kt and 342 more) — HashEngineering
    • dpp — you own it
    • rs-drive-abci — you own it
    • rs-drive — you own it
    • rs-platform-wallet-ffi (packages/rs-platform-wallet-ffi/Cargo.toml, packages/rs-platform-wallet-ffi/ERROR_CODE_REGISTRY.md, packages/rs-platform-wallet-ffi/src/asset_lock/built_callback.rs and 38 more) — HashEngineering or ZocoLini or llbartekll or romchornyi
    • wallet-storage (packages/rs-platform-wallet-storage/README.md, packages/rs-platform-wallet-storage/SCHEMA.md, packages/rs-platform-wallet-storage/migrations/V021__core_transaction_accounting.rs and 27 more) — lklimek
    • rs-platform-wallet (packages/rs-platform-wallet/Cargo.toml, packages/rs-platform-wallet/README.md, packages/rs-platform-wallet/src/changeset/flush_ledger.rs and 92 more) — HashEngineering or ZocoLini or llbartekll or romchornyi
    • rust-sdk-ffi (packages/rs-sdk-ffi/src/address/queries/address_funds_elements.rs, packages/rs-sdk-ffi/src/address/queries/branch_state.rs, packages/rs-sdk-ffi/src/address/queries/mod.rs and 35 more) — lklimek or shumkov
    • rust-sdk (packages/rs-sdk/src/core/transaction.rs, packages/rs-sdk/src/error.rs, packages/rs-sdk/src/mock/requests.rs and 61 more) — lklimek or shumkov
    • swift-sdk (packages/swift-sdk/Sources/SwiftDashSDK/Address/Addresses.swift, packages/swift-sdk/Sources/SwiftDashSDK/ContractModeration/ContractModeration.swift, packages/swift-sdk/Sources/SwiftDashSDK/ContractModeration/SDK+ContractModeration.swift and 246 more) — llbartekll or romchornyi

When every merge requirement is met, the PR Hygiene check passes. Reviewer limits do not block merging; other required GitHub checks and protections still apply.

QuantumExplorer and others added 30 commits November 17, 2026 14:59
…, proved with the seed (#5905)

Co-authored-by: pasta <[email protected]>
Co-authored-by: Claude Fable 5.2 <[email protected]>
…per-contact shielded address (#5902)

Co-authored-by: Claude Fable 5.2 <[email protected]>
…d their fee bundle (PV15) (#5969)

Co-authored-by: Claude Opus 5.5 <[email protected]>
Co-authored-by: Lukasz Klimek <[email protected]>
Co-authored-by: Codex (gpt-6-astra) <[email protected]>
Co-authored-by: Claude Opus 5.5 <[email protected]>
… a valid preorder (PV15) (#5978)

Co-authored-by: Claude Opus 5.5 <[email protected]>
…rty passes 2^27 (PV15) (#5987)

Co-authored-by: Claude Fable 5.2 <[email protected]>
@github-actions github-actions Bot added the waiting-bots Waiting for the review bots to report on this head label Nov 25, 2026
@thepastaclaw

thepastaclaw commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

✅ Final review complete — no blockers (commit 3984eee) · triage: critical

@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

📖 Book Preview built successfully.

Download the preview from the workflow artifacts.
To view locally: download the artifact, unzip, and open index.html.

Updated at 2026-11-25T12:27:16.948Z

@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

📜 System contracts

This pull request adds or changes system contract document schemas. The contract viewer diagrams each one, and a comparison marks what is added, changed and removed, with the update rule each change meets.

Compared 00e850ed7e with 3984eeef19. Updated at 2026-11-25T12:34:05.751Z

@github-actions

github-actions Bot commented Nov 25, 2026 •

Copy link
Copy Markdown
Contributor

🌳 GroveDB structure

This pull request changes the described GroveDB structure. Open it in the structure viewer: new nodes glow, removed ones stay as ghosts, and the tour walks through each change.

Changed (7 nodes)

  • contracts.contract.documents.document_type.primary_key
  • contracts.contract.documents.document_type.index_property
  • contracts.contract.documents.document_type.index_property.value
  • contracts.contract.documents.document_type.index_property.value.members
  • contracts.contract.documents.document_type.index_property.value.next_property
  • votes.end_date_queries.end_date
  • votes.end_date_queries.end_date.poll

Compared 00e850ed7e with 3984eeef19. Updated at 2026-11-25T12:29:19.734Z

@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 1 + Phase 2

Changes requested: 2 blockers

  • The default wallet build cannot resolve Future — packages/rs-platform-wallet/src/wallet/platform_wallet.rs:4-5 (new; not shown inline, see below)
    Impact: Consumers building platform-wallet with its default features cannot compile the crate, even if they never use shielded operations.
  • The Swift migration test fails on the merged schema’s fourth new entity — packages/swift-sdk/SwiftTests/SwiftDashSDKTests/DashModelMigrationTests.swift:646-647 (new; not shown inline, see below)
    Impact: Anyone running the Swift SDK migration suite on this head gets an assertion failure even when the schema is correct.

This merge brings the v5.1-dev history into v5.2-dev, combining the wallet and mobile SDK changes while retaining protocol 16 and the target branch’s sync lifecycle tests. No code check had failed at the time of review: the Swift frozen-schema check passed, the full Swift test suite was not reported, and Rust workspace, wasm32, Kotlin, JS, and image builds or tests were still pending.

🔴 2 blocking | 🟡 4 suggestion(s)

6 finding(s) not shown inline (GitHub refused the PR diff as too large)

🔴 Blocking: The default wallet build cannot resolve Future
Impact: Consumers building platform-wallet with its default features cannot compile the crate, even if they never use shielded operations.
packages/rs-platform-wallet/src/wallet/platform_wallet.rs:4-5

The default build fails to resolve both Future bounds in top_up_identity_with. The merge retains the target branch’s unconditional address top-up helper but takes the incoming branch’s #[cfg(feature = "shielded")] on its only Future import. The crate uses Rust 2021, which does not import Future through the prelude, and the default bls and eddsa features do not enable shielded. Restore the unconditional import and check the default-feature build; an all-features check masks this error.

use std::future::Future;

source: gpt-6.2-astra (phase2-reviewer: general, architecture-layering, ffi-engineer, platform-versioning, rust-quality, security-auditor, tenderdash-consensus-security)

🔴 Blocking: The Swift migration test fails on the merged schema’s fourth new entity
Impact: Anyone running the Swift SDK migration suite on this head gets an assertion failure even when the schema is correct.
packages/swift-sdk/SwiftTests/SwiftDashSDKTests/DashModelMigrationTests.swift:646-647

The V4-to-V5 test expects exactly three added entities, but the merged V5 schema adds four. The incoming test’s three-name set matched v5.1-dev; the merged DashModelContainer.modelTypes also retains PersistentLockedOutpoint from v5.2-dev, and frozen V4 does not include it. Add the fourth name and keep the exact-set assertion so the test still catches unintended schema changes.

            ["PersistentDashpayPaymentAddresses", "PersistentLockedOutpoint",
             "PersistentPrivateContactRequestsPosition", "PersistentPrivateShieldedAddress"])

source: gpt-6.2-astra (phase2-reviewer: general, architecture-layering, ffi-engineer, platform-versioning, rust-quality, security-auditor, tenderdash-consensus-security)

🟡 Suggestion: Clear disconnects the sync view when Swift refuses the reset before calling Rust
Impact: An example-app user who taps Clear while a shielded payment is in flight can lose live sync updates until rebind, even though the native wallet remains bound and no rows were cleared.
packages/swift-sdk/SwiftExampleApp/SwiftExampleApp/Core/Services/ShieldedService.swift:1011-1015

A refused Clear cancels the app’s sync subscriptions, marks the service unbound, and increments localStateClearCount. A payment such as shieldedTokenTransfer holds withAdmittedNativeOperation; the v5.2-dev guard therefore throws invalidHandle before platform_wallet_manager_shielded_clear runs, as the admission test demonstrates for a shielded spend. The incoming app handler exempts only Rust’s shieldedOperationInProgress error from afterResetAttempt(). Give the pre-call refusal a distinct typed outcome and handle it without teardown, while retaining cleanup when Rust did attempt the reset. Test the manager-to-service refusal path rather than injecting only the native error.

source: gpt-6.2-astra (phase2-reviewer: general, architecture-layering, ffi-engineer, platform-versioning, rust-quality, security-auditor, tenderdash-consensus-security)

🟡 Suggestion: Identity refresh throws a store error that the mobile APIs say is only logged
Impact: When a proved identity refresh cannot be stored locally, Swift and Kotlin callers receive an error, and both Update Key Limits example screens tell users to wait for network connectivity instead.
packages/rs-platform-wallet-ffi/src/wallet.rs:35-38

Reconnecting cannot fix a local persistence failure. The merged IdentityWallet::refresh_identity uses the target branch’s FoldStoreFailure::Return, leaving the cached identity unchanged when the store fails so a retry still includes the key changes. The C export and both mobile wrappers propagate the error, but their incoming documentation still promises that it is only logged. Update all three contracts and have the example screens report the underlying refresh failure without attributing every error to connectivity. Keep the Rust store-and-publish ordering.

source: gpt-6.2-astra (phase2-reviewer: general, architecture-layering, ffi-engineer, platform-versioning, rust-quality, security-auditor, tenderdash-consensus-security)

🟡 Suggestion: The nine shielded settlement cases no longer check protocol 15 results
Impact: A change to protocol 15 fees, nonces, or settled state roots can pass these tests if the protocol 16 results stay the same.
packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/token/shielded/nullifier_batch_guard.rs:2238-2247

The merge replaces the nine settled-state hashes recorded at 544efd7ec7 with protocol 16 hashes. The fixtures and processor use PlatformVersion::latest(), and the unchanged validation hashes do not cover the committed root or the final execution result. Run the characterization with version-matched fixtures and execution at both protocol 15 and latest, retaining the incoming protocol 15 references. The sponsored-payment fee test in this file already shows how to run the processor at both versions.

source: gpt-6.2-astra (phase2-reviewer: general, architecture-layering, ffi-engineer, platform-versioning, rust-quality, security-auditor, tenderdash-consensus-security)

🟡 Suggestion: A manual token sync cannot report which reads succeeded in its own pass
Impact: Rust callers waiting for a pass after changing the watch list get true both when all balances were proved and when all reads failed.
packages/rs-platform-wallet/src/manager/identity_sync.rs:779-784

A caller that needs fresh results has to choose between waiting for a pass that sees its new registrations and receiving the pass summary. The merge makes SyncAttempt::Ran carry that summary, but the waiting path discards it; reading the cache afterward cannot distinguish a fresh proof from an unchanged value after a read failure. Expose the summary on the waiting Rust path with a distinct no-pass result. The FFI can keep its documented pass-ran contract.

source: gpt-6.2-astra (phase2-reviewer: general, architecture-layering, ffi-engineer, platform-versioning, rust-quality, security-auditor, tenderdash-consensus-security)

Review provenance

Source: reviewer 1: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 2: gpt-6.2-astra (agent: phase2-reviewer, role: general); reviewer 3: gpt-6.2-astra (agent: phase2-reviewer, role: architecture-layering); reviewer 4: gpt-6.2-astra (agent: phase2-reviewer, role: ffi-engineer); reviewer 5: gpt-6.2-astra (agent: phase2-reviewer, role: platform-versioning); reviewer 6: gpt-6.2-astra (agent: phase2-reviewer, role: rust-quality); reviewer 7: gpt-6.2-astra (agent: phase2-reviewer, role: security-auditor); reviewer 8: gpt-6.2-astra (agent: phase2-reviewer, role: tenderdash-consensus-security); reviewer 9: muse-spark-1.3-contributor (agent: phase1-reviewer, role: rust-quality); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)

  • Triage: critical by gpt-6.2-sol (effort low) — This intricate merge changes persisted wallet compatibility by renumbering V022__core_transaction_accounting.rs and V023__core_locked_outpoints.rs, and reconciles funds-movement logic in wallet/shielded/operations.rs, including transfer_once_claimed.
  • Phase 1 reviewers: muse-spark-1.3-contributor — general (completed, effort xhigh); agent phase1-reviewer, muse-spark-1.3-contributor — rust-quality (completed, effort xhigh); agent phase1-reviewer
  • Phase 1 model: muse-spark-1.3-contributor — not quota-gated; passed over gemini-3.8-flash-high (lane failed), glm-5.3-flash (not used above high effort; tier asks max)
  • Single stage: Phase 1 and Phase 2 reviewed this head side by side, with no blocker gate between them (triage tier)
  • Fresh verifier: gpt-6.2-sol — final-verifier; agent sol-verifier
  • Phase 2 reviewers: gpt-6.2-astra — general (completed, effort high); agent phase2-reviewer, gpt-6.2-astra — architecture-layering (completed, effort high); agent phase2-reviewer, gpt-6.2-astra — ffi-engineer (completed, effort high); agent phase2-reviewer, gpt-6.2-astra — platform-versioning (completed, effort high); agent phase2-reviewer, gpt-6.2-astra — rust-quality (completed, effort high); agent phase2-reviewer, gpt-6.2-astra — security-auditor (completed, effort high); agent phase2-reviewer, gpt-6.2-astra — tenderdash-consensus-security (completed, effort high); agent phase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions don't block the merge, but most are worth fixing in this PR; judge each on its merits.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.

In `packages/rs-platform-wallet/src/wallet/platform_wallet.rs`:
- [BLOCKING] packages/rs-platform-wallet/src/wallet/platform_wallet.rs:4-5: The default wallet build cannot resolve `Future`
  Impact: Consumers building `platform-wallet` with its default features cannot compile the crate, even if they never use shielded operations.
  The default build fails to resolve both `Future` bounds in `top_up_identity_with`. The merge retains the target branch’s unconditional address top-up helper but takes the incoming branch’s `#[cfg(feature = "shielded")]` on its only `Future` import. The crate uses Rust 2021, which does not import `Future` through the prelude, and the default `bls` and `eddsa` features do not enable `shielded`. Restore the unconditional import and check the default-feature build; an all-features check masks this error.

In `packages/swift-sdk/SwiftTests/SwiftDashSDKTests/DashModelMigrationTests.swift`:
- [BLOCKING] packages/swift-sdk/SwiftTests/SwiftDashSDKTests/DashModelMigrationTests.swift:646-647: The Swift migration test fails on the merged schema’s fourth new entity
  Impact: Anyone running the Swift SDK migration suite on this head gets an assertion failure even when the schema is correct.
  The V4-to-V5 test expects exactly three added entities, but the merged V5 schema adds four. The incoming test’s three-name set matched v5.1-dev; the merged `DashModelContainer.modelTypes` also retains `PersistentLockedOutpoint` from v5.2-dev, and frozen V4 does not include it. Add the fourth name and keep the exact-set assertion so the test still catches unintended schema changes.

In `packages/swift-sdk/SwiftExampleApp/SwiftExampleApp/Core/Services/ShieldedService.swift`:
- [SUGGESTION] packages/swift-sdk/SwiftExampleApp/SwiftExampleApp/Core/Services/ShieldedService.swift:1011-1015: Clear disconnects the sync view when Swift refuses the reset before calling Rust
  Impact: An example-app user who taps Clear while a shielded payment is in flight can lose live sync updates until rebind, even though the native wallet remains bound and no rows were cleared.
  A refused Clear cancels the app’s sync subscriptions, marks the service unbound, and increments `localStateClearCount`. A payment such as `shieldedTokenTransfer` holds `withAdmittedNativeOperation`; the v5.2-dev guard therefore throws `invalidHandle` before `platform_wallet_manager_shielded_clear` runs, as the admission test demonstrates for a shielded spend. The incoming app handler exempts only Rust’s `shieldedOperationInProgress` error from `afterResetAttempt()`. Give the pre-call refusal a distinct typed outcome and handle it without teardown, while retaining cleanup when Rust did attempt the reset. Test the manager-to-service refusal path rather than injecting only the native error.

In `packages/rs-platform-wallet-ffi/src/wallet.rs`:
- [SUGGESTION] packages/rs-platform-wallet-ffi/src/wallet.rs:35-38: Identity refresh throws a store error that the mobile APIs say is only logged
  Impact: When a proved identity refresh cannot be stored locally, Swift and Kotlin callers receive an error, and both Update Key Limits example screens tell users to wait for network connectivity instead.
  Reconnecting cannot fix a local persistence failure. The merged `IdentityWallet::refresh_identity` uses the target branch’s `FoldStoreFailure::Return`, leaving the cached identity unchanged when the store fails so a retry still includes the key changes. The C export and both mobile wrappers propagate the error, but their incoming documentation still promises that it is only logged. Update all three contracts and have the example screens report the underlying refresh failure without attributing every error to connectivity. Keep the Rust store-and-publish ordering.

In `packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/token/shielded/nullifier_batch_guard.rs`:
- [SUGGESTION] packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/token/shielded/nullifier_batch_guard.rs:2238-2247: The nine shielded settlement cases no longer check protocol 15 results
  Impact: A change to protocol 15 fees, nonces, or settled state roots can pass these tests if the protocol 16 results stay the same.
  The merge replaces the nine settled-state hashes recorded at `544efd7ec7` with protocol 16 hashes. The fixtures and processor use `PlatformVersion::latest()`, and the unchanged validation hashes do not cover the committed root or the final execution result. Run the characterization with version-matched fixtures and execution at both protocol 15 and latest, retaining the incoming protocol 15 references. The sponsored-payment fee test in this file already shows how to run the processor at both versions.

In `packages/rs-platform-wallet/src/manager/identity_sync.rs`:
- [SUGGESTION] packages/rs-platform-wallet/src/manager/identity_sync.rs:779-784: A manual token sync cannot report which reads succeeded in its own pass
  Impact: Rust callers waiting for a pass after changing the watch list get `true` both when all balances were proved and when all reads failed.
  A caller that needs fresh results has to choose between waiting for a pass that sees its new registrations and receiving the pass summary. The merge makes `SyncAttempt::Ran` carry that summary, but the waiting path discards it; reading the cache afterward cannot distinguish a fresh proof from an unchanged value after a read failure. Expose the summary on the waiting Rust path with a distinct no-pass result. The FFI can keep its documented pass-ran contract.
Out-of-scope follow-up suggestions (1)

These are valid observations, but they are outside this PR's scope and should be handled in separate issues or author/maintainer-requested PRs rather than blocking this review.

  • Dashmate’s existing Tenderdash image migration skips configs stamped 5.1.0 — The upstream v5.1.0-dev.1 release itself wrote format 5.1.0 with the stock Tenderdash dev.2 image. The unchanged v5.1-dev upgrade treats that stored format as newer than its target and leaves the image alone. Those nodes miss the same-round vote redelivery fix in dashpay/tenderdash#1599 and can remain susceptible to a consensus stall after ordinary vote loss.
    • Follow-up: Fix the upgrade on v5.1-dev with a forward migration that advances the stock dev.2 image without replacing operator-selected images, test it against the actual v5.1.0-dev.1 stamp, and carry the fix forward in a later merge.

@github-actions

Copy link
Copy Markdown
Contributor

Your move: thepastaclaw requested changes on this head; dismiss the review or push a fix.
Full checklist in the description.

@github-actions github-actions Bot added waiting-self-review Waiting for the author to post /self-reviewed and removed waiting-bots Waiting for the review bots to report on this head labels Nov 25, 2026
…itself

Found by review of the v5.1-dev merge:

- platform-wallet: `std::future::Future` is imported without the shielded
  feature again. v5.2-dev's address top-up helper uses it in every build;
  the merge had taken v5.1-dev's feature gate on the import, so the default
  feature set did not compile.
- swift-sdk: the V4 to V5 schema test names all four entities V5 adds. It
  listed v5.1-dev's three; the merged schema also has v5.2-dev's
  PersistentLockedOutpoint.
- swift-sdk: `clearShielded` refused by this manager's own admission gate
  (an async native operation in flight) throws `shieldedOperationInProgress`,
  the error Rust gives for an operation in flight, instead of
  `invalidHandle`. The example app from v5.1-dev keeps its binding and
  subscriptions on that error only, so with v5.2-dev's gate a refused Clear
  tore them down although nothing had changed.
- Identity refresh docs (C export, Swift, Kotlin) said a failed store is
  only logged. On the merged tree it is returned, as v5.2-dev made it; the
  two Update Key Limits screens no longer tell the user to wait for the
  network on every refresh failure.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@QuantumExplorer

Copy link
Copy Markdown
Member Author

Review of cd916919 handled in 70000120e8. The findings had no inline threads, so the answers are here.

Fixed

  1. Future unresolved in the default build (blocking): the import is unconditional again. cargo check -p platform-wallet -p platform-wallet-ffi now passes with default features as well as with --all-features.
  2. Swift V4 to V5 schema test (blocking): the expected set has the four entities V5 adds, PersistentLockedOutpoint included.
  3. Clear refused before Rust is called: clearShielded now throws shieldedOperationInProgress when an async native operation is admitted, the same error Rust gives, so the example app keeps its binding and subscriptions. The admission test expects the new error.
  4. Identity refresh store failure: the C export, Swift and Kotlin docs now say a failed store is returned and leaves the wallet's copy unchanged. The two Update Key Limits screens no longer tie every refresh failure to the network.

Not changed in this pull request

  1. Protocol version 15 references for the nine settlement cases: v5.2-dev already pinned these nine cases at the latest version only (since protocol version 16 was introduced), so the merge removes no check that v5.2-dev had. A protocol version 15 run needs the pool fixtures built per version, which is a test refactor beyond a branch sync. v5.1-dev keeps running the nine cases at 15.
  2. Summary from sync_now_after_in_flight: it returns what it returned on v5.1-dev, and its one caller (the FFI) needs only whether a pass ran. No caller needs the summary there today.

The Dashmate note is on v5.1-dev code this merge does not touch.

@github-actions

Copy link
Copy Markdown
Contributor

Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post /skip-bots to proceed without them; blocking findings still need addressing.
Full checklist in the description.

@github-actions github-actions Bot added waiting-bots Waiting for the review bots to report on this head and removed waiting-self-review Waiting for the author to post /self-reviewed labels Nov 25, 2026

@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.

Re-review — Final validation — Phase 1 + Phase 2

New on this head: The follow-up restores the default-feature Rust import, updates the Swift V5 migration assertion, and makes Clear report an admitted native operation as a typed refusal. It also updates the identity refresh documentation and retry messages. GitHub reported no failed code checks on this head; the Kotlin emulator build and tests and NPM release build validation were still pending.

🟡 1 suggestion(s)

Approved: nothing here blocks the merge. The non-blocking findings are optional: fix them forward, in this PR or a follow-up, without waiting for another review round.

1 finding(s) not shown inline (GitHub refused the PR diff as too large)

🟡 Suggestion: The C refresh docs promise saved key rows even when the host has no key callback
Impact: A C client that leaves the identity-key callback unset can receive success after a refresh but have no row for a newly discovered key to restore after restart.
packages/rs-platform-wallet-ffi/src/wallet.rs:36-39

A successful refresh does not guarantee that the host wrote the changed key rows. Manager creation accepts a callback table without on_persist_identity_keys_fn, and FFIPersister::store skips key upserts in that case without reporting an error. The wallet then publishes the refreshed copy and the C export returns success. Keep the explanation of reported store failures, but distinguish an updated wallet cache from a confirmed host write.

/// to the host's persister when it provides an identity-key callback. A
/// reported store failure is returned (`PlatformWalletError::PersisterStore`)
/// before the wallet's copy changes, so a retry still includes those keys.
/// Success means the wallet applied the refresh without a reported store error;
/// it does not guarantee that the host saved the rows.

source: gpt-6.2-astra (phase2-reviewer: general, architecture-layering, ffi-engineer, platform-versioning, rust-quality, security-auditor, tenderdash-consensus-security)

Review provenance

Source: reviewer 1: gpt-6.2-astra (agent: phase2-reviewer, role: general); reviewer 2: gpt-6.2-astra (agent: phase2-reviewer, role: architecture-layering); reviewer 3: gpt-6.2-astra (agent: phase2-reviewer, role: ffi-engineer); reviewer 4: gpt-6.2-astra (agent: phase2-reviewer, role: platform-versioning); reviewer 5: gpt-6.2-astra (agent: phase2-reviewer, role: rust-quality); reviewer 6: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 7: gpt-6.2-astra (agent: phase2-reviewer, role: security-auditor); reviewer 8: gpt-6.2-astra (agent: phase2-reviewer, role: tenderdash-consensus-security); reviewer 9: muse-spark-1.3-contributor (agent: phase1-reviewer, role: rust-quality); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)

  • Triage: critical by gpt-6.2-sol (effort low) — This intricate merge changes both wallet spend handling in wallet/shielded/operations.rs and SQLite migration sequencing in migrations/V021__profile_address_encoding.rs and the renumbered V022/V023 migrations.
  • Phase 1 reviewers: muse-spark-1.3-contributor — general (completed, effort xhigh); agent phase1-reviewer, muse-spark-1.3-contributor — rust-quality (completed, effort xhigh); agent phase1-reviewer
  • Phase 1 model: muse-spark-1.3-contributor — not quota-gated; passed over gemini-3.8-flash-high (lane failed), glm-5.3-flash (not used above high effort; tier asks max)
  • Single stage: Phase 1 and Phase 2 reviewed this head side by side, with no blocker gate between them (triage tier)
  • Fresh verifier: gpt-6.2-sol — final-verifier; agent sol-verifier
  • Phase 2 reviewers: gpt-6.2-astra — general (completed, effort high); agent phase2-reviewer, gpt-6.2-astra — architecture-layering (completed, effort high); agent phase2-reviewer, gpt-6.2-astra — ffi-engineer (completed, effort high); agent phase2-reviewer, gpt-6.2-astra — platform-versioning (completed, effort high); agent phase2-reviewer, gpt-6.2-astra — rust-quality (completed, effort high); agent phase2-reviewer, gpt-6.2-astra — security-auditor (completed, effort high); agent phase2-reviewer, gpt-6.2-astra — tenderdash-consensus-security (completed, effort high); agent phase2-reviewer
🤖 Prompt for all review comments with AI agents
These findings are from an automated code review (PastaClaw). How to work through them:
- Verify each finding against the code; fix only what is real, as narrowly as the finding.
- If a finding is wrong, decline it on its thread in one or two sentences; the bot answers once and stops.
- To defer one, link a tracking issue on its thread (or reply asking the bot to file one).
- Suggestions don't block the merge, but most are worth fixing in this PR; judge each on its merits.
- Keep the PR's scope; don't grow it to satisfy hardening suggestions.
- Carried items were raised in an earlier round: read the thread first, and don't re-fix what you already fixed, declined or deferred there. Disputed and deferred items are already handled and are not listed.

In `packages/rs-platform-wallet-ffi/src/wallet.rs`:
- [SUGGESTION] packages/rs-platform-wallet-ffi/src/wallet.rs:36-39: The C refresh docs promise saved key rows even when the host has no key callback
  Impact: A C client that leaves the identity-key callback unset can receive success after a refresh but have no row for a newly discovered key to restore after restart.
  A successful refresh does not guarantee that the host wrote the changed key rows. Manager creation accepts a callback table without `on_persist_identity_keys_fn`, and `FFIPersister::store` skips key upserts in that case without reporting an error. The wallet then publishes the refreshed copy and the C export returns success. Keep the explanation of reported store failures, but distinguish an updated wallet cache from a confirmed host write.

QuantumExplorer and others added 2 commits November 25, 2026 19:25
v5.2-dev gained #6143 (a failed local key write no longer fails an accepted
identity registration). Two files conflicted: an import list in
invitation.rs (both imports kept) and the doc comment of
shielded_identity_create_from_pool, which keeps #6143's wording on finding
the identity again and v5.1-dev's paragraph on admission.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
…ost saved the key rows

The host's identity-key callback is optional: without it the key rows are
not written and no store error is reported. The C export's doc now says
success means no reported store error, not a confirmed host write.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@QuantumExplorer

QuantumExplorer commented Nov 25, 2026 •

Copy link
Copy Markdown
Member Author

Re-review of 70000120: the C refresh doc now says success means no reported store error and does not confirm that the host saved the key rows (3984eeef19). The head also contains a merge of #6143 from v5.2-dev (f23bd4fe07), which had started to conflict with this branch.

@github-actions

Copy link
Copy Markdown
Contributor

Waiting for bot review — thepastaclaw not yet. Wait for the missing reviews, or a writer can post /skip-bots to proceed without them; blocking findings still need addressing.
Full checklist in the description.

@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.

Re-review — Final validation — Phase 1 + Phase 2

New on this head: This head merges the v5.2-dev fix that lets an accepted identity registration complete even if local bookkeeping fails, and clarifies that a successful C identity refresh does not confirm the host saved the key rows. At the time of review, GitHub showed no failed checks; runner selection, runner-contract tests, and Ubuntu generation were still pending.

🔴 0 blocking | 🟡 0 suggestion(s) | 💬 0 nitpick(s)

Review provenance

Source: reviewer 1: gpt-6.2-astra (agent: phase2-reviewer, role: general); reviewer 2: gpt-6.2-astra (agent: phase2-reviewer, role: architecture-layering); reviewer 3: gpt-6.2-astra (agent: phase2-reviewer, role: ffi-engineer); reviewer 4: gpt-6.2-astra (agent: phase2-reviewer, role: platform-versioning); reviewer 5: gpt-6.2-astra (agent: phase2-reviewer, role: rust-quality); reviewer 6: gpt-6.2-astra (agent: phase2-reviewer, role: security-auditor); reviewer 7: gpt-6.2-astra (agent: phase2-reviewer, role: tenderdash-consensus-security); reviewer 8: muse-spark-1.3-contributor (agent: phase1-reviewer, role: general); reviewer 9: muse-spark-1.3-contributor (agent: phase1-reviewer, role: rust-quality); final verifier: gpt-6.2-sol (agent: sol-verifier, role: final-verifier)

  • Triage: critical by gpt-6.2-sol (effort low) — The merge changes shielded funds-movement logic in packages/rs-platform-wallet/src/wallet/shielded/operations.rs and renumbers SQLite migrations V021–V023, making existing 5.2 development databases incompatible.
  • Phase 1 reviewers: muse-spark-1.3-contributor — general (completed, effort xhigh); agent phase1-reviewer, muse-spark-1.3-contributor — rust-quality (completed, effort xhigh); agent phase1-reviewer
  • Phase 1 model: muse-spark-1.3-contributor — not quota-gated; passed over gemini-3.8-flash-high (lane failed), glm-5.3-flash (not used above high effort; tier asks max)
  • Single stage: Phase 1 and Phase 2 reviewed this head side by side, with no blocker gate between them (triage tier)
  • Fresh verifier: gpt-6.2-sol — final-verifier; agent sol-verifier
  • Phase 2 reviewers: gpt-6.2-astra — general (completed, effort high); agent phase2-reviewer, gpt-6.2-astra — architecture-layering (completed, effort high); agent phase2-reviewer, gpt-6.2-astra — ffi-engineer (completed, effort high); agent phase2-reviewer, gpt-6.2-astra — platform-versioning (completed, effort high); agent phase2-reviewer, gpt-6.2-astra — rust-quality (completed, effort high); agent phase2-reviewer, gpt-6.2-astra — security-auditor (completed, effort high); agent phase2-reviewer, gpt-6.2-astra — tenderdash-consensus-security (completed, effort high); agent phase2-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.

@github-actions

Copy link
Copy Markdown
Contributor

Bots are done — your move: post /self-reviewed.
Full checklist in the description.

@github-actions github-actions Bot added waiting-self-review Waiting for the author to post /self-reviewed and removed waiting-bots Waiting for the review bots to report on this head labels Nov 25, 2026
@QuantumExplorer
QuantumExplorer merged commit 61c9725 into v5.2-dev Nov 25, 2026
35 of 36 checks passed
@QuantumExplorer
QuantumExplorer deleted the chore/merge-v5.1-dev-into-v5.2-dev branch November 25, 2026 13:12
QuantumExplorer added a commit that referenced this pull request Nov 25, 2026
…cycle-boundary

The base now carries v5.1-dev's shielded Clear design (#6283): the host
deletes its rows after Clear returns, a clear generation counter and
per-wallet binding checks catch what slips through, and the wallet
entry points take the coordinator as a parameter. This branch keeps one
mechanism, its own:

- The manager owns the coordinator and Clear wipes the host inside the
  admission. `clear_generation`, `operation_guard`, the wallet's
  `ShieldedBinding` checks, `admit_shielded_spend`,
  `admit_shielded_payment`, `admit_single_flight_shielded_spend` and
  `shield_turn` are not kept.
- The base's refusal (`ShieldedOperationInProgress`, FFI code 84) is
  the one this branch already had. The coordinator lock behind it takes
  the base's name, `operation_admission`, and its `clear_in_progress()`
  flag.
- Every entry point the base added (token pool purchase, transfer and
  unshield, shielded tips, tip address preparation, private document
  create, the profile write) takes `lock_for_shielded_operation` and
  the admission like the others, without a coordinator parameter. A
  wallet not bound again since a Clear is refused with
  `ShieldedNotBound`, decided by its registration.
- FFI and JNI: the exports keep the base's C signatures. The JNI bridge
  overrides carry both sides' slots.
- Kotlin and Swift: the row deletion after Clear, Kotlin's
  `PendingHostWipe` and its ledger hold around Clear, and Swift's
  `hasAdmittedNativeOp` preflight are not kept; Rust wipes the host and
  decides whether a Clear may run.

Tests that pinned a mechanism not kept were rewritten to pin this
design's guarantee, or removed where the scenario cannot occur (a
second coordinator for one wallet, a queued shield-class spend handing
its gate back).

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@shumkov shumkov mentioned this pull request Nov 26, 2026
9 of 16 tasks
@shumkov shumkov mentioned this pull request Nov 26, 2026
6 of 17 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

waiting-self-review Waiting for the author to post /self-reviewed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants