Gossip should not respond to GRAFT with GRAFT
Open
Nobody has claimed this yet.
- Dominant language
- Kotlin
- Stars
- 366
- Forks
- 85
- Avg merge
- 2d 39m
- Merged PRs (30d)
- 6
Description
As per chat with @vyzo we should not response with GRAFT when adding a peer to our mesh per its GRAFT request.
Probably should add some explicit note on that in the Gossip spec
Anton Nashatyrev, [03.12.20 13:49]
Sorry for off-topic, but would like to hear vyzo opinion on the question discussed in the neighbor channel.
If Peer1 sends initial GRAFT to Peer2, should the Peer2 respond with GRAFT if it added Peer1 to its mesh?
Though I didn't fine any explicit statement on this in the spec, I think the Peer2 SHOULD respond with GRAFT in this case. Else the Peer1 would not be informed that it was added to the mesh of Peer2
As the spec states:
The GRAFT informs a peer that it has been added to the local router's mesh view for the included topic id.
vyzo, [03.12.20 13:53]
yeah no need to respond with graft
vyzo, [03.12.20 13:53]
it would be racey
Anton Nashatyrev, [03.12.20 13:58]
[In reply to vyzo]
Thanks for clarification!
Is there any spec place which can help to clarify this?
vyzo, [03.12.20 13:59]
sure feel free to open pr!
Anton Nashatyrev, [03.12.20 14:06]
[In reply to vyzo]
Just make it clear:
- MAY NOT respond with graft
or
- SHOULD NOT respond with graft
vyzo, [03.12.20 14:30]
SHOULD NOT
vyzo, [03.12.20 14:30]
if two peers graft each other concurrently they may both send graft
vyzo, [03.12.20 14:30]
and thats ok
Anton Nashatyrev, [03.12.20 14:33]
[In reply to vyzo]
Yep, though in this case you anyway would not send the second GRAFT. When you receive GRAFT the other peer would already be in your mesh and you have nothing to do
vyzo, [03.12.20 14:35]
right
Anton Nashatyrev, [03.12.20 14:42]
[In reply to vyzo]
I have actually mean the situation when you are sending GRAFT 'in response' to initial GRAFT. (that's actually not a response, but just an opposite notification).
Anton Nashatyrev, [03.12.20 14:43]
It still seems to me that sending the back GRAFT is more consistent behavior
vyzo, [03.12.20 15:20]
its not needed though
vyzo, [03.12.20 15:21]
and it would get in funny races with an immediate graft/ prune
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the GRAFT section of the linked GossipSub v1.0 specification and review its existing wording about mesh membership notifications. Update the specification to state that a peer SHOULD NOT send GRAFT in response to receiving GRAFT, while preserving the note about concurrent grafts, and confirm the wording is explicit.
Written by the indexing model from the issue text.
Assessment
- Domain
- documentation, networking
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 55/100