-
Notifications
You must be signed in to change notification settings - Fork 66
test(gossipsub): behavior unit tests 1 #1501
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
Conversation
|
|
||
| # Then IWant is ignored | ||
| check: | ||
| messages.len == 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
question: why does this mean that iwant was ignored and not handled? I assume that after iwant is handled the messages queue would be empty again, no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
handleIWant processes IWANT requests from peers and returns the actual messages they're asking for. It takes a list of message IDs and returns a sequence of Message objects.
The function only adds messages to the result if both conditions are met:
We previously sent an IHAVE for that message ID to the peer and the message still exists in the cache.
In this test: sentIHaves doesn't contain the message id and therefore the message is not returned.
Changes:
GossipSubbehaviour:"handleIHave - do not handle IHave when message already in cache""handleIWant - message not handled without sent IHave""handleIWant - message not handled when not in cache""handleIWant - stops processing after 21 invalid requests""handlePrune - peer is pruned and backoff is set""handleGraft - peer joins mesh for subscribed topic""handleGraft - do not graft if peer already in mesh""handleGraft - reject peer when mesh at dHigh threshold""handleGraft - accept outbound peer when mesh at dHigh but below dOut threshold""handleGraft - reject outbound peer when mesh at dHigh and dOut threshold met"