atomicDEX-API icon indicating copy to clipboard operation
atomicDEX-API copied to clipboard

fix(UTXO): calc of txfee with change, min relay fee

Open dimxy opened this issue 1 year ago • 7 comments

Fixes for utxo tx fee calculation in UtxoTxBuilder::build() fn:

  • include change output in txfee
  • fix min relay tx fee calc (to multiply by tx_size).

UtxoTxBuilder::build() code was refactored to implement fixed txfee calc: made it similar to daemon code (with a loop), also broke it into functions. Existing tests updated for the fixed txfee.

Fixes issue: https://github.com/KomodoPlatform/komodo-defi-framework/issues/2313 (a test added to validate txfee from the issue). Should also fix https://github.com/KomodoPlatform/komodo-defi-framework/issues/1567 issue.

TODO: fix input size for segwit

@cipig

dimxy avatar Jan 09 '25 14:01 dimxy

Is this ready for review?

mariocynicys avatar Jan 09 '25 17:01 mariocynicys

Is this ready for review?

I am doing final checks and will change the status for ready after that

dimxy avatar Jan 09 '25 17:01 dimxy

Thank you for this PR. Covers most of what I was working on here #2083.

I will close mine when this is approved.

borngraced avatar Jan 10 '25 01:01 borngraced

Thank you for this PR. Covers most of what I was working on here #2083.

I will close mine when this is approved.

I thought #2083 was about fee priority (although this PR and #2083 definitely have some interception in txfee calc fixes)

dimxy avatar Jan 10 '25 09:01 dimxy

Does this PR require and docs updates? I've created a docs PR at https://github.com/KomodoPlatform/komodo-docs-mdx/pull/416 for the related KF PR https://github.com/KomodoPlatform/komodo-defi-framework/pull/2083 please advise in the docs PR if anything else is needed.

smk762 avatar Feb 10 '25 07:02 smk762

@dimxy pr started to have conflicts

laruh avatar Feb 21 '25 13:02 laruh

Does this PR require and docs updates? I've created a docs PR at KomodoPlatform/komodo-docs-mdx#416 for the related KF PR #2083 please advise in the docs PR if anything else is needed.

I don't thing so. It's a bug fix for tx fee calculation. No changes in any rpcs introduced.

dimxy avatar Feb 24 '25 18:02 dimxy

Need this https://github.com/KomodoPlatform/komodo-defi-framework/pull/2316/commits/eab8902d28607bbe9e8d706ee4a854f92e7ec954 to be checked before I can merge this @dimxy

shamardy avatar May 06 '25 03:05 shamardy

Need this eab8902 to be checked before I can merge this @dimxy

looks good

dimxy avatar May 06 '25 07:05 dimxy