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

RPC extension for generic invocations #3836

Open
roman-khimov opened this issue Mar 11, 2025 · 0 comments
Open

RPC extension for generic invocations #3836

roman-khimov opened this issue Mar 11, 2025 · 0 comments
Assignees
Labels
feature Completely new functionality I2 Regular impact rpc RPC server and client S4 Routine U2 Seriously planned
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 solve nspcc-dev/neofs-api#305 easily. An attempt to do this in nspcc-dev/neofs-node#3216 shows some weaknesses:

  • stateless scripts are broken immediately because of intermediate ("third") script with additional data
  • stateful ones require additional care to handle specific parameters

The aim is to have N3 accounts work as is and provide more natural environment for contracts. In that environment we're checking for the script container hash and can have additional data like ledger height and current time provided by the runtime.

Describe the solution you'd like

An additional RPC endpoint for more generic script invocations.

invokescript isn't sufficient:

  • wrong trigger
  • can't have stable container hash
  • can't fake persisting block properly

invokecontractverify isn't sufficient:

  • doesn't cover regular verification scripts
  • can't have stable container hash
  • can't fake persisting block properly

We need something like invokecontainedscript(tx, block_header, trigger), where tx.Script is executed (it can be concatenated invocation+verification) with tx.Hash container (and other properties if passed) in a block with the given header (height/time/etc).

This will make stateless scripts work as is and stateful ones would just need to take into account indexes/time for reverifications. This also mostly shifts some responsibilities from the server side to client, whatever it provides we execute, regular invoke* functions create most of the same environment automatically based on current state.

The only caveat is honest NEP-30 contract-based verification, this doesn't fit into the model perfectly, but can be emulated if script to call verify() is provided client-side.

Describe alternatives you've considered

invokeverificationscript(invocation, verification, hash, time) was considered initially, but we can have something more generic.

@roman-khimov roman-khimov added feature Completely new functionality I2 Regular impact rpc RPC server and client S4 Routine U2 Seriously planned labels Mar 11, 2025
@roman-khimov roman-khimov added this to the v0.109.0 milestone Mar 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Completely new functionality I2 Regular impact rpc RPC server and client S4 Routine U2 Seriously planned
Projects
None yet
Development

No branches or pull requests

2 participants