This repository has been archived by the owner on Nov 15, 2023. It is now read-only.
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.
Move block announcement protocol config out of
Protocol
#12441Move block announcement protocol config out of
Protocol
#12441Changes from 4 commits
bf10f6f
73b5e07
8a29561
a59781b
e1a2d7d
9bfb4a7
ba9bf24
b8998cd
9e8463c
d311a71
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
For what it's worth I'm really not sure about this field. Looking at the code, None means "default", which means "the node's role".
Intuitively, to me, when I see a field named
handshake
which can take anOption
, I assume thatNone
means something like "no handshake".It is also worth mentioning that while the handshake being sent is now customizable, the handshake decoding code is still hardcoded by protocol. This is the reason why the handshake was so far not customizable. For this reason, maybe a better API could have been an enum
Handshake { BlockAnnounces { ... }, Transactions, NodeRole }
.At the very least, this field should IMO be very well documented, just like all the other fields of the config are well documented.
"Handshake of the protocol"
is not a useful information, you can guess that by the field name. If not better documented, I'm 99% sure that this field will get misused at some point in the future.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.
This PR was not about addressing the customizable handshakes and the implementation for
NotificationHandshake
as right now stands is not the final version of it. I have been looking into how to make it totally generic but I don't have anything concrete to show yet. I plan to work on that when the block announcement protocol is converted to a generic notification protocol and the syncing code for the most part is out ofProtocol
but there is still some stuff I need to do before I can start working on that. This PR was about getting the block announcement protocol out ofProtocol
so thatChainSync
can be the owner of that protocol.But yes, it's not perfect a solution and I don't mind changing the type temporarily to an enum though, if it makes things more clear.