Page MenuHomePhabricator

[Cashtab] Improve handling of tx finality status updates
ClosedPublic

Authored by bytesofman on Aug 18 2025, 18:46.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABCa214ff8662ab: [Cashtab] Improve handling of tx finality status updates
Summary

The current method is both buggy in its own right and unsuited to preconsensus finality. Current logic was written before the isFinal key became available in the Tx interface...tho still, should have used the websocket for this.

Replace the old way of doing it --- track the chaintip, compare chaintip with tx blockheight, if discover a discrepancy update the whole history

with a new way: listen for tx finalized ws msgs, on receipt update that specific tx

note this would be nice to test more extensively. however it is still mostly a rendering thing, which is tested.

Test Plan

npm test, npm start (or checkout cashtab.io) and see that txs finalize

Diff Detail

Repository
rABC Bitcoin ABC
Branch
cashtab-tx-finality-improvements
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 34175
Build 67818: Build Diffcashtab-tests
Build 67817: arc lint + arc unit

Event Timeline

lint, do not pass the now-unused chaintip blockheight to tx history rendering

Tail of the build log:

Run `npm audit` for details.

> ecash-lib@4.3.1 build
> tsc && tsc -p ./tsconfig.build.json && cp -r ./src/ffi ./dist

/work/modules/ecash-agora /work/abc-ci-builds/cashtab-tests

added 272 packages, and audited 275 packages in 1s

37 packages are looking for funding
  run `npm fund` for details

7 vulnerabilities (1 low, 5 moderate, 1 high)

To address all issues, run:
  npm audit fix

Run `npm audit` for details.

> ecash-agora@2.1.0 build
> tsc && tsc -p ./tsconfig.build.json

/work/cashtab /work/abc-ci-builds/cashtab-tests
npm warn deprecated @humanwhocodes/object-schema@2.0.3: Use @eslint/object-schema instead
npm warn deprecated @humanwhocodes/config-array@0.11.14: Use @eslint/config-array instead
npm warn deprecated eslint@8.56.0: This version is no longer supported. Please see https://eslint.org/version-support for other options.

added 1393 packages, and audited 2830 packages in 11s

284 packages are looking for funding
  run `npm fund` for details

17 vulnerabilities (3 low, 9 moderate, 2 high, 3 critical)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

> cashtab@3.33.2 build
> node scripts/build.js

Creating an optimized production build...
Failed to compile.

TS2741: Property 'chaintipBlockheight' is missing in type '{ txs: CashtabTx[]; hashes: string[]; fiatPrice: number | null; fiatCurrency: string; cashtabState: CashtabState; updateCashtabState: UpdateCashtabState; userLocale: string; }' but required in type 'TxHistoryProps'.
    204 |             <TxHistoryCtn data-testid="tx-history">
    205 |                 {isValidParsedTxHistory(parsedTxHistory) ? (
  > 206 |                     <TxHistory
        |                      ^^^^^^^^^
    207 |                         txs={parsedTxHistory}
    208 |                         hashes={hashes}
    209 |                         fiatPrice={fiatPrice}


Build cashtab-tests failed with exit code 1

stop passing now-unused prop in Tx tests

Tail of the build log:

Run `npm audit` for details.

> ecash-lib@4.3.1 build
> tsc && tsc -p ./tsconfig.build.json && cp -r ./src/ffi ./dist

/work/modules/ecash-agora /work/abc-ci-builds/cashtab-tests

added 272 packages, and audited 275 packages in 1s

37 packages are looking for funding
  run `npm fund` for details

7 vulnerabilities (1 low, 5 moderate, 1 high)

To address all issues, run:
  npm audit fix

Run `npm audit` for details.

> ecash-agora@2.1.0 build
> tsc && tsc -p ./tsconfig.build.json

/work/cashtab /work/abc-ci-builds/cashtab-tests
npm warn deprecated @humanwhocodes/object-schema@2.0.3: Use @eslint/object-schema instead
npm warn deprecated @humanwhocodes/config-array@0.11.14: Use @eslint/config-array instead
npm warn deprecated eslint@8.56.0: This version is no longer supported. Please see https://eslint.org/version-support for other options.

added 1393 packages, and audited 2830 packages in 11s

284 packages are looking for funding
  run `npm fund` for details

17 vulnerabilities (3 low, 9 moderate, 2 high, 3 critical)

To address issues that do not require attention, run:
  npm audit fix

To address all issues (including breaking changes), run:
  npm audit fix --force

Run `npm audit` for details.

> cashtab@3.33.2 build
> node scripts/build.js

Creating an optimized production build...
Failed to compile.

TS2741: Property 'chaintipBlockheight' is missing in type '{ txs: CashtabTx[]; hashes: string[]; fiatPrice: number | null; fiatCurrency: string; cashtabState: CashtabState; updateCashtabState: UpdateCashtabState; userLocale: string; }' but required in type 'TxHistoryProps'.
    204 |             <TxHistoryCtn data-testid="tx-history">
    205 |                 {isValidParsedTxHistory(parsedTxHistory) ? (
  > 206 |                     <TxHistory
        |                      ^^^^^^^^^
    207 |                         txs={parsedTxHistory}
    208 |                         hashes={hashes}
    209 |                         fiatPrice={fiatPrice}


Build cashtab-tests failed with exit code 1

stop passing the now-unused param

Fabien requested changes to this revision.Aug 18 2025, 20:11
Fabien added a subscriber: Fabien.
Fabien added inline comments.
cashtab/src/wallet/useWallet.ts
705 ↗(On Diff #55282)

also TX_REMOVED_FROM_MEMPOOL ?

This revision now requires changes to proceed.Aug 18 2025, 20:11

remove debug logs, handle removed from mempool case

This revision is now accepted and ready to land.Aug 18 2025, 21:42