-
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] refactor: unicast router #844
Merged
Merged
Changes from 1 commit
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
fe24824
refactor: unicast router
bryanchriswhite 1277859
chore: cleanup TODOs
bryanchriswhite 4b19d8f
Merge remote-tracking branch 'pokt/main' into refactor/unicast-router
bryanchriswhite 048e306
fix: gofmt
bryanchriswhite d7278b8
Merge remote-tracking branch 'pokt/main' into refactor/unicast-router
bryanchriswhite 9ab2a5d
chore: fix typo in comment
bryanchriswhite dce1bac
chore: add debug log
bryanchriswhite 8dc2852
chore: fix field comment out of place
bryanchriswhite a6d4b52
fix: imports
bryanchriswhite c3bc4c7
chore: cleanup unused test utils
bryanchriswhite 3fdada6
chore: comment cleanup
bryanchriswhite 39a7877
chore: add submodule TECHDEBT comments
bryanchriswhite 049cbf5
chore: add missing godoc comments
bryanchriswhite 79a1c6e
chore: cleanup unused garbage
bryanchriswhite a7c4bf6
fix: return error
bryanchriswhite 904f17b
Merge remote-tracking branch 'pokt/main' into refactor/unicast-router
bryanchriswhite 0d9b454
Merge remote-tracking branch 'pokt/main' into refactor/unicast-router
bryanchriswhite 0cf71de
chore: improve comment'
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
package testutil | ||
|
||
type ProxyFactory[T any] func(target T) (proxy T) |
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 was deleted.
Oops, something went wrong.
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
Oops, something went wrong.
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.
This is the first:
Logger
in a structNo problems/concerns, but wanted to understand if this is the approach we're taking with submodules?
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.
The structs in this package are all config structs which are used to pass required parameters to constructor functions (most of which are submodule constructors). They must export their fields in order for consumers to be able to configure the unexported fields of the object under construction, via the respective constructor.
I could understand the argument that it may make more sense for these configs to live in same package as the constructor which they accompany; however, even then, these fields would still need to be exported for package-external consumers to use them (e.g.
p2p
package). The rationale behind the current code organization was to deduplicatebaseConfig#IsValid()
betweenRainTreeConfig
andBackgroundConfig
. To do this without creating an import cycle requires an additional package. At that point, this package seemed most appropriate forUnicastConfig
to live here as well. I don't have a strong opinion about it, I just felt like this was the most readable and least complex option at the time.RainTreeRouter
andBackgroundRouter
configs (also defined in this package) do not have an associated protobuf config type, nor do I think it would make sense for them to. In the specific cases of the routers, only one of the required parameters are serializable and it is (appropriately) derived from aP2PConfig
field (Address
). This makes it a poor candidate, in my view, to be converted into a protobuf type such that it can be embedded in the P2P config type; however, you've made me aware of the possibility of such a case and potential consistent integration approach. 🙌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.
Makes sense to me. My tl;dr takeaway is:
RainTreeConfig
andBackgroundConfig