bsc
bsc copied to clipboard
related to gas and gasprice
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
You can overwrite gas
and gasPrice
in the parameter.
Check https://web3js.readthedocs.io/en/v1.2.11/web3-eth.html#eth-sendtransaction
can we change gas from Blockchain?
where is define 21000 as gas from where is pick
21000 is the gas cost defined by the protocol. I believe there is no way to change it from Blockchain.
I changed in protocal_param.go file also but still 21000 showing
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.
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.
You can overwrite
gas
andgasPrice
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?
Because you are using cmd, so the gas hardcoded at: https://github.com/bnb-chain/bsc/blob/master/cmd/faucet/faucet.go#L537
you can not change protocol parameters without fork, if you use different protocol parameters other nodes and miners will not accept your tx.