peer-talk
peer-talk copied to clipboard
Replace protobuf-net with offical protobuf library
This is a draft PR only, I can totally remove protobuf-net dependency if there're no concerns.
This looks great. Didn't know it could be so easy. Yes please continue with this PR.
Also net-ipfs-engine needs these changes.
Welcome to the team. I need all the help I can get.
Codecov Report
Merging #37 into master will increase coverage by
0.32%
. The diff coverage is78.8%
.
@@ Coverage Diff @@
## master #37 +/- ##
==========================================
+ Coverage 76.9% 77.22% +0.32%
==========================================
Files 51 51
Lines 2693 2692 -1
==========================================
+ Hits 2071 2079 +8
+ Misses 622 613 -9
Impacted Files | Coverage Δ | |
---|---|---|
src/Cryptography/EphermalKey.cs | 57.69% <ø> (ø) |
:arrow_up: |
src/Cryptography/StretchedKey.cs | 87.93% <ø> (ø) |
:arrow_up: |
src/SecureCommunication/Secio1.cs | 2.88% <0%> (ø) |
:arrow_up: |
src/Cryptography/Key.cs | 0% <0%> (ø) |
:arrow_up: |
src/PubSub/PublishedMessage.cs | 100% <100%> (ø) |
:arrow_up: |
src/Protocols/Identify1.cs | 98% <100%> (ø) |
:arrow_up: |
src/Cryptography/CtrStreamCipher.cs | 86.36% <100%> (ø) |
:arrow_up: |
src/PubSub/NotificationService.cs | 100% <100%> (ø) |
:arrow_up: |
src/ExtendedMessageEntensions.cs | 100% <100%> (ø) |
|
src/Cryptography/PreSharedKey.cs | 100% <100%> (ø) |
:arrow_up: |
... and 8 more |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 26ade4d...a375fba. Read the comment docs.
You work fast! It will take me some time to do a review.
I noticed you did a merge
to the master. I like using rebase
, so that other commits are not polluting the PR.
I know it is a religious war, but I prefer var x = new X(...)
instead of X x = new X(...)
. Since this is a large code base, let's follow my rules.
Will start review in an hour, it's my diner time (18:20 in NZ)
@richardschneider Done
@richardschneider u can use 'squash merge' to avoid polluting commit history, all commits will be merged into a single one. IMO Commit history during PR is not helpful, better to keep PR as small as possible and always square merge into master (this PR is large tho but still I don't think my commit history is helpful)
I do not like the changes to the unit test. The objects should behave exactly the same as before this PR and no external names should be changed. This is a biggie!
@richardschneider There should not be any logic change in UT, all changes I've made are to switch from old protobuf-net DS to google-protobuf DS (otherwise it won't build : ()
@richardschneider Regarding all the style changes, only the _ prefix thing is what I did manually, others are all because I happen to run vs2019 code formatter (ctrl + K + E ) : (
In my experience, the easiest way to enforce formatting is to use tools like dotnet-format (unfortunately whose default ruleset has _ prefix thing and may not be what you would like )
@hanabi1224 I really want your changes. It's a good direction for this library.
However, PeerTalk test coverage is poor (my fault) so I'm spending a lot of time looking at all the changes.
Because testing is poor in peer-talk
, I built the package with your changes and then included it in net-ipfs-engine
.
The secio changes caused connection with go-ipfs
to failed. I'll start investigating and will get back to you.
The secio protocol requires fixed 32 big endian length in many places. The code is using varint32. I've tried to note all the cases in my review.
Basically, need a big endian version of WriteDelimitedTo
and ParseDelimitedFrom
It will be great if you'd like to add more tests to cover the cases found in this PR. : )