Page MenuHomePhabricator

[ecash-lib] Fix fee estimation for signatories that depend on tx outputs
ClosedPublic

Authored by tobias_ruck on Aug 22 2024, 02:51.

Details

Summary

Currently the TxBuilder estimates the required fee for transactions that have a Signatory that depends on the outputs incorrectly; after splicing out the leftover output, it should run the signatories again so they can update the input scripts again, such that we get a correct fee estimation.

Otherwise the sign function would throw an error despite actually having enough satoshis for the tx.

Worst case this runs the Signatories 3 times (once for initial estimation with leftover, another time to run again to check for sufficient input value after removing the leftover, and the last time to actually sign the signatures), however, having the correct behavior is more important, and also since we use EccDummy, signatories will run cheaply (just a few byte ops).

Test Plan

npm run integration-tests

Diff Detail

Repository
rABC Bitcoin ABC
Branch
ecash-lib-fix-recalc-signatories
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 30057
Build 59648: Build Diffecash-lib-tests · ecash-agora-integration-tests · ecash-lib-integration-tests
Build 59647: arc lint + arc unit

Event Timeline

This revision is now accepted and ready to land.Aug 22 2024, 12:05