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
bcoin thinks loader peer is stalling when fully synced #129
Comments
The bitcoind behavior here: // Send the rest of the chain
if (pindex)
pindex = chainActive.Next(pindex);
int nLimit = 500;
LogPrint("net", "getblocks %d to %s limit %d from peer=%d\n", (pindex ? pindex->nHeight : -1), hashStop.IsNull() ? "end" : hashStop.ToString(), nLimit, pfrom->id); This log is appearing because you're fully synced, and the first hash in the locator is the tip. Bitcoind doesn't have the next block. As for the stall behavior, if you just booted and someone hasn't mined a block for a while on testnet (i.e. your tip is older than maxTipAge), bcoin will invoke sync stall behavior. This never mistakenly happens on main due to the frequency of blocks. I'm not sure what happened here since maxTipAge on testnet is 24h. I'll have to look into it more. |
Ah I see, then its the stall that's erroneous. FWIW here's the corresponding log on the bcoin side:
This also causes bcoin to never enter the |
@mcelrath, you mentioned in IRC that you added an artificial genesis block. Your synced chain is probably below the minimum chainwork, causing maybeSync to fail. You need to also artificially set the chainwork for your genesis block I think. |
I have set the chainwork correctly on the genesis block... |
Still having this problem, and it doesn't seem to be caused by requesting blocks since the most recent chaintip. This morning it synced and downloaded 39 block headers, but Continuing to investigate...
|
Indeed this was caused by chainwork. I've hacked in a custom genesis block (a "network" in
Second for
This is pretty hacky, and requires extracting lots of data from bitcoin to define the custom network. If you want to support truncating the block headers in SPV mode, there's certainly a more general way to it. Closing this one... |
During startup, bcoin (sometimes) seems to be generating an incorrect locator for the
getblocks
message. Running bitcoind with-debug=net
the log looks like:The -1 on the last line seems to be the problem, and bitcoind doesn't respond to the getblocks request, which causes bcoin to timeout ("Peer is stalling") and disconnect a few seconds later.
This does not happen 100% of the time...what would cause bcoin to send an invalid blockhash to getblocks?
The text was updated successfully, but these errors were encountered: