bsc icon indicating copy to clipboard operation
bsc copied to clipboard

related to gas and gasprice

Open speqtovijay opened this issue 2 years ago • 10 comments

can you anyone guide how to reduce gas limit, transaction gas ? in Below screen shot i already in code 21000 reduce to 18000 in code but when i started Block chain on Local machine it shows 21000 i didnot get from where it shows 21000 Screenshot from 2022-05-30 13-53-03

speqtovijay avatar May 30 '22 08:05 speqtovijay

You can overwrite gas and gasPrice in the parameter.

Check https://web3js.readthedocs.io/en/v1.2.11/web3-eth.html#eth-sendtransaction

owen-reorg avatar Jun 01 '22 03:06 owen-reorg

can we change gas from Blockchain?

speqtovijay avatar Jun 01 '22 04:06 speqtovijay

where is define 21000 as gas from where is pick

speqtovijay avatar Jun 01 '22 07:06 speqtovijay

21000 is the gas cost defined by the protocol. I believe there is no way to change it from Blockchain.

owen-reorg avatar Jun 02 '22 02:06 owen-reorg

I changed in protocal_param.go file also but still 21000 showing

speqtovijay avatar Jun 02 '22 02:06 speqtovijay

I changed in protocal_param.go file also but still 21000 showing

Could you show where you changed exactly in the code and what's your expectation?

IMO, 21000 is the gas cost defined by the protocol. I believe there is no way to change it from Blockchain.

owen-reorg avatar Jun 09 '22 03:06 owen-reorg

i changed in Blockchain code protocol module in which i found protocal_param.go in which gas defined so there changed my expectation is to when any transaction eg. tranfer coin one wallet to another that time gas charges is 21000 i want to reduce this gas charge. Screenshot from 2022-06-10 10-37-50

speqtovijay avatar Jun 10 '22 05:06 speqtovijay

You can overwrite gas and gasPrice in the parameter.

Check https://web3js.readthedocs.io/en/v1.2.11/web3-eth.html#eth-sendtransaction

Did you set the gasLimit to 5000 when you sent the transaction after changing the code?

owen-reorg avatar Jun 14 '22 03:06 owen-reorg

Because you are using cmd, so the gas hardcoded at: https://github.com/bnb-chain/bsc/blob/master/cmd/faucet/faucet.go#L537

nhanth87 avatar Aug 30 '22 02:08 nhanth87

you can not change protocol parameters without fork, if you use different protocol parameters other nodes and miners will not accept your tx.

haliliceylan avatar Oct 05 '22 09:10 haliliceylan