Skip to content

feat(dpp)!: dashpay profile payment addresses for core and platform - #4380

Merged
QuantumExplorer merged 4 commits into
v4.2-devfrom
feat/dashpay-tips-jar
Aug 12, 2026
Merged

feat(dpp)!: dashpay profile payment addresses for core and platform#4380
QuantumExplorer merged 4 commits into
v4.2-devfrom
feat/dashpay-tips-jar

Conversation

@QuantumExplorer

@QuantumExplorer QuantumExplorer commented Aug 12, 2026

Copy link
Copy Markdown
Member

Issue being fixed or feature implemented

First slice of DIP-33 (dashpay/dips#188): the public "tips" tier. A DashPay profile can carry public payment addresses for the Core chain and for Platform address funds, so anyone resolving a profile can pay its owner with zero handshake. Payments to these addresses are intentionally public and linkable to the profile; the non-public tier (payment detection keys + stealth one-time addresses) follows in a separate PR stacked on this one (#4272).

What was done?

  • DashPay contract v2 at protocol version 14, following the DPNS-v2 pattern (schema/v2, src/v2, system_data_contract_versions v3 with dashpay: 2, v14.rs repoint, contract reload in transition_to_version_14).
  • The profile document type gains two optional fields, positions appended after displayName:
    • corePaymentAddress (position 5) — 21-byte storage form: variant byte 0x00 P2PKH / 0x01 P2SH + 20-byte HASH160. No network byte: the network follows the Platform chain, so a mismatch is unrepresentable. Clients render Base58Check for their network.
    • platformPaymentAddress (position 6) — same 21-byte DIP-18 storage form.
  • Existing fields, indices, and required properties unchanged; third-party contract mirrors stay valid.
  • Includes the monotonic system-contract cache guard so the PV14 contract reload can't regress a newer cached version.
  • PV14 rebaselines: check_tx fees, document replace/delete fees, profile fixture strings, deterministic root hash.

How Has This Been Tested?

  • transition_to_version_14 test asserts the profile document type gains both fields across the protocol-change boundary.
  • Full drive-abci check_tx + batch document suites (177 tests), drive deterministic root hash and cache tests, dashpay-contract tests — all green locally.
  • cargo clippy --workspace --all-features clean; cargo fmt applied.

Breaking Changes

Consensus-breaking at protocol version 14: the DashPay system contract is reloaded at v2 on the first block after the protocol change. Pre-release; no migration concerns.

Checklist:

  • I have performed a self-review of my own code
  • 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

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

Summary by CodeRabbit

  • New Features
    • Added DashPay contract version 2 support for profiles, contact information, and contact requests.
    • Added optional core and platform payment-address fields to profiles.
    • Added validation for required fields, encryption, media types, data limits, dependent properties, and payment-address formats.
  • Improvements
    • Platform version 14 now applies the updated DashPay contract definitions.
    • Improved contract cache handling to prevent older versions replacing newer data.
  • Bug Fixes
    • Updated processing fees and serialized data expectations for latest protocol behavior.

DashPay contract v2 (protocol version 14): the profile document gains two
optional public payment fields — corePaymentAddress (position 5) and
platformPaymentAddress (position 6), both the 21-byte storage form
(variant byte 0x00 P2PKH / 0x01 P2SH + 20-byte HASH160). Payments to
them are intentionally public and linkable to the profile (per DIP-33,
the public tier); no derivation-source publishing.

Follows the DPNS-v2 versioning pattern: schema/v2 +
system_data_contract_versions v3 (dashpay: 2) at PV14, with the
contract reload on the first block after the protocol change.

Rebaselines PV14 fees (check_tx, replace, delete), profile fixture
strings, and the deterministic root hash.

Extracted from the larger payment-addresses branch; payment detection
key purposes and stealth derivation follow in a separate PR.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions github-actions Bot added this to the v4.2.0 milestone Aug 12, 2026
@coderabbitai

coderabbitai Bot commented Aug 12, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: cd43a297-600f-4bc0-85df-b5e6e8805b52

📥 Commits

Reviewing files that changed from the base of the PR and between 506be16 and cbd7e9c.

📒 Files selected for processing (1)
  • packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v10.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v10.rs

📝 Walkthrough

Walkthrough

DashPay v2 schemas and loading were added. Platform v14 now selects and reapplies the updated system contract. Profile payment addresses receive data-trigger validation. Contract-cache insertion now rejects stale versions atomically. Related fee, hash, migration, and document expectations were updated.

Changes

DashPay v2 rollout

Layer / File(s) Summary
DashPay v2 schema and loader
packages/dashpay-contract/schema/v2/..., packages/dashpay-contract/src/...
Added profile, contactInfo, and contactRequest schemas. Added version-aware v2 schema loading.
Protocol v14 contract rollout
packages/rs-platform-version/..., packages/rs-drive-abci/src/execution/platform_events/..., packages/rs-drive/tests/deterministic_root_hash.rs, packages/rs-drive-abci/src/execution/check_tx/...
Platform v14 selects the updated system contract versions. The upgrade reapplies DashPay v2 and adds payment-address fields. Fee and root-hash expectations were updated.
Profile payment-address validation
packages/rs-drive-abci/src/execution/validation/..., packages/rs-platform-version/src/version/drive_abci_versions/...
Version 2 bindings validate profile payment-address type bytes. Validation configuration and document tests were updated.
Version-ordered contract cache
packages/rs-drive/src/cache/..., packages/rs-drive/src/drive/contract/...
DataContractCache::insert atomically ignores older versions and replaces equal or newer versions. Tests and concurrency documentation cover the behavior.

Estimated code review effort: 4 (Complex) | ~60 minutes

Sequence Diagram(s)

sequenceDiagram
  participant ProtocolDispatcher
  participant UpgradeTransaction
  participant DashPaySystemContract
  participant ProfileSchema
  ProtocolDispatcher->>UpgradeTransaction: invoke transition_to_version_14
  UpgradeTransaction->>DashPaySystemContract: load and reapply DashPay v2
  DashPaySystemContract->>ProfileSchema: add payment-address fields
  ProfileSchema-->>UpgradeTransaction: return updated profile schema
Loading

Possibly related PRs

  • dashpay/platform#4272 — Related DashPay v2 schema, protocol v14 migration, and payment-address validation changes.

Suggested reviewers: lklimek, llbartekll, zocolini

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: adding DashPay profile payment addresses for Core and Platform.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/dashpay-tips-jar

Comment @coderabbitai help to get the list of available commands.

@thepastaclaw

thepastaclaw commented Aug 12, 2026

Copy link
Copy Markdown
Collaborator

🕓 Ready for review — 4 ahead in queue (commit cbd7e9c)
Queue position: 5/5 · 1 review active
ETA: start ~16:44 UTC · complete ~17:01 UTC (median 17m across 30 recent reviews; 2 slots)
Queued 51m ago · Last checked: 2026-08-12 16:10 UTC

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@packages/dashpay-contract/schema/v2/dashpay.schema.json`:
- Around line 62-76: The payment-address schema fields corePaymentAddress and
platformPaymentAddress currently validate only length; add first-byte validation
allowing only 0x00 or 0x01 while preserving the 21-byte constraint. Update the
11 replacement assertions in
packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/replacement.rs
at lines 1451, 1532, 1672, 1754, 1798, 1934, 2016, 2060, 2200, 2282, and 2326 to
use valid type bytes instead of values beginning with 0x3a or 0x14.

In
`@packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/perform_events_on_first_block_of_protocol_change/v0/mod.rs`:
- Around line 1087-1090: Extend the pre-upgrade assertions near the existing
corePaymentAddress check to also verify that pre_profile does not contain
"platformPaymentAddress". Preserve the existing rejection behavior and
diagnostic style for both payment-address fields before
transition_to_version_14.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: fd37586f-bab4-4d0b-a437-c8841fbd1678

📥 Commits

Reviewing files that changed from the base of the PR and between df6d445 and 2e0d766.

📒 Files selected for processing (13)
  • packages/dashpay-contract/schema/v2/dashpay.schema.json
  • packages/dashpay-contract/src/lib.rs
  • packages/dashpay-contract/src/v2/mod.rs
  • packages/rs-drive-abci/src/execution/check_tx/v0/mod.rs
  • packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/perform_events_on_first_block_of_protocol_change/v0/mod.rs
  • packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/deletion.rs
  • packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/replacement.rs
  • packages/rs-drive/src/cache/data_contract.rs
  • packages/rs-drive/src/drive/contract/refresh_cache/mod.rs
  • packages/rs-drive/tests/deterministic_root_hash.rs
  • packages/rs-platform-version/src/version/system_data_contract_versions/mod.rs
  • packages/rs-platform-version/src/version/system_data_contract_versions/v3.rs
  • packages/rs-platform-version/src/version/v14.rs

Comment thread packages/dashpay-contract/schema/v2/dashpay.schema.json
@codecov

codecov Bot commented Aug 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 94.86607% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 87.64%. Comparing base (08872d2) to head (cbd7e9c).
⚠️ Report is 2 commits behind head on v4.2-dev.

Files with missing lines Patch % Lines
...events_on_first_block_of_protocol_change/v0/mod.rs 96.78% 8 Missing ⚠️
...h/data_triggers/triggers/dashpay/profile_v0/mod.rs 80.00% 8 Missing ⚠️
...itions/batch/data_triggers/triggers/dashpay/mod.rs 78.26% 5 Missing ⚠️
...ansitions/batch/data_triggers/bindings/list/mod.rs 80.00% 1 Missing ⚠️
packages/rs-drive/src/cache/data_contract.rs 98.36% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           v4.2-dev    #4380      +/-   ##
============================================
+ Coverage     87.63%   87.64%   +0.01%     
============================================
  Files          2670     2672       +2     
  Lines        339447   339890     +443     
============================================
+ Hits         297465   297892     +427     
- Misses        41982    41998      +16     
Components Coverage Δ
dpp 88.87% <ø> (+<0.01%) ⬆️
drive 86.26% <98.36%> (+<0.01%) ⬆️
drive-abci 89.68% <94.31%> (+0.01%) ⬆️
sdk ∅ <ø> (∅)
dapi-client ∅ <ø> (∅)
platform-version ∅ <ø> (∅)
platform-value 92.92% <ø> (+0.03%) ⬆️
platform-wallet ∅ <ø> (∅)
drive-proof-verifier 48.02% <ø> (ø)
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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

Preliminary review — Codex only

The protocol-v14 contract versioning and cache-refresh changes follow the established upgrade structure, but the new payment-address fields accept values whose leading byte is not a supported P2PKH/P2SH type, including values already exercised by the replacement fixtures. The focused DashPay and upgrade tests also leave the v2 schema boundaries, production dispatcher/cache path, and legacy-document compatibility insufficiently covered.
Source: reviewer backends gpt-5.6-sol (general), gpt-5.6-sol (security-auditor), and gpt-5.6-sol (rust-quality); final verifier backend gpt-5.6-sol. openclaw-agent/cliproxy/gpt-5.6-sol is orchestration-only and not reviewer evidence.

Validated blockers were found in the Codex precheck. Opus is deferred until a fresh Codex revalidation clears the blocker gate.

Review provenance

  • Codex reviewers: gpt-5.6-sol — general (completed), gpt-5.6-sol — security-auditor (completed), gpt-5.6-sol — rust-quality (completed)
  • Verifier: gpt-5.6-sol — verifier
  • Sonnet: not run (deferred by blocker gate)

🔴 1 blocking | 🟡 2 suggestion(s)

1 additional finding(s) omitted (not in diff).

🤖 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 `packages/dashpay-contract/schema/v2/dashpay.schema.json`:
- [BLOCKING] packages/dashpay-contract/schema/v2/dashpay.schema.json:62-76: Reject unsupported payment-address type bytes
  These fields are defined as storage-form P2PKH/P2SH addresses, whose leading byte must be 0x00 or 0x01, but consensus currently checks only that the value contains 21 bytes. The replacement tests confirm the gap rather than merely exposing a theoretical possibility: accepted profile documents contain corePaymentAddress beginning with 0x3a and platformPaymentAddress beginning with 0x14. Such values cannot be decoded as the advertised address type, so Platform can publish a payment endpoint that conforming clients must reject. Enforce the type-byte invariant for both fields during profile creation and replacement, using a supported custom content type or a DashPay profile data trigger, and test acceptance of 0x00/0x01 plus rejection of all other leading bytes.

In `packages/dashpay-contract/test/unit/schema.spec.js`:
- [SUGGESTION] packages/dashpay-contract/test/unit/schema.spec.js:8: Exercise the DashPay v2 schema in the contract package
  The package's only schema suite imports schema/v1/dashpay.schema.json, so the focused DashPay test command does not validate the newly added v2 profile definitions. It therefore cannot detect invalid 20- or 22-byte payment-address values being accepted, valid 21-byte values being rejected, changes to existing profile constraints, or accidental exposure of the new fields in v1. Keep the v1 regression suite and run equivalent profile validation against v2, including explicit boundary and type-byte cases for both payment-address fields.

In `packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/perform_events_on_first_block_of_protocol_change/v0/mod.rs`:
- [SUGGESTION] packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/perform_events_on_first_block_of_protocol_change/v0/mod.rs:1087-1092: Cover the production v13-to-v14 upgrade boundary
  This test invokes transition_to_version_14 directly, bypassing perform_events_on_first_block_of_protocol_change and its version-1 wrapper that refreshes the contract caches. It consequently cannot catch an incorrect method-version dispatch, a missing v13-to-v14 condition, or stale cached contract data in the production path. It also stores no v1 profile before replacing the contract, so compatibility of existing profile bytes with the appended v2 properties remains untested. In the current pre-upgrade assertion, only corePaymentAddress is checked even though the comment claims both fields are absent, allowing accidental early exposure of platformPaymentAddress to pass. Add a boundary test that stores a v1 profile, warms the contract cache, asserts both properties are absent, calls the public protocol-change dispatcher, and then reads both the legacy profile and refreshed v2 contract through normal Drive APIs.

Comment thread packages/dashpay-contract/schema/v2/dashpay.schema.json
…er, cover the v13-v14 boundary

Address review: the 21-byte schema constraint alone accepted values whose
leading byte is not a supported address type. A new data trigger (bindings
list v2, PV14) rejects profile creates/replaces whose corePaymentAddress or
platformPaymentAddress does not start with 0x00 (P2PKH) or 0x01 (P2SH) —
unlike a Base58Check string, the storage form has no checksum, so this
check makes accepted values fully decodable.

- profile fixtures now carry valid type bytes (guarded to schema versions
  that have the fields, so protocol-version-11 variants are untouched)
- acceptance/rejection matrix test for both fields across leading bytes
- boundary test drives the v13→v14 upgrade through the production
  perform_events_on_first_block_of_protocol_change dispatcher with a
  stored v1 profile and warmed contract cache, asserting both fields
  absent before, present after, and the legacy profile still readable
- pre-upgrade assertion now also covers platformPaymentAddress
- rebaselines for the schema description change (check_tx fees, root hash)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/deletion.rs (1)

81-89: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Extract the repeated payment-address fixture setup into a shared helper.

The same block appears at lines 81-89 and 802-810 in this file, and in replacement.rs and creation.rs. See the consolidated comment for the full list of sites.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/deletion.rs`
around lines 81 - 89, Extract the repeated corePaymentAddress and
platformPaymentAddress fixture initialization into a shared helper, then replace
the inline blocks in this deletion test and the corresponding sites in
replacement.rs and creation.rs with calls to it. Preserve the existing
profile-property guard and exact address byte values through the helper.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In
`@packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/creation.rs`:
- Around line 154-155: Rename the test function
test_profile_payment_address_type_byte_enforcement to a descriptive
should-prefixed name, such as should_enforce_profile_payment_address_type_bytes,
without changing its test behavior.

---

Nitpick comments:
In
`@packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/deletion.rs`:
- Around line 81-89: Extract the repeated corePaymentAddress and
platformPaymentAddress fixture initialization into a shared helper, then replace
the inline blocks in this deletion test and the corresponding sites in
replacement.rs and creation.rs with calls to it. Preserve the existing
profile-property guard and exact address byte values through the helper.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 2558b0c4-40c8-4f10-9ace-dc205f4116d8

📥 Commits

Reviewing files that changed from the base of the PR and between 2e0d766 and f1ef4cc.

📒 Files selected for processing (22)
  • packages/dashpay-contract/schema/v2/dashpay.schema.json
  • packages/rs-drive-abci/src/execution/check_tx/v0/mod.rs
  • packages/rs-drive-abci/src/execution/platform_events/protocol_upgrade/perform_events_on_first_block_of_protocol_change/v0/mod.rs
  • packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/data_triggers/bindings/list/mod.rs
  • packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/data_triggers/bindings/list/v2/mod.rs
  • packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/data_triggers/triggers/dashpay/mod.rs
  • packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/data_triggers/triggers/dashpay/profile_v0/mod.rs
  • packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/creation.rs
  • packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/deletion.rs
  • packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/replacement.rs
  • packages/rs-drive/tests/deterministic_root_hash.rs
  • packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/mod.rs
  • packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v1.rs
  • packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v10.rs
  • packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v2.rs
  • packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v3.rs
  • packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v4.rs
  • packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v5.rs
  • packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v6.rs
  • packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v7.rs
  • packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v8.rs
  • packages/rs-platform-version/src/version/drive_abci_versions/drive_abci_validation_versions/v9.rs
🚧 Files skipped from review as they are similar to previous changes (3)
  • packages/rs-drive/tests/deterministic_root_hash.rs
  • packages/rs-drive-abci/src/execution/check_tx/v0/mod.rs
  • packages/dashpay-contract/schema/v2/dashpay.schema.json

…xed test name

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/mod.rs (2)

8-18: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Use the shared fixture helper in all document test modules.

packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/creation.rs, deletion.rs, and replacement.rs still define local copies of set_valid_profile_payment_addresses at lines 8-18. Their calls therefore do not use this implementation. Remove the local copies and import super::set_valid_profile_payment_addresses in each module. This keeps the payment-address fixture format in one place.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/mod.rs`
around lines 8 - 18, Remove the local set_valid_profile_payment_addresses
definitions from the creation, deletion, and replacement test modules, and
import the shared super::set_valid_profile_payment_addresses helper in each
module so all calls use the centralized fixture implementation.

12-17: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Check each payment field independently.

The condition checks only corePaymentAddress, but the body also sets platformPaymentAddress. If a versioned profile schema exposes only one optional field, this helper can omit a declared field or add an undeclared field. Check each property before setting it. The current DashPay v2 schema defines both fields, so this protects other versioned fixtures.

Suggested guard change
     if profile.properties().contains_key("corePaymentAddress") {
         document.set("corePaymentAddress", vec![0u8; 21].into());
+    }
+    if profile.properties().contains_key("platformPaymentAddress") {
         let mut platform_payment_address = vec![1u8];
         platform_payment_address.extend([0u8; 20]);
         document.set("platformPaymentAddress", platform_payment_address.into());
     }
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In
`@packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/mod.rs`
around lines 12 - 17, Update the profile fixture setup around the existing
properties().contains_key checks so corePaymentAddress and
platformPaymentAddress are validated independently before calling document.set
for each field. Preserve the current values, but ensure each optional field is
set only when that property exists in the versioned schema.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In
`@packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/mod.rs`:
- Around line 8-18: Remove the local set_valid_profile_payment_addresses
definitions from the creation, deletion, and replacement test modules, and
import the shared super::set_valid_profile_payment_addresses helper in each
module so all calls use the centralized fixture implementation.
- Around line 12-17: Update the profile fixture setup around the existing
properties().contains_key checks so corePaymentAddress and
platformPaymentAddress are validated independently before calling document.set
for each field. Preserve the current values, but ensure each optional field is
set only when that property exists in the versioned schema.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 3d4a29dc-efac-4740-86eb-41dbcdef9d3d

📥 Commits

Reviewing files that changed from the base of the PR and between f1ef4cc and 506be16.

📒 Files selected for processing (4)
  • packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/creation.rs
  • packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/deletion.rs
  • packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/replacement.rs
  • packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/mod.rs
🚧 Files skipped from review as they are similar to previous changes (3)
  • packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/creation.rs
  • packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/deletion.rs
  • packages/rs-drive-abci/src/execution/validation/state_transition/state_transitions/batch/tests/document/replacement.rs

@QuantumExplorer

Copy link
Copy Markdown
Member Author

Re the latest CodeRabbit nitpick (review 4917495684): not applicable — set_valid_profile_payment_addresses is defined exactly once, in batch/tests/mod.rs, and there are no local copies in creation.rs/deletion.rs/replacement.rs (their lines 8–18 are ordinary imports/test code). All 15 call sites resolve to the shared helper via the modules' use super::* chain.

🤖 Addressed by Claude Code

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@QuantumExplorer
QuantumExplorer merged commit f05bf82 into v4.2-dev Aug 12, 2026
43 checks passed
@QuantumExplorer
QuantumExplorer deleted the feat/dashpay-tips-jar branch August 12, 2026 16:15
bfoss765 added a commit that referenced this pull request Aug 12, 2026
Carries #4380 (dashpay profile payment addresses, breaking dpp) + #4381
(rust-dashcore pin bump) + the shield-preflight family. Resolutions:

- platform_wallet.rs / shielded_send.rs: false overlaps — keep BOTH our
  identity_create_from_one_time_key surface and v4.2-dev's
  shielded_shield_preflight/plan additions.
- Error-code collision: v4.2-dev allocated 37-40 to the DPNS marketplace
  block and 41 to the shield-capacity shortfall, colliding with our
  ErrorShieldedInviteAlreadyClaimed = 37. Renumbered ours to 43 on every
  surface (Rust FFI enum, Kotlin arm + test pin, Swift raw value), the
  allocation the integration branch already ships in QA AARs (42 stays
  reserved to match it).
- DashSdkError.kt / PlatformWalletResult.swift: keep both sides' new
  error classes/cases, ours renumbered and ordered after the v4.2-dev
  blocks.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
bfoss765 added a commit that referenced this pull request Aug 12, 2026
Carries #4380 (dashpay profile payment addresses) + #4381 (rust-dashcore
pin bump). Conflict + pooled-funding reconciliation, mirroring the
resolutions already proven on the integration branch:

- identity/network/payments.rs: keep the in-broadcast refusal block,
  return the 5-tuple with offered_accounts, and sweep the release across
  every offered account (pooled selection) instead of the single
  managed_account.
- asset_lock/build.rs: the refusal-path release now sweeps
  result.funding_accounts owner-guarded (the pre-merge single
  funding_account param no longer exists under pooled funding).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants