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

Open
roman-khimov opened this issue Oct 17, 2024 · 0 comments
Open

Notification filtering based on parameters #3624

roman-khimov opened this issue Oct 17, 2024 · 0 comments
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/neo-go@v0.106.3/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
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

No branches or pull requests

2 participants