Skip to content
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

use protobuf while communicate between peers #30

Merged
merged 8 commits into from
Apr 18, 2024
Merged

use protobuf while communicate between peers #30

merged 8 commits into from
Apr 18, 2024

Conversation

Giwook-Han
Copy link
Contributor

No description provided.

@Giwook-Han Giwook-Han linked an issue Apr 15, 2024 that may be closed by this pull request
Comment on lines 228 to 229
p2p.errCh <- err
continue
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For this case the error should be logged and that's it I think. errCh is used to send an error that terminates the app, so if there will be an error in parsing data it will result into the whole gram node to shutdown

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Gotcha! Also, I've noticed that some fmt.Printf statements lack the \n newline character. Adding it would be nice for readability. wdyt?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fmt.Printf is being replaced with the logging

Copy link
Contributor

@t-botclive t-botclive left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All LGTM, except that one thing with channel

@@ -211,6 +223,12 @@ func (p2p *P2P) p2pMessageHandler(subscription *pubsub.Subscription) {
continue
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just curious, was L221~L224 in affect? I wonder if we still need these after the last refactoring.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When a node publishes a message, it has already subscribed to the relevant topic. That's why this code needed. no?

@t-botclive t-botclive merged commit efc60f2 into topology-foundation:develop Apr 18, 2024
1 check passed
@Giwook-Han Giwook-Han deleted the protobuf-communication branch April 19, 2024 02:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Use Protocol Buffers for peer-to-peer communication
4 participants