-
Notifications
You must be signed in to change notification settings - Fork 265
feat: Add SDS unwrap process for received messages #7149
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
base: develop
Are you sure you want to change the base?
Conversation
Jenkins BuildsClick to see older builds (232)
|
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## develop #7149 +/- ##
============================================
- Coverage 59.76% 39.48% -20.28%
============================================
Files 822 823 +1
Lines 113641 113592 -49
============================================
- Hits 67916 44856 -23060
- Misses 38849 64453 +25604
+ Partials 6876 4283 -2593
Flags with carried forward coverage won't be shown. Click here to find out more.
|
e79a1c9 to
bfa9be7
Compare
bfa9be7 to
b659e65
Compare
752ca5e to
351f552
Compare
osmaczko
left a comment
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.
Thanks for the PR 🙏
jrainville
left a comment
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.
Nice job, just some small things.
Also, I noticed that you also did some wrapping in this PR, but the description only talks about unwrapping. Just wondering if it's a description error or some commits got into this PR by accident?
| if len(msg.EncryptionLayer.Payload) > 0 { | ||
| unwrappedMessage, err := r.stack.SDSManager.UnwrapReceivedMessage(msg.EncryptionLayer.Payload) | ||
| if err != nil { | ||
| r.logger.Warn("SDS: failed to unwrap received message", zap.Error(err)) |
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.
Shouldn't we just return the error? If the message was wrapped, there is no way to process it further anyway no?
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.
The error should be returned after the SDS wrap is enable by default, I will disable SDS wrap in the PR after tests, and enable it in newer release as it introduce broken changes.
igor-sirotin
left a comment
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.
Thank you!
Just a few minor things. Looking forward to testing it
85bbc62 to
3cde176
Compare
80d3aec to
d889036
Compare
igor-sirotin
left a comment
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.
LGTM, but please get an approval from @osmaczko before merging
Ivansete-status
left a comment
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.
LGTM! Thanks for it! 🙌
Adding minor nitpicks.
Besides¡, maybe the PR's title doesn't reflect the internal changes? Unless I'm missing somthing.
I thought that first we aimed to perform the unwrap but the code changes seem to perform wrap
jazzz
left a comment
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.
🚀
13dd00e to
dc89cf3
Compare
osmaczko
left a comment
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.
Thanks for the update. There is one key issue remaining around exposing reliability from messaging. Please see comments.
| } | ||
| } | ||
|
|
||
| err = r.processSDSLayer(responseMessage) |
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 please invoke it from within processReliabilityLayer? This way process*Layer invocations in processMessage reflect the protocol layers, i.e. SDS is part of reliability.
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.
The current processReliabilityLayer API looks specifically made for mvds. It'll be hard to reason about this PR if refactor this API.
protocol/common/message_sender.go
Outdated
| sdsWrappedPayload, err := s.messaging.Reliability().WrapPayloadForSDS(wrappedMessage, rawMessage.CommunityID) | ||
| if err != nil { | ||
| return nil, errors.Wrap(err, "failed to wrap payload for SDS") | ||
| } | ||
| wrappedMessage = sdsWrappedPayload |
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.
| sdsWrappedPayload, err := s.messaging.Reliability().WrapPayloadForSDS(wrappedMessage, rawMessage.CommunityID) | |
| if err != nil { | |
| return nil, errors.Wrap(err, "failed to wrap payload for SDS") | |
| } | |
| wrappedMessage = sdsWrappedPayload | |
| withSDS = true |
Then
... messagingtypes.SendPublicParams{
...
withSDS: withSDS,
...
}
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.
Put community id into the params and use it for the check of sds looks better. Not reusing the existing CommunityPublicKey, because it seems very different in its downstream usage, and how it gets set.
I remove the condition of ApplicationMetadataMessage_COMMUNITY_DESCRIPTION , as I don't see major blocker for not use sds for this type of message.
Co-authored-by: Igor Sirotin <[email protected]>
Co-authored-by: Igor Sirotin <[email protected]>
e95e82c to
15cfb07
Compare
osmaczko
left a comment
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.
Much cleaner, thank you!
|
@status-im/devops please review :) |
Add SDS unwrap process for received messages.
Important changes:
Relates #logos-messaging/pm#194