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
Failing to fetch cfheader
corresponding to block header in headers
message
#27085
Comments
Even when the peer sent the |
Thanks for pointing me in the right direction, this seems to be the equivalent in the bitcoin core python test harness #22311 . I'll patch with this on bitcoin-s and close this issue after i've verifed this is the appropriate fix. |
This still seems to be an issue on 24.2 . I'm going to try and upgrade my nodes used for test harnesses in to use 25.x and 26.x. From a quick look through release notes, it doesn't seem like there was anything in those releases that would fix this bug. Note, i am calling
EDIT: i've attached the full log |
At least one of the following must happen, otherwise this bug will remain, obviously:
|
Massive apologies, that was a typo. I am calling |
Are you sure, because the debug log you shared does not mention it? |
I've modified the post to add those logs and i've attached the full |
Ok, it is called, but you also have to wait for it to complete and return from the RPC, before continuing the test. Currently it looks like it is called, and processes the block events, but at the same time the P2P interface is asked for the filters. It may be best to only use a single thread for the test logic. |
Hmm, you are totally right. You said elsewhere in this thread
This is exactly what is happening and the race condition i'm running into.
I don't see why I guess the question now is why are we gossiping headers before its possible to serve filterheaders / filters that correspond with them if |
There was a previous discussion (I can't find it now), but I think it said that the P2P interface may fail, because it reaches to untrusted peers, so a logic to recover is needed either way. If you want to use a trusted interface, use RPC. Though, there is also P2P encryption and peer permission flags, so my preference would be to sync before replying to compact filter requests on the P2P interface. |
Do you recall the venue of where it was discussed? Some PR/issue on github or elsewhere? I may go digging. In general, should I leave this issue open? It seems like this will not be resolved in the short term (or ever maybe). |
It was on GitHub (https://github.com/bitcoin/bitcoin) |
…ously querying for children rather than the block hashes at the given height for building the FilterSyncMarker for getcfilter request. Also introduce delay in sending getcfheader because of bitcoin/bitcoin#27085
* Fix bug in getFilterSyncMarkerFromStopBlockHeader where we were previously querying for children rather than the block hashes at the given height for building the FilterSyncMarker for getcfilter request. Also introduce delay in sending getcfheader because of bitcoin/bitcoin#27085 * Only fallback to reorg scenario if we find no headers at height + 1 * Remove the best filter's block header from the candidate headers in reorg scenarios
Occasionally when I receive a
headers
message on the p2p network, and attempt to fetch thecfheader
that corresponds to a block header inside of aheaders
, i get this error message inside of mydebug.log
Expected behavior
I should be able to fetch a
cfheader
for a block after the block has been relayed to me over the p2p network viaheaders
p2p message.Actual behavior
It fails to fetch the
cfheader
that corresponds to the block.To reproduce
I am unable to reproduce reliably, but this does occur ~1/5 times when running test suites on bitcoin-s.
System information
24.0 (although i have seen this behavior for awhile and believe this issue exists in older versions of
bitcoind
)The OS/CPU arch does not seem to be a factor in this bug. I can reproduce on Linux/mac machines with older/newer versions of bitcoind
I've attached the
debug.log
for mybitcoind
instance. The block hash in question is3ca9030aeb6c2721cfbab0116b8d96e2d3c7e00738238010e0bc622566dc2aed
.debug.log
This is related to: bitcoin-s/bitcoin-s#4976
The text was updated successfully, but these errors were encountered: