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

p2p/pex: migrate to Protobuf #4973

Merged
merged 5 commits into from
Jun 8, 2020
Merged

p2p/pex: migrate to Protobuf #4973

merged 5 commits into from
Jun 8, 2020

Conversation

tac0turtle
Copy link
Contributor

Description

migrate p2p/pex to protobuf

Closes: #XXX

I did this slightly different from #4800. Instead of having `decodeMsg` return a `tmp2p.Message`, I instead unpack the inner `Sum` message and return that as a `proto.Message`. This makes the returned message much more ergonomic, since callers don't have to worry about the `Sum` field and enum containers, and is also more symmetrical.

It might have been better for `mustEncode()` and `decodeMsg()` to simply take and return `tmp2p.Message`, since this would give us compile-time type safety, but having to deal with the enum containers everywhere is probably too painful. Too bad Go doesn't have native sum types. ☹️
@auto-comment
Copy link

auto-comment bot commented Jun 5, 2020

👋 Thanks for creating a PR!

Before we can merge this PR, please make sure that all the following items have been
checked off. If any of the checklist items are not applicable, please leave them but
write a little note why.

  • Wrote tests
  • Updated CHANGELOG_PENDING.md
  • Linked to Github issue with discussion and accepted design OR link to spec that describes this work.
  • Updated relevant documentation (docs/) and code comments
  • Re-reviewed Files changed in the Github PR explorer
  • Applied Appropriate Labels

Thank you for your contribution to Tendermint! 🚀

@tac0turtle tac0turtle changed the title p2p/pex: migrate to Protobuf (#4807) p2p/pex: migrate to Protobuf Jun 5, 2020
@tac0turtle tac0turtle self-assigned this Jun 5, 2020
@tac0turtle tac0turtle added C:p2p Component: P2P pkg R:major PR contains breaking changes that have to wait till a major release is made to be merged T:breaking Type: Breaking Change T:encoding Type: Amino, ProtoBuf labels Jun 5, 2020
@codecov
Copy link

codecov bot commented Jun 5, 2020

Codecov Report

Merging #4973 into master will decrease coverage by 0.04%.
The diff coverage is 35.82%.

@@            Coverage Diff             @@
##           master    #4973      +/-   ##
==========================================
- Coverage   63.27%   63.23%   -0.05%     
==========================================
  Files         188      187       -1     
  Lines       19587    19645      +58     
==========================================
+ Hits        12394    12422      +28     
- Misses       6199     6228      +29     
- Partials      994      995       +1     
Impacted Files Coverage Δ
p2p/netaddress.go 56.54% <0.00%> (-9.22%) ⬇️
p2p/pex/pex_reactor.go 80.42% <64.86%> (-1.70%) ⬇️
libs/events/events.go 93.20% <0.00%> (-4.86%) ⬇️
blockchain/v0/pool.go 78.02% <0.00%> (-0.64%) ⬇️
consensus/replay_stubs.go 60.86% <0.00%> (-0.25%) ⬇️
consensus/state.go 71.61% <0.00%> (+0.46%) ⬆️
consensus/replay.go 72.57% <0.00%> (+0.84%) ⬆️
blockchain/v0/reactor.go 69.19% <0.00%> (+0.84%) ⬆️
consensus/reactor.go 73.54% <0.00%> (+1.16%) ⬆️
... and 1 more

@tac0turtle tac0turtle marked this pull request as ready for review June 5, 2020 16:08
@tac0turtle tac0turtle requested review from melekes and tessr as code owners June 5, 2020 16:08
Copy link
Contributor

@melekes melekes left a comment

Choose a reason for hiding this comment

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

🌃 🎦

p2p/pex/pex_reactor.go Show resolved Hide resolved
p2p/pex/pex_reactor.go Outdated Show resolved Hide resolved
@tac0turtle tac0turtle added the S:automerge Automatically merge PR when requirements pass label Jun 8, 2020
@mergify mergify bot merged commit 3b256cc into master Jun 8, 2020
@mergify mergify bot deleted the proto_pex branch June 8, 2020 09:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C:p2p Component: P2P pkg R:major PR contains breaking changes that have to wait till a major release is made to be merged S:automerge Automatically merge PR when requirements pass T:breaking Type: Breaking Change T:encoding Type: Amino, ProtoBuf
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants