-
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
Conversation
6d12436
to
787606c
Compare
787606c
to
0fa1cd7
Compare
Makefile
Outdated
@@ -244,7 +244,8 @@ protogen_local: go_protoc-go-inject-tag ## Generate go structures for all of the | |||
$(PROTOC) -I=./shared/codec/proto --go_out=./shared/codec ./shared/codec/proto/*.proto | |||
|
|||
# Runtime | |||
$(PROTOC_SHARED) -I=./runtime/configs/proto --go_out=./runtime/configs ./runtime/configs/proto/*.proto | |||
protoc --go_opt=paths=source_relative -I=./runtime/configs/types/proto --go_out=./runtime/configs/types ./runtime/configs/types/proto/*.proto --experimental_allow_proto3_optional |
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 we use the PROTOC_SHARED
helper here?
@@ -0,0 +1,10 @@ | |||
syntax = "proto3"; |
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
and ConnectionTypes
to be in the same package (as it was before my changes). There's a slight hangup though in the runtime/defaults
package. When replacing defaults.DefaultP2PIsEmptyConnectionType
with defaults.DefaultP2PConnectionType
we need to import the ConnectionType
enum, which causes a cyclic import (as configs/config.go
is currently consuming defaults
). I'm not sure there's much that can be done in the way of consolidation so long as configs
is importing defaults
and config.go
shares a package with the ConnectionType
generated proto code. We could, of course, move more of the runtime/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
and conn
, 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!
@bryanchriswhite Friendly reminder :) |
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.
One more minor change request. See the definition of PROTOC
as to why I'm suggesting it.
The only reason I'm not approving yet is that I saw you didn't check the LocalNet
checkbox of the testing section. Until we have automated E2E tests, can you confirm that works?
@@ -0,0 +1,10 @@ | |||
syntax = "proto3"; |
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!
Thanks for elaborating, I was not paying close enough attention and missed the detail there. 😅
No worries, regarding localnet: I made an attempt to follow the localnet instructions but lost the thread around steps 4/5:
I'm not sure what "working" looks like yet (expected behavior), is any other documentation that elaborates on this? |
Co-authored-by: Daniel Olshansky <[email protected]>
Discussed offline but covering here. The gif in https://github.com/pokt-network/pocket/blob/main/docs/development/README.md is a bit outdated but that's the closest "source of truth" we have for working at the moment. Simply making sure that the height increases from the logs. We'll automate the test and improve the docs over time, but a manual sanity check of that for now should suffice. |
@Olshansk after actually taking a second to read a bit of the makefile and get more familiar with the docker-compose file, I gave it another go and things seems to be making more sense, and indeed working. 😄 I think maybe what I was seeing before was related to timeouts but having no awareness of them (I'm blaming sensory overload 😅). |
ab37ad5
to
8f87f88
Compare
FYI: that last force-push was me changing my mind about how I think it makes sense to handle merge conflict resolutions in changelogs genrally. In this case the upstream change had a newer date, but the same unreleased version number. For anyone who isn't aware, the words "force-pushed" in the comment GH entry is a link to the diff between the mentioned commits: I've collected my thoughts on the matter and opened #461. |
Co-authored-by: Daniel Olshansky <[email protected]>
@bryanchriswhite Make sure to |
Description
Replaces boolean
IsEmptyConnectionType
with enumConnectionType
inP2PConfig
to enable future support for additional connection types.Issue
Fixes #268
Type of change
Please mark the relevant option(s):
List of changes
ConnectionType
enum into its own package to avoid a cyclic import betweenconfigs
anddefaults
packages (i.e.configs -> defaults -> configs
) in the resulting, generated go packageprotogen_local
target to build additional proto file and include it in the import path forruntime/configs/proto/p2p_config.proto
P2PConfig#IsEmptyConnectionType
withP2PConfig#ConnectionType
DefaultP2PIsEmptyConnectionType
withDefaultP2PConnectionType
Testing
make develop_test
README
Required Checklist
If Applicable Checklist
shared/docs/*
if I updatedshared/*
README(s)