8000 Fix hashrate indexing, log difficulty adjustment progress by nymkappa · Pull Request #2033 · mempool/mempool · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Fix hashrate indexing, log difficulty adjustment progress #2033

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 4 commits into from
Jul 10, 2022

Conversation

nymkappa
Copy link
Member
@nymkappa nymkappa commented Jul 8, 2022
  • Removed hardcoded genesis timestamps for hasharate indexing
  • Fix duplicated genesis hashrate attempt (forgot to divide a timestamp by 1000 before checking if it was already indexed), leading to the following error Jul 8 09:24:53 node201.fmt mempool[82115]: ERR <testnet> Indexer failed, trying again in 10 seconds. Reason: Duplicate entry '2009-01-03 18:15:05-0' for key 'hashrate_timestamp_pool_id'
  • Add log during difficulty adjustment indexing, it takes quite a while for testnet so it deserves basic progress log

Testing

  • Nuke the db and re-index everything from scratch (db schema v2) to make sure the full indexing cycle is working properly
  • Check hashrate & difficulty charts, weekly mining pool chart and any block related chart, look for the first entry in the All timespan to see if it ~matches the network genesis time

@nymkappa nymkappa requested a review from wiz July 8, 2022 09:27
@cla-bot cla-bot bot added the cla-signed label Jul 8, 2022
@nymkappa nymkappa changed the title Removed hardcoded genesis timestamp Fix hashrate indexing, log difficulty adjustment progress Jul 8, 2022
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.

NACK - did a full index and got same errors

Jul  8 17:55:40 node201.fra  mempool[81525]: ERR <testnet> Cannot save indexed hashrate into db. Reason: Duplicate entry '2009-01-03 18:15:05-0' for key 'hashrate_timestamp_pool_id'

@nymkappa
Copy link
Member Author
nymkappa commented Jul 9, 2022

NACK - did a full index and got same errors

Jul  8 17:55:40 node201.fra  mempool[81525]: ERR <testnet> Cannot save indexed hashrate into db. Reason: Duplicate entry '2009-01-03 18:15:05-0' for key 'hashrate_timestamp_pool_id'

The bug was because I was using AVG() when selecting existing indexed hashrates timestamp.
The indexer was then thinking that some timestamp where missing in the index therefore attempting to insert them into the db. Which lead to the error seen.
I'm now using the raw db timestamps instead of AVG() during the indexing.

@nymkappa nymkappa marked this pull request as draft July 9, 2022 08:53
@nymkappa nymkappa requested a review from wiz July 9, 2022 10:10
@nymkappa nymkappa marked this pull request as ready for review July 9, 2022 10:10
@nymkappa nymkappa force-pushed the nymkappa/bugfix/cleanup-hashrate-indexing branch from 6e850ee to 6a022e3 Compare July 9, 2022 10:11
@wiz wiz added this to the v2.4.1 milestone Jul 9, 2022
@nymkappa nymkappa force-pushed the nymkappa/bugfix/cleanup-hashrate-indexing branch from c8d1e97 to 07cb4a4 Compare July 9, 2022 20: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 [07cb4a49]

Seems to be working well, and the mining dashboard is now usable while the bitfeed visualization is indexing silently in the background. All of Bitcoin mainnet took about 6 hours on our server.

@wiz wiz merged commit 4fa4088 into master Jul 10, 2022
@wiz wiz deleted the nymkappa/bugfix/cleanup-hashrate-indexing branch July 10, 2022 10:06
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
0