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

Insufficient GAS error but the account has GAS (race condition?) #3284

Closed
lock9 opened this issue May 29, 2024 · 2 comments
Closed

Insufficient GAS error but the account has GAS (race condition?) #3284

lock9 opened this issue May 29, 2024 · 2 comments

Comments

@lock9
Copy link
Contributor

lock9 commented May 29, 2024

Describe the bug
Sometimes, when I send a transaction, I get an 'insufficient GAS' error. I'm using an account with GAS, and trying again (or a few times) fixes the issue.
I was having this issue on Neo Express and thought it was something with our extension. However, I just had this error and I'm not using the extension - but the testnet instead.

To Reproduce
Steps to reproduce the behavior:
I don't know how to reproduce it. The problem happens sporadically. 'Random transactions' fail with insufficient GAS error.

Expected behavior
The account has GAS so it shouldn't throw insufficient gas errors:

InvokeReceipt(tx_hash=24d5b2773bbebae2fadb3656e3951daffe8fd97c77ab2c223926ec8e06a2ed9b, included_in_block=4061838, confirmations=1, gas_consumed=4072238, state=FAULT, exception=Insufficient GAS., notifications=[], result=ApplicationExecution(state='FAULT', gas_consumed=4072238, exception='Insufficient GAS.', stack=[], trigger='Application', notifications=[]))

The detailed error can be found here:
https://testmagnet.explorer.onegate.space/transactionInfo/0x24d5b2773bbebae2fadb3656e3951daffe8fd97c77ab2c223926ec8e06a2ed9b

System.InvalidOperationException: Insufficient GAS. at Neo.SmartContract.ApplicationEngine.OnSysCall(InteropDescriptor descriptor) in E:\Release\3.7.4\neo-modules\neo\src\Neo\SmartContract\ApplicationEngine.cs:line 558 at Neo.SmartContract.ApplicationEngine.OnSysCall(ExecutionEngine engine, Instruction instruction) in E:\Release\3.7.4\neo-modules\neo\src\Neo\SmartContract\ApplicationEngine.cs:line 227 at Neo.VM.ExecutionEngine.ExecuteNext() in E:\Release\3.7.4\neo-modules\neo\src\Neo.VM\ExecutionEngine.cs:line 127

Platform:

  • Testnet
@lock9 lock9 changed the title Insufficient GAS error Insufficient GAS error but the account has GAS (race condition?) May 29, 2024
@roman-khimov
Copy link
Contributor

Take a look at #2806, it's the same problem effectively. Your invocation needs more GAS on-chain than it was estimated during test execution, so it fails (because system fee is all GAS it has).

@lock9
Copy link
Contributor Author

lock9 commented May 29, 2024

Hello,
There was a bug in my contract, and the GAS consumption was being miscalculated.

@lock9 lock9 closed this as completed May 29, 2024
@lock9 lock9 reopened this May 29, 2024
@lock9 lock9 closed this as not planned Won't fix, can't repro, duplicate, stale May 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants