Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: validate content before ending query
There are quite a few moving parts here, so the goal was to minimize the number of functional changes in this refactor. Overall: add a new query state for while the content is being validated. Don't exit the query until validation is complete. Some other changes along the way: * Moving the bigendian conversion of connection ID Note that when handling the FindContentQueryResponse::ConnectionId in findcontent.rs, we don't do the bigendian conversion anymore. That has been moved to earlier in the process, when handling the Content message, to reduce the number of places that the conversion needs to be handled. * The query trace has slightly different end-stage behavior The received_from peer and the cancelled peers are not set in the query until the content gets validated. * Naturally, tests need to reflect the new query structure For example: - the query trace test needs to have the content be marked validated to progress - update overlay service tests to use new Validating query step - immediately mark content as verified, after marking it as received, during the test * bugfix: the content search continues even if many peers don't have it Formerly, the content query would exit out if too many peers replied successfully (even if the responses were just more nodes to look up). Best we can tell, the limit on the number of maximum results is copy-pasta from the recursive-find-nodes logic. (Confirmation from Mike) Now, the query continues until the content is found. It doesn't track the number of successful responses at all.
- Loading branch information