-
Notifications
You must be signed in to change notification settings - Fork 0
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
spec/message-relaying #7
Open
decanus
wants to merge
9
commits into
master
Choose a base branch
from
spec/message-relaying
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
604cb25
created doc
decanus eb9de77
Merge branch 'master' into spec/message-relaying
decanus c3b01a1
added abstract
decanus 312fd3f
temp
decanus 38e6325
done
decanus 1f391f3
section
decanus 5ef4b82
doc
decanus c3d59fb
rfc
decanus a6796f3
versioning
decanus File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
# Message Relaying | ||
|
||
> Version: 0.1.0 (Draft) | ||
> | ||
> Authors: Dean Eigenmann <dean@status.im> | ||
|
||
## Table of Contents | ||
|
||
1. [Abstract](#abstract) | ||
2. [Definitions](#definitions) | ||
3. [Relaying](#relaying) | ||
4. [Footnotes](#footnotes) | ||
|
||
## Abstract | ||
|
||
In this specification, we describe how nodes relay messages. This includes nodes sending initial messages as well as nodes relaying messages they have received from other nodes. | ||
|
||
## Definitions | ||
|
||
| Term | Definition | | ||
| ----------- | --------------------------------------- | | ||
| Origin | The initial sender of any message. | | ||
| Last sender | The last node a message hopped through. | | ||
|
||
|
||
## Relaying | ||
|
||
There are three modes with which a packet can be sent to peers, they both depend on the message along with the nodes state. | ||
|
||
A message MUST either contain a `recipient` address or a target `protocol`. | ||
|
||
<!-- @TODO REFERENCE MESSAGE SPEC THAT WILL DEFINE RECIPIENT AND PROTOCOL --> | ||
|
||
If a message contains a `recipient`, a node MUST initially try and send it to the recipient's address. If a node does not have a direct connection it MAY send it to any number of its peers. | ||
|
||
If a message contains a `protocol`, a node MUST initially try and send it to any peer that supports it. If non of the nodes peers support this protocol, we MAY send it to any number of its peers. | ||
|
||
When sending a message to any peer, a node MUST ensure they are neither the `origin` nor `last sender`. A node SHOULD abstain from flooding a message given it has a more effective manner to route it towards its target. | ||
|
||
## Footnotes | ||
1. <https://github.com/ultralight-beam/UB.swift/pull/42> - A pull request in the swift implementation that implements this sending logic. | ||
|
||
<!-- @TODO THINK ABOUT TRANSMITTING SOME FORM OF ROUTE LIST SO WE NEVER SEND IT TO ANY PRIOR RECIPIENT --> | ||
|
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Grammar