Skip to content

feat(dashmate): replace js-drive-abci with rs-drive-abci - #926

Merged
lklimek merged 8 commits into
feat/abci_validationfrom
feat/dashmate-rs-drive
Apr 19, 2023
Merged

feat(dashmate): replace js-drive-abci with rs-drive-abci #926
lklimek merged 8 commits into
feat/abci_validationfrom
feat/dashmate-rs-drive

Conversation

@lklimek

@lklimek lklimek commented Apr 18, 2023

Copy link
Copy Markdown
Contributor

Issue being fixed or feature implemented

dashmate should create networks using rs-drive-abci instead of js-drive-abci.

What was done?

  1. Reverted schema URL: from 'https://schema.dash.org/dpp-0-4-0/meta/data-contract#' back to 'http://json-schema.org/draft-07/schema#'
  2. Updated docker compose files for drive_abci to use rs-drive-abci/Dockerfile
  3. Adjusted configuration
  4. Fixed some build issues

How Has This Been Tested?

#! /bin/bash -x

yarn reset --hard

docker rm -f `docker ps -q`
docker volume rm -f `docker volume list -q`
docker network prune -f

rm -rf /home/ubuntu/.dashmate

set -e

scripts/configure_dashmate.sh

yarn setup
yarn start

Breaking Changes

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 made corresponding changes to the documentation

For repository code-owners and collaborators only

  • I have assigned this pull request to a milestone

@lklimek
lklimek force-pushed the feat/dashmate-rs-drive branch from 49120ab to 77363af Compare April 19, 2023 11:29
Comment thread Cargo.toml
"packages/rs-drive",
"packages/rs-platform-value",
"packages/rs-drive-abci",
"packages/rs-drive-nodejs",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We might want to keep this, after all bindings for node-js are a good thing to have, even if we don't use them in our own project.

@lklimek
lklimek marked this pull request as ready for review April 19, 2023 11:54
@lklimek
lklimek merged commit ea79546 into feat/abci_validation Apr 19, 2023
@lklimek
lklimek deleted the feat/dashmate-rs-drive branch April 19, 2023 11:59
bfoss765 added a commit to bfoss765/platform that referenced this pull request Aug 9, 2026
… the persisted transaction row

dashpay/rust-dashcore#926 established that a `DashpayExternalAccount` is
watch-only by construction — its addresses derive from a contact's xpub,
so they are the contact's coins and this wallet only ever pays into them
— and removed those accounts from `all_funding_accounts` so they stop
counting toward balance and UTXO aggregation.

The persistence seam is the same rule's second home, and it was missed.

Upstream `check_core_transaction` emits one `TransactionRecord` per
matched account, so a payment to a contact produces two records sharing
one txid: the funding account's (`Outgoing`, `net = change - spent`) and
the external account's (`Incoming`, `net = +paid`). `build_core_changeset`
projected both into `CoreChangeSet.records`, and `derive_new_utxos` turned
the contact's output into a wallet UTXO. Because the persisted
`transactions` row is keyed by txid alone — the
`transaction_account_involvements` table is only written for provider-key
accounts, so there is no per-account dimension to disambiguate — the
watch-only record defined the stored row. Field capture on testnet: a
0.69998912 DASH payment away was persisted as `direction=incoming`,
`netAmount=+69998912` instead of `-70000000`, and the paid output sat in
`txos` with `isSpent=0` indefinitely, inflating any SQL-sum balance.

Records owned by an external account are now excluded from the
persist-time projection: no transaction row, no new TXO. The funding
account's record — already correct — becomes the row that lands.

Everything genuinely ours from the same event is preserved: address-used
flips and highest-used watermarks (so contact address rotation keeps
working), derived-address rows, and `derive_spent_utxos`, which stays
unfiltered so a contact spending an output persisted by a pre-fix build
still clears the stale row.

Eight regression tests cover the record pair a real contact payment
produces, the standalone first-sighting path, the confirmation re-emit,
a genuine receive, a DashPay *receival* account receive (the boundary
dashpay#926 drew, which must stay incoming/positive), and an internal transfer.
The four fix-dependent ones were verified to fail without the change.
QuantumExplorer pushed a commit that referenced this pull request Aug 11, 2026
… the persisted transaction row

dashpay/rust-dashcore#926 established that a `DashpayExternalAccount` is
watch-only by construction — its addresses derive from a contact's xpub,
so they are the contact's coins and this wallet only ever pays into them
— and removed those accounts from `all_funding_accounts` so they stop
counting toward balance and UTXO aggregation.

The persistence seam is the same rule's second home, and it was missed.

Upstream `check_core_transaction` emits one `TransactionRecord` per
matched account, so a payment to a contact produces two records sharing
one txid: the funding account's (`Outgoing`, `net = change - spent`) and
the external account's (`Incoming`, `net = +paid`). `build_core_changeset`
projected both into `CoreChangeSet.records`, and `derive_new_utxos` turned
the contact's output into a wallet UTXO. Because the persisted
`transactions` row is keyed by txid alone — the
`transaction_account_involvements` table is only written for provider-key
accounts, so there is no per-account dimension to disambiguate — the
watch-only record defined the stored row. Field capture on testnet: a
0.69998912 DASH payment away was persisted as `direction=incoming`,
`netAmount=+69998912` instead of `-70000000`, and the paid output sat in
`txos` with `isSpent=0` indefinitely, inflating any SQL-sum balance.

Records owned by an external account are now excluded from the
persist-time projection: no transaction row, no new TXO. The funding
account's record — already correct — becomes the row that lands.

Everything genuinely ours from the same event is preserved: address-used
flips and highest-used watermarks (so contact address rotation keeps
working), derived-address rows, and `derive_spent_utxos`, which stays
unfiltered so a contact spending an output persisted by a pre-fix build
still clears the stale row.

Eight regression tests cover the record pair a real contact payment
produces, the standalone first-sighting path, the confirmation re-emit,
a genuine receive, a DashPay *receival* account receive (the boundary
#926 drew, which must stay incoming/positive), and an internal transfer.
The four fix-dependent ones were verified to fail without the change.
QuantumExplorer added a commit that referenced this pull request Aug 11, 2026
…y-wallet

rust-dashcore#952 (merged as 9c0e8742) gave the #926 policy a canonical
home: AccountType::is_contact_owned(), with an exhaustive match so any
future account type must declare whether its coins are the wallet's or
a contact's. Bump the workspace pin to the dev tip (37b1a361, which
also brings dash-spv sync-reliability fixes #941/#943/#949/#953) and
make is_contact_watch_only delegate to the upstream predicate instead
of matching DashpayExternalAccount locally.

Co-Authored-By: Claude Fable 5 <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.

4 participants