-
Notifications
You must be signed in to change notification settings - Fork 79
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
ws: allow filtering notification by parameters #3689
Conversation
Some questions:
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3689 +/- ##
==========================================
- Coverage 83.04% 83.01% -0.04%
==========================================
Files 335 335
Lines 46719 46782 +63
==========================================
+ Hits 38800 38834 +34
- Misses 6327 6350 +23
- Partials 1592 1598 +6 ☔ View full report in Codecov by Sentry. |
d4643f2
to
fd5ad7b
Compare
Use and extend the following tests:
neo-go/pkg/services/rpcsrv/client_test.go Line 2131 in 990634a
That's the way how we test subscriptions. If it's not enough, then create your own test based on neo-go/pkg/services/rpcsrv/client_test.go Line 1895 in 990634a
Will be answered in review.
Let's limit the number of parameters to 16 for now, it's pretty enough for notifications used by NeoFS and at the same time it won't allow to DoS the node with useless filtering process for large notifications/filters. Also, parameter types should be limited by non-compound types (simple Integer, String, Hash160 and etc.; excluding Arrays, Structs and Maps), we don't need compounds for now and NeoFS contracts don't use them in notifications; in future the set of supported types may be extended.
Avoid filters misuse and unwanted load for RPC server. This extension will be available on public RPC nodes.
Deploy contract that emits thousands of notifications (it's possible, hi, #3490), then subscribe to RPC server with matching filters. |
9191c15
to
b4fc362
Compare
@AnnaShaleva thanks for the review! It was kinda draft with the main questions but tried to answer and fix all the threads you left, check one more time, please. |
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.
Tests are not yet checked, will review them after PR finalisation.
b4fc362
to
a87d7cb
Compare
a87d7cb
to
b7d0172
Compare
b7d0172
to
29d2a57
Compare
@carpawell tests are failing. |
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.
Some of previous conversations are unresolved.
29d2a57
to
0919d65
Compare
`Any` type with nil/null value is treated as a parameter filter that allows any notification value. Not more than 16 filter parameters are allowed. Closes #3624. Signed-off-by: Pavel Karpy <[email protected]>
Signed-off-by: Pavel Karpy <[email protected]>
0919d65
to
97bd73b
Compare
Can you point me, please? As I see it: it is either fixed or I asked some questions that have not been answered or something is not relevant already. |
Closes #3624.