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

Switch to more accurate fee estimation endpoint #4235

Merged
merged 2 commits into from
May 5, 2020

Conversation

cd2357
Copy link
Contributor

@cd2357 cd2357 commented May 5, 2020

The API endpoint for fee estimations has been changed to one that delivers more accurate fee estimations.

This is a temporary solution, until a more decentralized approach is found.

Fixes projects/issues/27

@cd2357 cd2357 requested a review from cbeams as a code owner May 5, 2020 15:02
@cbeams
Copy link
Contributor

cbeams commented May 5, 2020

You beat me to it @cd2357; excellent :)

Reviewing now, thanks.

The API endpoint for fee estimations has been changed to one that delivers more accurate fee estimations.

This is a temporary solution, until a more decentralized approach is found.

Fixes projects/issues/27
@cd2357 cd2357 force-pushed the improve-fee-estimation branch from e794691 to e18f040 Compare May 5, 2020 15:12
@cbeams
Copy link
Contributor

cbeams commented May 5, 2020

I am in the middle of this review, but cannot finish right now. From what I've seen so far, everything looks in order. There are a few small tweaks I'm making, but nothing fundamental. @bisq-network/pricenode-operators, could one or more of you build from this PR and take it for a spin on your side?

Kudos, @cd2357 for the quick fix, and seriously great that you implemented the test ;)

@wiz
Copy link
Contributor

wiz commented May 5, 2020

Thanks for implementing this. Can you make it configurable with an environment variable or command line option, and leave the default as mempool.space? This way pricenode operators can optionally set it to their own mempool backend if they have one

 - Polish whitespace and newlines; wrap comments at 90 chars

 - Use package-private vs protected visibility when exposing
   BitcoinFeeRateProvider constants for testing

 - Document that 'maxBlocks' is dead code, but do not remove it yet, as
   it would disrupt the process of getting this fix out quickly because
   it would require operators to change the way they start their
   pricenodes.
@cbeams
Copy link
Contributor

cbeams commented May 5, 2020

Can you make it configurable with an environment variable or command line option, and leave the default as mempool.space

Let's do that in a second PR. I have another change that I'd like to see if @cd2357 wants to make as part of my review.

Let's get this out as is and asap. My review is incoming in one minute.

@wiz
Copy link
Contributor

wiz commented May 5, 2020

Actually, I think pricenode code allows for multiple data providers, can you also add https://mempool.emzy.de/ as a second provider and poll from both of them?

@wiz
Copy link
Contributor

wiz commented May 5, 2020

Let's do that in a second PR

Okay :)

Copy link
Contributor

@cbeams cbeams left a comment

Choose a reason for hiding this comment

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

ACK. @cd2357, please see the review commit that I just pushed.

Note that there is an opportunity here for one or more follow-on PRs as well.

The first is to eliminate the maxBlocks field from BitcoinFeeRateProvider. You'll see my comments to this effect. Rolling this out means changing the startup scripts and communicating effectively about the change to @bisq-network/pricenode-operators. It would be great if you want to do this, @cd2357.

The second is implementing the configurability that @wiz mentioned in the comments on this PR. We could discuss the best way to do that. It would also be good to deliberate a little further on the implications of querying multiple backends first, though. We've never been in a situation where we could expect to get very divergent results for fee rate estimations, because we've always all been calling the same (earn.com) endpoint. We shouldn't be too hasty on making that switch, which is part of the reason I want to ship this fix as is, nice and minimal.

Really great work here, @cd2357. Thanks!

@wiz, when we merge this, will you drive the @bisq-network/pricenode-operators upgrading?

@wiz
Copy link
Contributor

wiz commented May 5, 2020

Well if we merge this as-is and made all pricenode operators upgrade, we would make all of Bisq depend on my single node for mempool fees... can you add emzy's node in as a secondary source so they both get polled? I believe the code already supports this, right?

@Emzy
Copy link
Contributor

Emzy commented May 5, 2020

FYI my bitcoinaverage subscription will run out 06/06

@sqrrm
Copy link
Member

sqrrm commented May 5, 2020

@wiz @cbeams Do you consider this merge ready or do you want to add emzy's node for slightly less centralization first?

@wiz
Copy link
Contributor

wiz commented May 5, 2020

@Emzy don't worry, we can allocate additional budget if necessary, this mempool thing is high priority

@sqrrm chris is right, this is kinda urgent, let's merge this PR for now and add emzy in a separate PR later

@cbeams
Copy link
Contributor

cbeams commented May 5, 2020 via email

@sqrrm sqrrm merged commit b1f593a into bisq-network:master May 5, 2020
@cbeams
Copy link
Contributor

cbeams commented May 6, 2020

@cd2357, a couple notes on commit e18f040:

@cd2357
Copy link
Contributor Author

cd2357 commented May 6, 2020

Really great work here, @cd2357. Thanks!

Thanks, glad I could help :)

Note that there is an opportunity here for one or more follow-on PRs as well.

The first is to eliminate the maxBlocks field from BitcoinFeeRateProvider. You'll see my comments to this effect. Rolling this out means changing the startup scripts and communicating effectively about the change to @bisq-network/pricenode-operators. It would be great if you want to do this, @cd2357.

If I understood that correctly, this PR should cover it: #4240. I assume there are startup or service scripts which are not committed, which the operators have on their systems. If so, that's one thing they'll have to manually adjust (already described that in the PR comment for their reference).

As to communicating it them, I'm not sure who whey are so I can tag them, nor can I use the @bisq-network/pricenode-operators tag you used @cbeams (it doesn't resolve for me, it just stays as text). So I'd leave the comm part to someone else, perhaps @wiz ?

The second is implementing the configurability that @wiz mentioned in the comments on this PR.

Already started with that, a PR is coming soon.

@cd2357
Copy link
Contributor Author

cd2357 commented May 6, 2020

@cd2357, a couple notes on commit e18f040 (...)

Cool, thanks for the hints. Wasn't aware GitHub can do all that, good to know.

@ripcurlx ripcurlx added this to the v1.3.5 milestone Jun 4, 2020
@cd2357 cd2357 deleted the improve-fee-estimation branch August 20, 2020 09:53
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.

6 participants