Skip to content

Use bitcoin core to fetch blocks #2039

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

Merged
merged 1 commit into from
Jul 8, 2022

Conversation

nymkappa
Copy link
Member

@nymkappa nymkappa commented Jul 8, 2022

This PR replaces querying blocks through esplora vs bitcoin core when it is requested by users from the frontend.

In very rare occasion, it was possible for the user to query a block right before we index it. Since we were using esplora, the block was indexed on the fly in the db using an rounded difficulty (esplora bug). This created a follow up bug on the difficulty adjustments table.

Testing

  • Deploy the PR, explore some blocks (some new, and some old to make sure they're not in memory cache). Confirm everything still works fine
  • Delete 100 most recent blocks
delete from blocks order by height desc limit 100;
  • Explore a block you've just deleted, confirm everything works fine
  • Open the block list page /blocks, confirm everything works fine, browse 6~7 pages
  • Check if blocks are properly re-indexed on the fly
select * from blocks order by height desc limit 100;
  • Clear your disk cache and test with config.DATABASE.ENABLED: false and MINING_DASHBOARD: false (can still browse blocks, and see the blocks list)

Note: Bisq and liquid are not be impacted because it uses a different code branch (the legacy /blocks backend code)

@nymkappa nymkappa requested a review from wiz July 8, 2022 13:34
@cla-bot cla-bot bot added the cla-signed label Jul 8, 2022
@nymkappa nymkappa changed the title Nymkappa/bugfix/use core for block list Use bitcoin core to fetch blocks Jul 8, 2022
@nymkappa nymkappa marked this pull request as draft July 8, 2022 13:40
Copy link
Member

@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.

Tested NACK @ v2.4.1-dev [8c995356]

When browsing a yet-unindexed block, I get the following error
Screen Shot 2022-07-08 at 15 49 32

@nymkappa nymkappa force-pushed the nymkappa/bugfix/use-core-for-block-list branch from 8c99535 to 9b2cef6 Compare July 8, 2022 13:54
@nymkappa nymkappa marked this pull request as ready for review July 8, 2022 13:55
@nymkappa nymkappa force-pushed the nymkappa/bugfix/use-core-for-block-list branch from 4cc86d8 to 97ff1e3 Compare July 8, 2022 14:34
Copy link
Member

@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.

Tested ACK @ v2.4.1-dev [e1fe6078]

Copy link
Member

@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.

Tested ACK @ v2.4.1-dev [e1fe6078]

@wiz wiz merged commit 69623d7 into master Jul 8, 2022
@wiz wiz deleted the nymkappa/bugfix/use-core-for-block-list branch July 8, 2022 14:50
nymkappa added a commit that referenced this pull request Jul 11, 2022
wiz added a commit that referenced this pull request Jul 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy