Page MenuHomePhabricator

[Cashtab] Use the min fee as the default for all users
ClosedPublic

Authored by bytesofman on Sep 11 2025, 04:16.

Details

Reviewers
Fabien
Group Reviewers
Restricted Project
Commits
rABCe78c5ab7d815: [Cashtab] Use the min fee as the default for all users
Summary

Now that we have strongly typed libs and all fee calculations are exact, there is no reason for fees to be a user setting. It should just be the min.

However, it is useful to keep it available as a setting, since this lets us mock different fees for different tests, which lets us show that we are not breaking past functionality at least in this diff. Also in the future, we may want to expose a fee setting.

Gamification and "VIP" features is a good concept but needs some more thought. The min fee thing isn't a good prize. It was rolled out this way when we were still unsure about the fee calc but that is no longer the case, all users should have min fees.

This diff

  • Implements min fees for all Cashtab users
  • Removes the VIP setting
  • Introduces satsPerKb as a hidden setting. For now, not accessible to users, but can be used to mock different fee rates in tests (allows us to keep existing mocks in existing tests)
Test Plan

npm test

this diff is deployed to cashtab.io

Diff Detail

Repository
rABC Bitcoin ABC
Branch
low-fees-for-all
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 34406
Build 68280: Build Diffcashtab-tests
Build 68279: arc lint + arc unit

Event Timeline

Tail of the build log:

> 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

added 1462 packages, and audited 2876 packages in 13s

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

21 vulnerabilities (3 low, 10 moderate, 3 high, 5 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.36.2 build
> node scripts/build.js

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

TS2345: Argument of type '{ balanceVisible: boolean; fiatCurrency: string; sendModal: boolean; autoCameraOn: boolean; hideMessagesFromUnknownSenders: boolean; satsPerKb: bigint; }' is not assignable to parameter of type 'CashtabSettings'.
  Property 'serialize' is missing in type '{ balanceVisible: boolean; fiatCurrency: string; sendModal: boolean; autoCameraOn: boolean; hideMessagesFromUnknownSenders: boolean; satsPerKb: bigint; }' but required in type 'CashtabSettings'.
    25 |     ): void => {
    26 |         // Update settings in state and localforage
  > 27 |         updateCashtabState('settings', {
       |                                        ^
  > 28 |             ...settings,
       | ^^^^^^^^^^^^^^^^^^^^^^^^
  > 29 |             balanceVisible: e.target.checked,
       | ^^^^^^^^^^^^^^^^^^^^^^^^
  > 30 |         });
       | ^^^^^^^^^^
    31 |     };
    32 |
    33 |     const SwitchInputWrapper = styled.label`


Build cashtab-tests failed with exit code 1

store satsPerKb as a num not a bigint, simplify appConfig

Tail of the build log:

To address all issues, run:
  npm audit fix

Run `npm audit` for details.

> ecash-lib@4.3.3 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

added 1462 packages, and audited 2876 packages in 12s

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

21 vulnerabilities (3 low, 10 moderate, 3 high, 5 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.36.2 build
> node scripts/build.js

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

TS2345: Argument of type 'bigint' is not assignable to parameter of type 'number'.
    709 |                       wallet,
    710 |                       targetOutputs,
  > 711 |                       BigInt(settings.satsPerKb),
        |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^
    712 |                       chaintipBlockheight,
    713 |                       // per spec, this must be at index 0
    714 |                       // https://github.com/simpleledger/slp-specifications/blob/master/slp-nft-1.md


Build cashtab-tests failed with exit code 1

Tail of the build log:

To address all issues, run:
  npm audit fix

Run `npm audit` for details.

> ecash-lib@4.3.3 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

added 1462 packages, and audited 2876 packages in 12s

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

21 vulnerabilities (3 low, 10 moderate, 3 high, 5 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.36.2 build
> node scripts/build.js

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

TS2345: Argument of type 'bigint' is not assignable to parameter of type 'number'.
    708 |                       wallet,
    709 |                       targetOutputs,
  > 710 |                       BigInt(settings.satsPerKb),
        |                       ^^^^^^^^^^^^^^^^^^^^^^^^^^
    711 |                       chaintipBlockheight,
    712 |                       // per spec, this must be at index 0
    713 |                       // https://github.com/simpleledger/slp-specifications/blob/master/slp-nft-1.md


Build cashtab-tests failed with exit code 1

remove defunct tests, remove un-needed jest config changes, lint

more type fixes, string to num for satsperkb

remove last string for num satsPerKb

bytesofman edited the test plan for this revision. (Show Details)
Fabien requested changes to this revision.Sep 12 2025, 08:35
Fabien added a subscriber: Fabien.
Fabien added inline comments.
cashtab/src/components/App/__tests__/App.test.js
567 ↗(On Diff #55609)

Can we have a constant for this ?

cashtab/src/config/CashtabSettings.ts
28 ↗(On Diff #55609)

dito

96 ↗(On Diff #55609)

Actually anything above 1000 is probably a better fit. Otherwise the tx will be rejected by all nodes unless they use non default settings

cashtab/src/config/app.ts
53 ↗(On Diff #55609)

dito

This revision now requires changes to proceed.Sep 12 2025, 08:35

better validation for cashtab fee setting

Fabien requested changes to this revision.Sep 12 2025, 15:31
Fabien added inline comments.
cashtab/src/validation/fixtures/vectors.js
1333 ↗(On Diff #55624)

Use CONSTANT - 1 so it doesn't fail if the value changes

1346 ↗(On Diff #55624)

Same with CONSTANT + 1

This revision now requires changes to proceed.Sep 12 2025, 15:31

use const +/- 1 in tests for better robustness

This revision is now accepted and ready to land.Sep 12 2025, 16:41