-
Notifications
You must be signed in to change notification settings - Fork 76
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
Add ping version 2 description. #526
Conversation
sync/p2p_messages.md
Outdated
### Version 2 | ||
|
||
- `Versions :: list` | ||
- `Protocol :: binary` - type of message. |
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.
Could you please elaborate a bit more on this field? It's name is protocol, it's description is "type of message".
In general I'd like to see somewhere documented how this "Versions" field should work and what is used for.
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.
At the moment, the only protocol is ping. It specifies the node supports v1 and v2 pings. It will be used to decide which version of a message should be used. I'll add an explanation.
- `Difficulty :: int` - the total difficulty of the chain. | ||
- `TopHash :: byte_array` | ||
- `sync_allowed :: bool` - if the sender of this ping message is accepting | ||
- `SyncAllowed :: bool` - if the sender of this ping message is accepting |
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.
Since we have a capability field now, isn't it appropriate to move this there? Sounds like a capability to me.
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.
It could be, the current example capability is more complicated though, it is for a sync capability "chain_poi", which is:
{height, int}
{root_hash, binary}
{genesis, binary}
{top, binary}
{poi, binary}
A downside would be that it increases the size of the ping.
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.
Okay, maybe a misunderstand "capabilities"
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.
I don't think we are sure that is how capabilities should be used, let's see when we actually find a use-case for them. My idea was that the capabilities should signal what additional messages that the node will understand and react to 🤔
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.
Ulf wanted to use it for additional methods of sync. aeternity/aeternity#4189
- `GenesisHash :: byte_array` | ||
- `Height :: int` - current height. |
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.
Isn't height kind of "per database" (node) field? Why is it shared? If you know the remote TopHash isn't it possible to derive its height as well?
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.
I asked Ulf and this is his response, "It's true that the height can be derived, but only by first downloading headers. While working on fast synch strategies, I felt that getting the height up front was a convenience at fairly low cost."
- `Difficulty :: int` - the total difficulty of the chain. | ||
- `TopHash :: byte_array` | ||
- `sync_allowed :: bool` - if the sender of this ping message is accepting | ||
- `SyncAllowed :: bool` - if the sender of this ping message is accepting |
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.
I don't think we are sure that is how capabilities should be used, let's see when we actually find a use-case for them. My idea was that the capabilities should signal what additional messages that the node will understand and react to 🤔
This PR is supported by Æternity Foundation and Æternity Crypto Foundation