Do not make RPC for stateless N3 verification scripts #1406

Open
opened 2025-12-28 17:22:53 +00:00 by sami · 0 comments
Owner

Originally created by @cthulhu-rider on GitHub (Apr 23, 2025).

https://github.com/nspcc-dev/neofs-node/blob/master/internal/crypto/n3.go

currently, SN and IR always exec N3 scripts via invokecontainedscript FS chain RPC. This works for any kind of scripts, but for stateless - not optimal. Simple- and multi-sig scripts are self-contained and can be handled outside the chain

Describe the solution you'd like

pre-check whether verification script is a simple or multi signature one. Use NeoGo lib parsers to do. If that's the case, decode keys and verify signature, and return

note that height prm is only needed for stateful historic invocations, so do not forget to exclude its resolution from epoch (done via getEpochBlock Netmap contract RPC)

Describe alternatives you've considered

no

Additional context

Originally created by @cthulhu-rider on GitHub (Apr 23, 2025). ## Is your feature request related to a problem? Please describe. https://github.com/nspcc-dev/neofs-node/blob/master/internal/crypto/n3.go currently, SN and IR always exec N3 scripts via `invokecontainedscript` FS chain RPC. This works for any kind of scripts, but for stateless - not optimal. Simple- and multi-sig scripts are self-contained and can be handled outside the chain ## Describe the solution you'd like pre-check whether verification script is a simple or multi signature one. Use NeoGo lib parsers to do. If that's the case, decode keys and verify signature, and return note that `height` prm is only needed for stateful historic invocations, so do not forget to exclude its resolution from epoch (done via `getEpochBlock` Netmap contract RPC) ## Describe alternatives you've considered no ## Additional context * #3194
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
nspcc-dev/neofs-node#1406
No description provided.