-
Notifications
You must be signed in to change notification settings - Fork 33
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
[P2P / runtime] chore: p2p connection type #450
Merged
Merged
Changes from 7 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
33aaafd
refactor: move ConnectionType to avoid cyclic import
bryanchriswhite 9addbb0
chore: update makefile
bryanchriswhite 0b792c7
chore: replace `P2PConfig#IsEmptyConnectionType` with `P2PConfig#Conn…
bryanchriswhite 0fa1cd7
chore: replace DefaultIsEmptyConnectionType with DefaultConnectionType
bryanchriswhite 49c177b
fix: use PROTOC_SHARED in makefile
bryanchriswhite 246e670
chore: remove redundant protoc args
bryanchriswhite 8f87f88
Merge branch 'main' into chore/p2p-connection-type
bryanchriswhite 5dfadfd
fix: revert unreleased version numbers & push date
bryanchriswhite 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
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
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
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,10 @@ | ||
syntax = "proto3"; | ||
|
||
package conn; | ||
|
||
option go_package = "github.com/pokt-network/pocket/runtime/configs/types"; | ||
|
||
enum ConnectionType { | ||
EmptyConnection = 0; | ||
TCPConnection = 1; | ||
} |
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
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
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.
I think consolidating this with
runtime/configs/proto/p2p_config.proto
would be cleaner. Wdyt?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 agree that it would be simpler for
P2PConfig
andConnectionTypes
to be in the same package (as it was before my changes). There's a slight hangup though in theruntime/defaults
package. When replacingdefaults.DefaultP2PIsEmptyConnectionType
withdefaults.DefaultP2PConnectionType
we need to import theConnectionType
enum, which causes a cyclic import (asconfigs/config.go
is currently consumingdefaults
). I'm not sure there's much that can be done in the way of consolidation so long asconfigs
is importingdefaults
andconfig.go
shares a package with theConnectionType
generated proto code. We could, of course, move more of theruntime/configs
package into the new one (e.g.P2PConfig
). The most aggressive version of this would result in separating the all the generated protobuf into the new package. While I think, in principal, this is probably the right direction to go, it would require many more changes to account for imports of other configs proto types.Another alternative would be to consider moving (at least) the
ConnectionType
enum to the shared protobuf files (e.g.shared/types/proto
) as this would necessarily change its package but makes less sense in my opinion as I don't think it's a fair to characterize this enum as "shared" based on current usage.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'm also very open to suggestions on better names for both the go and proto package (
types
andconn
, respectively, as of 33aaafd).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.
Appreciate the explanation @bryanchriswhite. I understand the point around consolidation and would say that lets just keep it as you have it.
The primary goal of this issue of using enums has been achieved relatively cleanly, and we'll have a lot more opportunities to clean up the code in the future.
The name lgtm!