Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Obtain minimumFee from mempool api in place of hardcoded value #5235

Merged
merged 3 commits into from Mar 1, 2021
Merged

Obtain minimumFee from mempool api in place of hardcoded value #5235

merged 3 commits into from Mar 1, 2021

Conversation

ghost
Copy link

@ghost ghost commented Feb 25, 2021

Fixes #5229

example data from mempool api:

{"fastestFee":35,"halfHourFee":28,"hourFee":25,"minimumFee":6}

Bisq pricenode obtains fee info:

Feb-24 22:10:45.291 [Timer-25] INFO  b.p.m.p.MempoolFeeRateProvider$First: Retrieved estimated mining fee of 28 sat/vB and minimumFee of 12 sat/vB from mempool.space 
Feb-24 22:10:45.500 [Timer-25] INFO  b.p.m.p.MempoolFeeRateProvider$Fourth: Retrieved estimated mining fee of 27 sat/vB and minimumFee of 12 sat/vB from mempool.bisq.services 
Feb-24 22:10:46.767 [Timer-25] INFO  b.p.m.p.MempoolFeeRateProvider$Second: Retrieved estimated mining fee of 27 sat/vB and minimumFee of 12 sat/vB from mempool.emzy.de 
Feb-24 22:10:47.307 [Timer-25] INFO  b.p.m.p.MempoolFeeRateProvider$Third: Retrieved estimated mining fee of 27 sat/vB and minimumFee of 12 sat/vB from mempool.ninja 

averaged fee data published by PriceNode:

{
  "bitcoinFeesTs" : 1614226269,
  "dataMap" : {
    "btcTxFee" : 27,
    "btcMinTxFee" : 12
  }
}

Bisq app obtains fee from PriceNode:

INFO  b.core.provider.fee.FeeService: BTC tx fee: txFeePerVbyte=27 minFeePerVbyte=12 

Bisq withdrawal fee rate in settings screen cannot be set below the minFeePerVbyte

image

@wiz
Copy link
Contributor

wiz commented Feb 25, 2021

Beautiful

@ripcurlx
Copy link
Contributor

@jmacxx Tests are broken right now. You need to adapt the Preferences constructor in the tests.

@ghost
Copy link
Author

ghost commented Feb 25, 2021

fixed, thanks @ripcurlx! 👍

Copy link
Contributor

@ghubstan ghubstan left a comment

Choose a reason for hiding this comment

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

I'm done with the review, but hold back on an ACK because I want to know if the old BaseCurrencyNetwork#getDefaultMinFeePerVbyte method can be removed if never to be used again. (I'm chasing these min fee rate changes in the api+tests).

@ghost
Copy link
Author

ghost commented Feb 28, 2021

I'm done with the review, but hold back on an ACK because I want to know if the old

Review issues have been commented on and/or resolved. 👍

@ghost ghost mentioned this pull request Feb 28, 2021
Copy link
Contributor

@ripcurlx ripcurlx left a comment

Choose a reason for hiding this comment

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

ACK - tested it on Regtest. I only get the default value set as long as it is not delivered by https://price.bisq.wiz.biz/ on regtest. Still want to wait for feedback from @wiz on the exact deployment procedure and ops state before this gets merged.

Copy link
Contributor

@wiz wiz left a comment

Choose a reason for hiding this comment

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

ACK - running PR branch on https://price.bisq.wiz.biz/getFees and new minimumFee field correctly matches 2x the minimum fee displayed on mempool.space

@ripcurlx
Copy link
Contributor

ripcurlx commented Mar 1, 2021

Tested it and a couple of edge cases against https://price.bisq.wiz.biz/. Everything seems to behave fine. The only UX drawback is, that we are manipulating the used fee if the new min fee is above the custom set value.

@wiz
Copy link
Contributor

wiz commented Mar 1, 2021

we are manipulating the used fee if the new min fee is above the custom set value.

that's exactly what we want tho, for bisq to create valid transactions that will be accepted to the mempool, and not immediately corrupt the user's wallet heh - maybe later @jmacxx can improve the send page to have better fee display

@ripcurlx
Copy link
Contributor

ripcurlx commented Mar 1, 2021

It is used again as soon as the minimum fee is below the custom fee again. As it prevents the problem of corrupted wallets which we see every now and then I'll create a hotfix branch based on v1.5.7.

@ripcurlx ripcurlx merged commit 0c9d278 into bisq-network:master Mar 1, 2021
@ripcurlx ripcurlx added this to the v1.5.8 milestone Mar 1, 2021
@ghost ghost deleted the mempool_minimumFee branch May 29, 2022 22:49
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.

Bisq does not check mempoolminfee when creating new transactions
3 participants