You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Simple non state changing call errors with “not enough funds to cover gas costs” when --price-limit is above 0
Description
Account without tokens (balance is 0) could not perform simple smart contract getter call (non changing state call should not require any gas).
Seems like the problem is in function func (t *Transition) subGasLimitPrice(msg *types.Transaction) error which gets executed even for non state change client calls.
Your environment
OS and version: Ubuntu 22.04
The version of the Polygon Edge.
Built from commit
f2b24e7 2023-09-14 11:17 +0200 Dusan Nosovic o [HEAD] {origin/v1.2.0-rc1} Introduce `ErrNonceUintOverflow` as error for nonce overflow (#1905)
Used origin/v1.2.0-rc1 branch
Generate keys, create a genesis file and run a network:
$ polygon-edge secrets init --insecure --data-dir test-chain-1
$ polygon-edge genesis --consensus ibft --ibft-validators-prefix-path test-chain- --bootnode /ip4/127.0.0.1/tcp/10001/p2p/16Uiu2HAmCwvnmjdsSyjJJJTbesHf6C9JvVp4RahqnvAfGnmfCNcV --premine 0xf24FF3a9CF04c71Dbc94D0b566f7A27B94566cac:0x123123123123123
Run network with price limit 100
$ polygon-edge server --data-dir ./test-chain-1 --chain genesis.json --price-limit=100
// Premined account is 0xf24FF3a9CF04c71Dbc94D0b566f7A27B94566cac with private key 0x5fb92d6e98884f76de468fa3f6278f8807c48bebc13595d45af5bdc4da702133
// Deploy simple TestContract2 smart contract provided (using ethers.js)
$ ts-node ./deploy-test-contract2.ts http://127.0.0.1:8545
In my case contract TestContact2 is deployed to address 0xc01Ee7f10EA4aF4673cFff62710E1D7792aBa8f3
Now run very simple script, that would only perform view getter call (getUintValue()), with the account that has 0 tokens on its balance (used account 0x5283ac54A7B9669F6415168DC7a5FcEe05019E45 private key 0x11eddfae7abe45531b3f18342c8062969323a7131d3043f1a33c40df74803cc7
$ ts-node check.ts http://127.0.0.1:8545 0xc01Ee7f10EA4aF4673cFff62710E1D7792aBa8f3 0x11eddfae7abe45531b3f18342c8062969323a7131d3043f1a33c40df74803cc7
Simple call fails with error "not enough funds to cover gas costs","error":{"code":-32600}. That is a non state changing call, so it should be executed.
Runnin a script with a account that has premined tokens succeeds:
$ ts-node check.ts http://127.0.0.1:8545 0xc01Ee7f10EA4aF4673cFff62710E1D7792aBa8f3 0x5fb92d6e98884f76de468fa3f6278f8807c48bebc13595d45af5bdc4da702133
Retrieved uint `a` value is= BigNumber { _hex: '0x13', _isBigNumber: true }
Expected behavior
Simple smart getter call should be executed when account without tokens performs the call
Error:
"not enough funds to cover gas costs","error":{"code":-32600}
Proposed solution
This seems like a serious issue, should be addressed immediately.
The text was updated successfully, but these errors were encountered:
Simple non state changing call errors with “not enough funds to cover gas costs” when
--price-limit
is above 0Description
Account without tokens (balance is 0) could not perform simple smart contract getter call (non changing state call should not require any gas).
Seems like the problem is in function
func (t *Transition) subGasLimitPrice(msg *types.Transaction) error
which gets executed even for non state change client calls.Your environment
Ubuntu 22.04
Built from commit
Locally
Steps to reproduce
Smart contract and scripts used are here:
smart_contract_and_scripts.zip
Expected behavior
Proposed solution
This seems like a serious issue, should be addressed immediately.
The text was updated successfully, but these errors were encountered: