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 test invokes running out of GAS #396

Closed
hal0x2328 opened this issue Sep 25, 2018 · 3 comments
Closed

RPC test invokes running out of GAS #396

hal0x2328 opened this issue Sep 25, 2018 · 3 comments
Labels
Discussion Initial issue state - proposed but not yet accepted

Comments

@hal0x2328
Copy link
Contributor

Users in the Discord #support channel have reported instances of Neon token balances not displaying, while NEO/GAS balances were correct. I traced this to an RPC issue in Neo 2.9.0 nodes.

Due to the refactoring that occurred in (#288) ApplicationEngine.Run can now be passed the optional testMode flag directly, which defaults to false.

However, the invoke* RPC calls in RpcServer.cs still call ApplicationEngine.Run(script) only, meaning the invocation will not run in test mode, and will abort after exceeding 10 GAS in execution time.

The token balance query in Neon requires far more than 10 GAS to execute due to the large number of NEP-5 contracts now deployed on the network. So the FAULT condition in 2.9.0 invokescript calls leads to no tokens being displayed.

I believe the GetInvokeResult call in RpcServer.cs should pass testMode=true to ApplicationEngine.Run to return to the previous behavior.

@jsolman
Copy link
Contributor

jsolman commented Sep 25, 2018

RpcServer should still have some GAS limit to protect itself from malicious script hogging CPU, but yeah, it should allow more than 10 GAS.

@jsolman
Copy link
Contributor

jsolman commented Oct 17, 2018

It's up to owners of RPC nodes to allow more than 10 GAS at this point. Nodes default to 10 to protect from long running scripts on public nodes by default.

@ThomasLobker
Copy link

ThomasLobker commented Oct 17, 2018

Would it be an idea for NEON and other wallets to use getstorage instead? I think all NEP-5 contracts are using the same key for the user balance, which is the NEO address. It would speed things up, since requests don't have to go through a NeoVM instance.

Thacryba pushed a commit to simplitech/neo that referenced this issue Feb 17, 2020
* started changing en version

* italian version

* small changes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Discussion Initial issue state - proposed but not yet accepted
Projects
None yet
Development

No branches or pull requests

4 participants