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

Force serialization of primitive proto fields for block and tx data #1793

Merged
merged 3 commits into from
Sep 5, 2019

Conversation

ansnunez
Copy link
Contributor

@ansnunez ansnunez commented Sep 4, 2019

Description

Proto3 does not serialize fields that are set to default value (reference)

This is a breaking change from proto2, and will be problematic for any of our code that relies on byte consistency (e.g., hashes based on serialized blocks).

To fix this, we force the serialization of these fields by wrapping each one in a oneof. (reference)

Backward Compatibility

  • This is not a breaking change
  • This is a breaking change

Review Suggestion

Status

Implementation

  • ready for review

Integration Test (Core Team)

  • local machine test
  • small-scale cloud test

@ansnunez ansnunez added the Ready Ready for review label Sep 4, 2019
@ansnunez ansnunez self-assigned this Sep 4, 2019
@ansnunez ansnunez added this to PRs in development in Core via automation Sep 4, 2019
@ansnunez ansnunez moved this from PRs in development to PRs needing review in Core Sep 4, 2019
@codecov-io
Copy link

codecov-io commented Sep 4, 2019

Codecov Report

Merging #1793 into master will increase coverage by 0.06%.
The diff coverage is n/a.

@@            Coverage Diff             @@
##           master    #1793      +/-   ##
==========================================
+ Coverage   33.77%   33.83%   +0.06%     
==========================================
  Files         274      274              
  Lines       33732    33994     +262     
==========================================
+ Hits        11394    11503     +109     
- Misses      22338    22491     +153
Impacted Files Coverage Δ
src/libUtils/SWInfo.cpp 90.83% <0%> (-2.3%) ⬇️
src/libPersistence/BlockStorage.cpp 31.26% <0%> (+3.61%) ⬆️

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 4fbb94e...aa7f51c. Read the comment docs.

Core automation moved this from PRs needing review to PRs approved - ready to merge! Sep 5, 2019
@ansnunez ansnunez merged commit 211b014 into master Sep 5, 2019
Core automation moved this from PRs approved - ready to merge! to PRs done (merged) Sep 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Ready Ready for review
Projects
Core
  
PRs done (merged)
Development

Successfully merging this pull request may close these issues.

None yet

4 participants