Open matevz opened 1 month ago
The problem is that currently the way CLI does gas estimation ignores encryption-related costs, because it assumes that the node it is talking to does not have access to the key manager committee so it estimates a plain transaction and uses that estimate.
To avoid changing this assumption, it could probably at least better guess the costs, for example by querying how much encryption-related stuff costs and adding that plus some extra per-byte costs due to encrypted transactions being slightly larger.
Trying to transfer tokens from the
secp256k1
account on Sapphire and providing--encrypted
incorrectly estimates gas:first attempt (no
--gas-limit
provided):second attempt
--gas-limit 11388
:--gas-limit 11389
:--gas-limit 11390
:^^ the transaction was actually submitted and gas was spent, see: https://explorer.oasis.io/mainnet/sapphire/tx/1dc1246a30e854dede27d48cb1220b4c19d46521ade38622bbda3ea8c2a4e738
--gas-limit 12389
finally worked:Since gas estimates are standard for transactions such as ParaTime transfers and withdrawals, we could probably just hardcode those?