Local blockstack node shows incorrect subdomain count


#1

Hi,

I just ran a Blockstack node and the api on my machine. Logs seem to be ok, there are no errors.

However, the subdomains count returned by the local node is different from the one returned by the node on core.blockstack.org.

http://localhost:6270/v1/blockchains/bitcoin/subdomains_count
{
    "names_count": 65863
}

https://core.blockstack.org/v1/blockchains/bitcoin/subdomains_count
{
    "names_count": 65881
}

I fast synced my node yesterday. My machine was off overnight and I turned it back on the next day (today). It’s been on now for around 2 hours.

Here’s the log file:

How can I check or make sure my node is functioning properly and getting the latest data from other nodes?

EDIT: it seems that when time progresses both subdomain counts are increasing, but the one from the local node is always behind by around 10.


#2

Hey @jonason,

I think you may have come across this: https://github.com/blockstack/blockstack-core/pull/844 (please see the last comment). There’s a race condition in the code that can very rarely but with non-zero probability cause a zone file to get ignored by the subdomain system. I’m spinning up a node from genesis to verify that the above fix corrects the issue. In the mean time, if you do the following, you can rectify the issue on your node:

  1. stop your node
  2. move your ~/.blockstack-server/subdomains.db file out of the way
  3. move your ~/.blockstack-server/backups/subdomains* files out of the way
  4. restart your node

This should force your node to regenerate all of its subdomain state, and do so without triggering the race condition.


#3

@jude thanks for the reply!

I removed subdomains and their backups and now I have an opposite situation.
core.blockstack.org has less subdomains than my local node.

http://localhost:6270/v1/blockchains/bitcoin/subdomains_count
{
"names_count": 65983
}

https://core.blockstack.org/v1/blockchains/bitcoin/subdomains_count
{
"names_count": 65962
}

#4

The same issue probably affects core.blockstack.org as well.