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

Notification filtering based on parameters #3624

Closed
roman-khimov opened this issue Oct 17, 2024 · 0 comments · Fixed by #3689
Closed

Notification filtering based on parameters #3624

roman-khimov opened this issue Oct 17, 2024 · 0 comments · Fixed by #3689
Assignees
Labels
enhancement Improving existing functionality I2 Regular impact rpc RPC server and client S4 Routine U3 Regular
Milestone

Comments

@roman-khimov
Copy link
Member

Is your feature request related to a problem? Please describe.

I'm always frustrated when we can't filter notifications we subscribe to by parameters. Consider getting events for NEP-17 transfers from some account or to some account, it can't be expressed with filters currently. Consider nspcc-dev/neofs-contract#414 without additional contracts.

Describe the solution you'd like

Add a parameters filter to notification_from_execution. This should be an array (NEP-25 events have an array of parameters) of structures with type and value fields. Types corresponding to NEP-25 (and we can restrict this set to basic (string/hash/int/...) types only to avoid abuse) and values containing type-specific data (smartcontract.Parameter effectively that we accept for invocations). Any type with no value can be used as a placeholder for non-filtered field. Filters containing only Any parameters are not accepted. Number of parameters can be restricted (8? 16?). Then server-side we'd check emitted event not just for name, but for parameters as well.

Describe alternatives you've considered

Keeping things as is, lacking this feature.

Additional context

nspcc-dev/neofs-contract#414
https://github.com/neo-project/proposals/blob/master/nep-17.mediawiki#user-content-Transfer
https://github.com/neo-project/proposals/blob/master/nep-25.mediawiki#user-content-Event
https://pkg.go.dev/github.com/nspcc-dev/[email protected]/pkg/smartcontract#Parameter

@roman-khimov roman-khimov added I2 Regular impact rpc RPC server and client U3 Regular enhancement Improving existing functionality S4 Routine labels Oct 17, 2024
@roman-khimov roman-khimov added this to the v0.107.0 milestone Nov 2, 2024
carpawell added a commit that referenced this issue Nov 18, 2024
carpawell added a commit that referenced this issue Nov 18, 2024
carpawell added a commit that referenced this issue Nov 18, 2024
carpawell added a commit that referenced this issue Nov 20, 2024
`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]>
carpawell added a commit that referenced this issue Nov 21, 2024
`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]>
carpawell added a commit that referenced this issue Nov 22, 2024
`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]>
carpawell added a commit that referenced this issue Nov 22, 2024
`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]>
carpawell added a commit that referenced this issue Nov 25, 2024
`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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Improving existing functionality I2 Regular impact rpc RPC server and client S4 Routine U3 Regular
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants