Skip to content

platform-wallet: keep the DashPay backfill coverage codec and delivery policy out of FFI/JNI #5505

Open

Description

@shumkov

Problem

Two pieces of DashPay backfill coverage logic that platform-wallet owns are duplicated in binding crates:

  • rs-unified-sdk-jni (persistence.rs) re-implements the persisted coverage format: it defines the 72-byte entry width, validates blob alignment, decides to discard malformed records and decodes each field. platform-wallet already owns this codec and its malformed-blob contract (DashPayBackfillRecord::from_parts, with covered_bytes as the inverse), and the JNI write path re-implements the packing too.
  • rs-platform-wallet-ffi (persistence.rs) decides whether a backfill record is delivered to the host (atomic changesets, cursor presence, cursor callback delivery). That is coverage eligibility policy, which platform-wallet owns through persists_backfill_coverage and settle_published_backfill.

A future change to the format or the delivery rules then needs synchronized edits in Rust, FFI and Android.

Proposal

Expose owner-backed encode/decode through platform-wallet (and platform-wallet-ffi for JNI) and have the bindings call it; move the record-delivery decision into platform-wallet, leaving the adapters to marshal the selected record and report delivery results. Behaviour stays the same.

Activity

  1. added this to the v5.1.0 milestone on Oct 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions