-
Notifications
You must be signed in to change notification settings - Fork 90
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
core/consensus: add support for pointer values on the wire #1838
Conversation
@@ -73,150 +69,28 @@ func TestSigning(t *testing.T) { | |||
require.False(t, ok) | |||
} | |||
|
|||
func TestBackwardsCompatibility(t *testing.T) { |
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 tests 2 updates ago, we already removed support, can remove now.
core/corepb/v1/consensus.proto
Outdated
repeated QBFTMsg justification = 2; | ||
QBFTMsg msg = 1; | ||
repeated QBFTMsg justification = 2; | ||
repeated google.protobuf.Any values = 3; |
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.
so the values are added here and can therefore be removed from QBFTMsg
above once we remove support for v0.13.
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.
Nit: can we add a comment for future reference?
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.
sure
Codecov ReportPatch coverage:
Additional details and impacted files@@ Coverage Diff @@
## main #1838 +/- ##
==========================================
+ Coverage 55.34% 55.45% +0.10%
==========================================
Files 170 170
Lines 22332 22254 -78
==========================================
- Hits 12360 12340 -20
+ Misses 8385 8337 -48
+ Partials 1587 1577 -10
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
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.
General approve because it looks good.
I wonder if we could get rid of the *anypb.Any
and deal with copies instead.
@@ -545,3 +568,22 @@ func newRoundTimer(round int64) (<-chan time.Time, func()) { | |||
timer := time.NewTimer(roundStart + (time.Duration(round) * roundIncrease)) | |||
return timer.C, func() { timer.Stop() } | |||
} | |||
|
|||
func valuesByHash(values []*anypb.Any) (map[[32]byte]*anypb.Any, error) { | |||
resp := make(map[[32]byte]*anypb.Any) |
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.
Should this function return error if values is empty?
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.
nope, empty values result in a empty map, this is required for legacy v0.13 support.
core/corepb/v1/consensus.proto
Outdated
repeated QBFTMsg justification = 2; | ||
QBFTMsg msg = 1; | ||
repeated QBFTMsg justification = 2; | ||
repeated google.protobuf.Any values = 3; |
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.
Nit: can we add a comment for future reference?
@gsora I do not think we should get rid of |
Sorry, didn't mean to imply that I'm nitpicking though, because I really would love to avoid pointers when possible. |
Since the |
Upgrades the QBFT wire protocol (without breaking backwards compatibility) by adding the whole value to the
ConsensusMsg
envelope and hashes of those values to theQBFTMsg
itself. This will allow us to remove the values from the QBFT messages, which will reduce network bandwidth usage by a lot (90% for large values; beacon blocks).This increases the network bandwidth for next release v0.14, but once we remove support for v0.13, it will reduce it by a lot.
category: feature
ticket: #1552