chainweb-node icon indicating copy to clipboard operation
chainweb-node copied to clipboard

possible bug: transactions sent to `/local` on `api.chainweb.com` use more gas than the actual transaction

Open fiankr opened this issue 2 years ago • 1 comments

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?

fiankr avatar Aug 28 '22 10:08 fiankr

Zelcore is having the same issue. Try increasing the gas limit to 2500 which worked for me.

ctmallam avatar Sep 03 '22 18:09 ctmallam

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.

edmundnoble avatar Jan 10 '23 00:01 edmundnoble

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.

trendzetter avatar Jan 10 '23 10:01 trendzetter

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.

jwiegley avatar Jan 11 '23 06:01 jwiegley

See https://github.com/kadena-io/chainweb-node/pull/1653 for tracking.

edmundnoble avatar May 17 '23 15:05 edmundnoble

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.

edmundnoble avatar Jun 13 '23 17:06 edmundnoble