Open carpawell opened 4 days ago
Some questions:
Attention: Patch coverage is 60.86957%
with 18 lines
in your changes missing coverage. Please review.
Project coverage is 82.97%. Comparing base (
176593b
) to head (b4fc362
). Report is 16 commits behind head on master.
Files with missing lines | Patch % | Lines |
---|---|---|
pkg/neorpc/filters.go | 48.27% | 11 Missing and 4 partials :warning: |
pkg/neorpc/rpcevent/filter.go | 82.35% | 2 Missing and 1 partial :warning: |
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
🚨 Try these New Features:
- Is there any full test for client-to-server communication to check that filtering works?
Use and extend the following tests: https://github.com/nspcc-dev/neo-go/blob/990634a43af5be0609270b2fce6b103f92686998/pkg/services/rpcsrv/subscription_test.go#L130 https://github.com/nspcc-dev/neo-go/blob/990634a43af5be0609270b2fce6b103f92686998/pkg/services/rpcsrv/client_test.go#L2131 That's the way how we test subscriptions. If it's not enough, then create your own test based on https://github.com/nspcc-dev/neo-go/blob/990634a43af5be0609270b2fce6b103f92686998/pkg/services/rpcsrv/client_test.go#L1895
- Are type limitations correct?
Will be answered in review.
- What limit should be used for parameter filters?
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.
Why should we have it (the issue says)?
Avoid filters misuse and unwanted load for RPC server. This extension will be available on public RPC nodes.
it is possible to abuse a node somehow?
Deploy contract that emits thousands of notifications (it's possible, hi, https://github.com/nspcc-dev/neo-go/issues/3490), then subscribe to RPC server with matching filters.
@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.
Closes #3624.