-
Notifications
You must be signed in to change notification settings - Fork 78
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
Introduce protobuf types under new pkg directory #56
Merged
+83
−0
Merged
Changes from 1 commit
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
2290a08
Introduce protobuf types under new pkg directory
1bcb6f7
Introduce a mechanism to generate protobuf
abea7e2
Introduce Peer Identities and GossipMessages.
30b7ae1
Generate protobuf code with "go generate".
62b8038
Add protobuf dependency with dep.
1e71aec
Add Makefile and Readme to simplify dev experience
57df3f2
Remove weird spacing in Makefile
ca1913c
Point our protobuf dependency to a commit.
c7228d1
Remove generated code and dependency.
bd88baf
Remove Makefile, note dependencies in Readme.
8cc74d6
Add EncryptedEnvelope, update GossipMsg doc.
19d4a44
Remove unnecessary readme.
c8b128d
Move payload and signature fiedls in GossipMessage
94adfc7
Update Dockerfile with proto dependencies
e81b9dd
Note that only the receiver is optional, not sender
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
Add protobuf dependency with dep.
This was initalized by running `dep init` in the `pkg` directory. Of note, this duplicates our vendored dependencies between `go/` and `pkg/`, but for all intents and purposes, they are separate.
- v2.1.0
- v2.0.1
- v2.0.0
- v2.0.0-m7
- v2.0.0-m6
- v2.0.0-m5
- v2.0.0-m4
- v2.0.0-m3
- v2.0.0-m3-rc
- v2.0.0-m2
- v2.0.0-m1
- v1.21.0
- v1.3.1
- v1.3.0
- v1.3.0-rc.4
- v1.3.0-rc.3
- v1.3.0-rc.2
- v1.3.0-rc.1
- v1.3.0-rc
- v1.2.4-rc
- v.1.2.3-rc
- v1.2.2
- v1.2.1
- v1.2.0
- v1.2.0-rc.1
- v1.2.0-rc
- v1.1.4
- v1.1.3
- v1.1.2
- v1.1.1-rc
- v1.1.0-rc
- v1.0.1
- v0.14.1-rc
- v0.14.0-rc
- v0.13.0-rc
- v0.12.0-rc
- v0.11.0-rc
- v0.10.0
- v0.9.1
- v0.9.0
- v0.8.0
- v0.7.0
- v0.6.0
- v0.5.0
- v0.4.0
- v0.3.0
- v0.2.0
- token-dashboard/v1.20.0
- token-dashboard/v1.19.1
- token-dashboard/v1.19.0
- token-dashboard/v1.18.0
- token-dashboard/v1.17.1
- token-dashboard/v1.17.0
- token-dashboard/v1.16.2
- token-dashboard/v1.16.1
- token-dashboard/v1.16.0
- token-dashboard/v1.15.3
- token-dashboard/v1.15.2
- token-dashboard/v1.15.1
- token-dashboard/v1.15.0
- token-dashboard/v1.14.0
- token-dashboard/v1.13.0
- token-dashboard/v1.12.1
- token-dashboard/v1.12.0
- token-dashboard/v1.11.0
- token-dashboard/v1.10.2
- token-dashboard/v1.10.1
- token-dashboard/v1.10.0
- token-dashboard/v1.9.0
- token-dashboard/v1.8.1
- token-dashboard/v1.8.0
- token-dashboard/v1.7.2
- token-dashboard/v1.7.1
- token-dashboard/v1.7.0
- token-dashboard/v1.6.0
- token-dashboard/v1.5.0
- token-dashboard/v1.4.1
- token-dashboard/v1.4.0
- token-dashboard/v1.3.3
- token-dashboard/v1.3.2
- token-dashboard/v1.3.1
- token-dashboard/v1.3.0
- token-dashboard/v1.3.0-rc.1
- solidity/v2.0.1
- solidity/v2.0.0
- solidity/v1.7.0
- solidity/v1.6.0
- solidity/v1.5.0
- solidity/v1.4.1
- solidity/v1.4.0
- solidity/v1.3.0
- solidity/v1.3.0-rc.1
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# Gopkg.toml example | ||
# | ||
# Refer to https://github.com/golang/dep/blob/master/docs/Gopkg.toml.md | ||
# for detailed Gopkg.toml documentation. | ||
# | ||
# required = ["github.com/user/thing/cmd/thing"] | ||
# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"] | ||
# | ||
# [[constraint]] | ||
# name = "github.com/user/project" | ||
# version = "1.0.0" | ||
# | ||
# [[constraint]] | ||
# name = "github.com/user/project2" | ||
# branch = "dev" | ||
# source = "github.com/myfork/project2" | ||
# | ||
# [[override]] | ||
# name = "github.com/x/y" | ||
# version = "2.4.0" | ||
# | ||
# [prune] | ||
# non-go = false | ||
# go-tests = true | ||
# unused-packages = true | ||
|
||
|
||
[[constraint]] | ||
name = "github.com/gogo/protobuf" | ||
version = "1.0.0" | ||
|
||
[prune] | ||
go-tests = true | ||
unused-packages = true |
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.
From a glance at
gogo/protobuf
, most of its changes are ingolang/protobuf
. Was there something specific that you wanted from them? I would rather depend on the upstream if possible.Notably, we'll need to fork this to Keep as well… But we'll hold off for now.
Also, remember to depend on a commit id, not a tag. Tags are mutable.
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.
Can you point where most of
gogo/protobuf's
features are ingolang/protobuf
? I know it's definitely the other way around, but not seeing evidence thatgolang/protobuf
has gogo's fast marshalling + unmarshalling (this issue does a great job of detailing why folks use gogo: golang/protobuf#280), other serialization formats (grpc, json if we need to switch / test things out), and more canonical go structures (figures a fork has better go support than the original). That being said, as things change, we should definitely evaluate them. Folks in the industry focused on performance have gravitated around gogo's solution. As we'll be having a lot of chatter on the wire, we'll want the one that's most supported and optimized for our use case.Will change to commit id - thanks for catching that (why oh why dep do you default to tags)
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.
Here is the tradeoff that you end up making: https://groups.google.com/forum/#!msg/golang-nuts/F5xFHTfwRnY/sPv5nTVXBQAJ (this is the go teams opinion of the tradeoff).
From past use, the un/marshallers in gogo are super helpful. Writing that code can be annoying, and it's one of the few times that I'm a fan of code generation.
Do you think the tradeoffs that we will need to make in relay/Keep land are more around speed/performance or size?
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.
Tbh I'm pretty concerned with the forward-compatibility changes the gogo representative says they haven't dealt with… It sounds like it's a young project used by young projects, and that usually means tradeoffs that haven't been fully understood. I trust the Google folks to understand problems like that a bit better.
My initial understanding was wrong here though: gogo/protobuf#191 was what I based my comment on, and it tracks the opposite of what I thought, namely whether the mainline has been merged into this fork.
I suspect our performance will be absolutely dominated by almost everything except serialization/deserialization, since our data structures right now aren't terribly complicated or large, and though we'll have chatter it won't be super-frequent. Given the emphasis on compatibility, I'm tempted to say we stick with golang's version and switch to gogo if and when we find ourselves with problems it tackles in a way we think is good.
Lastly, re: marshaller/unmarshaller, presumably the golang version has that as well, it's just not repeated for each type? So it's not like we have no insight into how it's doing things, right?
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 see where you're coming from, but I need to respectfully disagree on a few points here:
Given the number of users (including dropbox, docker, and redhat), and even our friends in decentra-land are in the game! https://github.com/ipfs/go-ipfs/search?utf8=%E2%9C%93&q=gogo&type=
I'd say there are good reasons for using it! That being said, you bring up a great point about us being dominated by other issues before serialization becomes a concern. That being said, if we're shipping BLS ids and group signature shares around, I think we'll be contending with these issues as well...
Re confusion over gogo becoming compatible with
golang/protobuf
: they're working on merging mainline back in - I think that's a good thing in terms of giving us options.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.
More importantly it looks like libp2p uses it, so I think we'll be pulling the dependency in transitively anyway, and therefore I guess we'll need to pin it regardless. I don't love it, and I continue to be more convinced by upstream's arguments more than downstream's, but so it goes. Let's do whatever minimizes the cross-section of packages we need to pin, in this case that looks like it's sticking to
gogo
.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.
Ok, for personal curiosity, off-thread I'd love to hear your explanation of upstream's arguments vs downstream's args. I might be missing something here.