oasisprotocol / oasisprotocol/cli
Wrong gas estimates for encrypted ParaTime transfers
Nobody has claimed this yet.
- Dominant language
- Go
- Stars
- 80
- Forks
- 23
- Avg merge
- 9h 43m
- Merged PRs (30d)
- 3
Description
Trying to transfer tokens from the secp256k1 account on Sapphire and providing --encrypted incorrectly estimates gas:
- first attempt (no
--gas-limitprovided):
Broadcasting transaction...
Error: Transaction check failed with error: module: core code: 12 message: out of gas (limit: 2318 wanted: 11388)
- second attempt
--gas-limit 11388:
Broadcasting transaction...
Error: Transaction check failed with error: module: core code: 12 message: out of gas (limit: 11388 wanted: 11389)
- third attempt
--gas-limit 11389:
Broadcasting transaction...
Error: Transaction check failed with error: module: core code: 12 message: out of gas (limit: 11389 wanted: 11390)
- fourth attempt
--gas-limit 11390:
Broadcasting transaction...
Transaction included in block successfully.
Round: 3995161
Transaction hash: 1dc1246a30e854dede27d48cb1220b4c19d46521ade38622bbda3ea8c2a4e738
(Transaction result is encrypted.)
Error: Execution failed with error: module: core code: 12 message: core: out of gas (limit: 11390 wanted: 12389)
^^ the transaction was actually submitted and gas was spent, see: https://explorer.oasis.io/mainnet/sapphire/tx/1dc1246a30e854dede27d48cb1220b4c19d46521ade38622bbda3ea8c2a4e738
- fifth attempt
--gas-limit 12389finally worked:
Broadcasting transaction...
Transaction included in block successfully.
Round: 3995186
Transaction hash: 7224d59e6b74d9b2caf55ab40dfe0757cef4f71c66d3a7aba3de1d267d2ea409
(Transaction result is encrypted.)
Execution successful.
Since gas estimates are standard for transactions such as ParaTime transfers and withdrawals, we could probably just hardcode those?
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reproducing an encrypted ParaTime transfer from a secp256k1 account using --encrypted, first without --gas-limit and then with the reported limits. Trace the gas-estimation path for encrypted transfers and compare it with standard ParaTime transfers; done means the estimate is sufficient and the transaction executes successfully without manually increasing the limit.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- go
- Domain
- blockchain, cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100