Notification filtering based on parameters #3624
Labels
enhancement
Improving existing functionality
I2
Regular impact
rpc
RPC server and client
S4
Routine
U3
Regular
Milestone
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 tonotification_from_execution
. This should be an array (NEP-25 events have an array of parameters) of structures withtype
andvalue
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 onlyAny
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
The text was updated successfully, but these errors were encountered: