Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [gas-limit]

Question related to either the transaction or block gas limit.

2
votes
0answers
21 views

What Web3JS method do I call to know what value to use for the gas price with sendSignedTransaction?

I am using Web3JS 1.0+ to send transactions to my smart contract. I've been using the following constant for the gas price in my code that I got a long time ago from a tutorial. What is the "...
1
vote
2answers
26 views

How to set maximum block gas in ganache-cli

I'm running ganache-cli which seems to have a block gas maximum of around 6.5 million. All the research I've done about this question seems to provide answers of the user themselves setting the user ...
0
votes
1answer
19 views

Deploying contract via Remix costs less gas than deploying via javascript

When I launch my contract via remix, it launches with no issues. When I try to launch the contract via my javascript web3, using the same gas price and gas limit, it fails b/c it ran out of gas. This ...
1
vote
1answer
48 views

What should be optimal gas limit and gas price for 80 addresses airdrop?

This is my airdrop function: mapping (address => bool) public airdrops; function airdropTokens(address[] _recipient, uint256[] _tokens) public onlyOwner{ uint airdropped; for(uint256 i = 0; i< ...
0
votes
1answer
30 views

Transaction Limit per block

I am developing a transaction analysis in a certain scenario on the Ethereum platform. Reading about, I understood that there is not a limit of transactions per block, but a limit of gas. Would anyone ...
1
vote
1answer
56 views

Error Ganache: Run out of gas - Works in Remix/Not from dApp

I am working on an application that stores and retrieves personal data on/from the ethereum blockchain. Just working on this to improve my Solidity and SC expertise and get comfortable with the ...
1
vote
1answer
29 views

Gas limit per block

Gas limit per block is a dynamic value. This value is increasing every year. Is it theoretically possible that such a value can somehow decrease?
0
votes
2answers
39 views

How to solve insufficient funds (Ropsten)?

I have tried adjusting the Gas Limit and GWEI and I get this error. I am using infura and Ropsten. Has anyone any ideas about this? Code - var rawTransaction = {"from":myAddress, "...
1
vote
0answers
39 views

Error in mist : exceed block gas limit

I am trying to deploy a smart contract in private network using mist, but when I deploy my contract and provide transaction fee as 0.04 ether it throws error as exceeding block gas limit. Here is the ...
2
votes
0answers
36 views

Difference between execution costs on remix an Ganache?

I created a contract on remix and then deployed it. when I call any function there is an execution cost in gas. I also deployed the same contract on Ganache for testing. I find the execution cost in ...
2
votes
1answer
20 views

Do I need to delete mappings that I don't need anymore?

I have a struct like this: struct Game { string gameID; string[2] teams; string winningTeam; string losingTeam; mapping(string => uint) totalWeiBet; ...
0
votes
2answers
36 views

Infinite gas on assigning struct

I have this code and it gives me infinite gas. please help me improve it. pragma solidity ^0.4.23; // v6 contract owned { constructor() public { owner = msg.sender; } address owner; ...
1
vote
2answers
98 views

Explanation of Geth's Command Line option: targetgaslimit?

I have been trying to figure out what the targetgaslimit parameter does exactly for Geth, in the context of Private Blockchains. I have seen the following explanation but it never helped me: "Target ...
0
votes
1answer
49 views

Smart contract's function work on testnet but don't work on private network

I have been created a smart contract (ERC20 implantation). The contract run great om testrpc, ropsten and rinkeby but i want to use it in a private network. When the contract deployed in the private ...
1
vote
1answer
303 views

Truffle contract deployment either exceeds block gas limit or out of gas

I've been having the same issue when I was trying to deploy a contract using truffle develop console. The contract is not extremely big but does initiate two other contracts when called a certain ...
1
vote
1answer
26 views

Why aren't costs “advertised” or at least knowable so funds aren't lost?

I'm admittedly new to all of this, but as I learn about the transaction model, it seems to be a confusing business model at the very least. I can understand that the price of gas fluctuates or can be ...
0
votes
2answers
67 views

Gas for view functions

I read in many places that view functions do not cost gas however that's not true because they cost gas for blockchain operations even if those do not change the state. Correct me if I am wrong For ...
0
votes
1answer
22 views

Minimum Gas limit and how can it be reduced?

Why does this minimum exist and what can we do to to reduce it further. This line of thought was spurred by this tweet from Vitalik: "And there are layer 2's without data availability tradeoffs or ...
2
votes
2answers
1k views

If view or pure function doesn't cost any gas, would they be abused/free ride?

So if I understand this correctly, view function only read data from ethereum and doesn't mutate any state and pure function doesn't even read data and they are intended for cases like return 1+1; If ...
0
votes
1answer
57 views

Deploy Smart Contract to Mainnet using Truffle

I was able to deploy the contract successfully to Kovan with gas limit 350000. When i set the gas in truffle.js to 500000 for deployment to Mainnet, i get the below error: Error: Transaction cost ...
4
votes
1answer
82 views

how accurate are gas estimates?

I am currently running some tests on ganache using web3.js connector. Most of my transactions run OK if I supply the same amount of gas that is suggested by web3.eth.estimateGas(), however, one of ...
4
votes
2answers
70 views

Is there a gas limit for view requests?

E.g. a function that just returns huge struct data. Is there any limit in data so that calling this function will not be possible? pragma solidity ^0.4.13; contract Project { struct Person { ...
2
votes
1answer
51 views

Out of gas error when reading from blockchain?

function getPosts(address[] subscriptions, uint[] subscriptionIndexes, uint count) public view returns (address[], bytes32[], bytes32[], uint[]) { address[] storage ...
0
votes
2answers
170 views

How to optimize the gasPrice and gas options in a contract send() function? [duplicate]

There are many questions and answers about estimating the amount of gas consumed. This question is about what to do with this estimate. What values should we actually provide to gas and gasPrice in ...
1
vote
1answer
43 views

How to caculate/estimate Gas Limit and Gas Price based on current state of the ether network?

Ethgasstation and similar websites estimate proper Gas Price based on current state of Ethereum network. Is there any way of using working with Geth/web3 to estimate proper Gas Price? and similar to ...
1
vote
0answers
18 views

How can i deploy contract with > 4.7 Mgas required on Ropsten?

I was able to deploy contract that requires more gas than default Ropsten block gas limit: https://ropsten.etherscan.io/tx/0x7c40cd2c539c03d110da8988641518ff6ff907a284f5074ed3d8517eb80b51f9 (5594037 > ...
1
vote
1answer
18 views

Loop with upper bound of iterations / loop variant

Is it possible somehow to create a loop that solidity will recognize as having an upper bound of iterations for gas estimations? Something like a loop variant in Eiffel (https://www.eiffel.org/doc/...
0
votes
2answers
30 views

How transaction with gas used ok 28k succeed for payable?

I'm trying to understand what I can do in fallback payable (I have read the docs and I know what I can't do for sure). Here is my contract: pragma solidity ^0.4.22; contract SmartMsgData { // ...
1
vote
1answer
85 views

Getting 'base fee exceeds gas limit' on a transaction which requires a small amount of gas

I have the following contract: pragma solidity ^0.4.24; contract MyContract { address public owner; bool public unlocked; constructor() public { owner = msg.sender; ...
1
vote
0answers
31 views

What's the point in the 'gas' parameter passed to function 'signTransaction'? [duplicate]

I am using web3.js v1 in order to sign and send transactions: async function signAndSend(transaction) { let options = { to : transaction._parent._address, data: transaction....
2
votes
1answer
45 views

question about gas limit when using oraclize

I'm using oraclize to fetch some data from the outside world. Oraclize calls the __callback method of my smart contract. For this call oraclize have to pay gas and there is a function to set the gas ...
0
votes
0answers
23 views

Get estimated gas and provide gas limit in web3.js [duplicate]

I have written a web3.js implementation in Node.js(server-side). The code below invokes a method of solidity contract that writes some value to blockchain: var Coursetro = CoursetroContract.at('...
0
votes
1answer
22 views

Sharding: Shards with different properties?

I am currently trying to get more into sharding but there's one question I haven't found any answer to yet. Could sharding introduce shards with different properties? For example could Shard A have ...
0
votes
0answers
36 views

Solidity code problem - it appears this transaction will fail, it may consume all the gas you provide

I'm having a problem with the Mist browser (version 10). I have deployed my contract but when I try to execute the fuctions within the contract it tells me it will fail as there it will consume all ...
0
votes
1answer
58 views

The contract code couldn't be stored when deploying to rinkeby

I was finally able to get some ether funded and geth/mist working and now i am getting the following error when attempting to deploy my contracts to the rinkeby test network. My project is based on ...
1
vote
1answer
55 views

The contract code couldn't be stored, please check your gas amount. Truffle, privatenet

I'm developing a smart contract over private blockchain using Truffle framework. Developed smart contract was running well, today we have been introduced one pure method as per requirement. Afterwords,...
1
vote
1answer
32 views

Why is the gas limit dropping in my private network once my local node connects?

I have a private network consisting of a "Ethereum proof-of-work consortium" on Azure and my development pc. In azure there are 2 mining nodes and one transaction node. All on Ubuntu virtual machines ...
0
votes
1answer
33 views

Am I setting my gas price and gas limit correctly?

web3.TransactionManager.DefaultGas = 210000; // Gas limit? web3.TransactionManager.DefaultGasPrice = 10 * 1000000000; // Gas Price? I have intended to set the gas price at 10Gwei.
0
votes
1answer
31 views

What is the unit of measurement used in GasPrice and GasLimit?

I did a check, in ethgasstation the current safeLow = 15GWei, which is equal = 15,000,000,000 wei However, when I issue eth.getBlock("latest") what I get was: > eth.getBlock("latest") { ...
1
vote
1answer
133 views

Exceeds block gas limit error to call view functions

With solidity view function, you can specific the amount of gas to use. My understand is since it is not a state changing transaction, all the gas cost is not charged for, and the client should be ...
0
votes
1answer
28 views

Do contract messages consume gas

In all sources it's stated that transactions cost gas. Since the distinction between a transaction and a message (some name it an internal transaction) is not so clear it couldn't be sure if messages ...
0
votes
2answers
62 views

How to deploy Ethereum smart contract that requires more than 4.7M of gas on Ropsten network?

My smart contract is really huge - it requires 5.6M of gas on deploy. I was able to deploy it once but smth has changed and i can't do it anymore. I've tried to run miner with higher block gas limit ...
1
vote
2answers
90 views

extended crowdsale smart contract not deploying to testnet

I'm trying to deploy the following crowdsale contract(extended from openzeppelin) to the ropsten test network using the remix IDE. The contracts compile but throws errors(Gas limit exceeded) when i ...
0
votes
2answers
173 views

“The transaction execution will likely fail. Do you want to force sending? VM Exception while processing transaction: out of gas”

When I want to deploy a contract using testRPC and remix, I receive the following error message: Gas estimation errored with the following message (see below). The transaction execution will ...
0
votes
2answers
254 views

Recommended Gas Limit for Single Transaction

Current mainnet gas limit per block is 8M (7.99), that of Ropsten is 9M (which is actually rather surprising as it was 4.7M two months ago and I did complain about it...). Given the above, what's the ...
0
votes
2answers
24 views

Analize gas usage and contract design

Suppose that I've the following contract code: pragma solidity ^0.4.23; contract pensCollection{ struct Pen{ uint productCode; address ownerAddress; } address public ...
0
votes
0answers
159 views

Error: Transaction:exited with an error (status 0) after consuming all gas

New to Ethereum and learning unit testing with Truffle. Here in smart contract function; function createAgreement( bytes32 _id, address _owner, string _fileHash, ...
1
vote
1answer
131 views

Web3 “Transaction ran out of gas” on method that creates a contract

I have the following Solidity code: pragma solidity ^0.4.17; contract Parent { function createChild() public { new Child(); } } contract Child { } Which I'm calling with web3 like ...
0
votes
0answers
9 views

Why is my gasLimit kept on decresing by itself?

I have setup a private blockchain which nobody is connecting to it except me and my team. From time to time I will get failure with error message "exceeds block gas limit". Googled and found that I ...
0
votes
1answer
224 views

Change a pending transaction's “Gas Limit” & “GWEI”

a noob question here! I'm using Metamask, I've sent a transaction to another wallet. I would like to increase the Gas Limit and reduce the gas price. Is this possible? If so, how? Thanks!