chainweb-node
chainweb-node copied to clipboard
possible bug: transactions sent to `/local` on `api.chainweb.com` use more gas than the actual transaction
Steps to reproduce:
Use chainweaver to try to transfer some KDA. A typical coin.transfer-create
takes around ~600 gas. However, setting the gas limit to as high as 1000 and clicking on the preview button (which I believe uses /local
to simulate the transaction) gives the following error: Error from (api.chainweb.com): : Failure: Gas Error: Gas limit (1000) exceeded: 1006
.
This appears to be an issue with api.chainweb.com
only. The issue goes away when I change the chainweb server to kadena.app.runonflux.io
in Settings > Network. So probably something in the latest release?
Zelcore is having the same issue. Try increasing the gas limit to 2500 which worked for me.
The usual cause of this is that /local
is not aware of block heights. We're currently working on making /local
more faithful to the actual blockchain, and one way we can do this is by adding a height parameter to /local
.
Instead, the current behavior is that /local
just uses the behavior of the highest fork that it knows of, even if that fork hasn't taken place. So if a new version will make something more expensive later, /local
will always report that more expensive price.
thanks edmund for expanding on #1585 in layman's terms. I'm getting a better understanding now of how the /local
endpoint is being improved.
We'd like for /local
to become as close to an accurate preflight as possible, for debugging and development purposes. There are some changes currently in progress that ought to make it into the next point release.
See https://github.com/kadena-io/chainweb-node/pull/1653 for tracking.
This was actually fixed by #1585 for users setting the preflight
query parameter to true
. However, #1653 will let you additionally set the block height to some point in the past, with accurate fork behavior.