Questions tagged [gas-limit]

Question related to either the transaction or block gas limit.

Filter by
Sorted by
Tagged with
1
vote
0answers
202 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 ...
3
votes
0answers
214 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
26 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
74 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
832 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
88 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
2k 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
33 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 ...
1
vote
2answers
575 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
2answers
393 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 ...
5
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
665 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
370 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
276 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
158 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 ...
2
votes
2answers
886 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 ...
2
votes
1answer
507 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
44 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
40 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
41 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
1k 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
55 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
101 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
1answer
45 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
1answer
119 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
96 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
114 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
199 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
204 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") { ...
2
votes
1answer
268 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
76 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
299 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
127 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
1k 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
1k 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 ...
1
vote
2answers
96 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
1answer
1k 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, ...
2
votes
1answer
421 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
1answer
830 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!
4
votes
2answers
557 views

Why do miners not always “vote” to increase the block gas limit?

Miners can increase/decrease the block gas limit. I read that they can increase/decrease for about 0.01% per block. Why do miners not always want to increase the block limit? This would lead in more ...
0
votes
1answer
599 views

Clarification on Ethereum gas limit

I know this one has been asked many times before and I think I get it, but I just need a little more clarification. At the moment, https://ethgasstation.info shows the following gas prices Safe Low ...
0
votes
1answer
70 views

Reverted tx on Ropsten but gas limit not reached

This is a timed crowed sale contract https://ropsten.etherscan.io/tx/0xaa3fa69a32060ad578cb9bc2a94fcc4cf7109f4e743f54c527c18f764f634ebb Error encountered, bailing. Network state unknown. Review ...
0
votes
1answer
137 views

Non deterministic gas usage of the same function

Environment Truffle v4.1.8 node 10.0.0 pragma solidity ^0.4.21; Issue I'm calling the claimRefund function on my smart contract using metamask. When calling the function with 37081 gas limit at 20 ...
2
votes
1answer
62 views

How does ether transfer processed [duplicate]

I want to understand deeply how ether transfer processed and how 21000 of gas determined. Is this a simple constant fee of the transfer transaction or ether transfer transaction is the some predefined ...
5
votes
1answer
2k views

Why is there block gas limit?

Why is there block gas limit? Should it just be the sum of gas limit used by each transactions inside the block? Why do we need an extra field for it instead of calculate it?
0
votes
1answer
239 views

Increase gas limit to allow larget contracts to be deployed

I'm working on a private blockchain and I found out that I cannot deploy a contract larger than 34Kb which is pretty limiting for me. For comparision, cryptokitties are 40-47Kb so I cannot even deploy ...
2
votes
2answers
583 views

Price of gas from https://ethgasstation.info/

The website https://ethgasstation.info/ contains a lot of information regarding the price of gas and this is confusing. My question is: what piece of information from the website should I use to ...
1
vote
1answer
32 views

Do Units of Gas Exist that are not Integers?

What are the units of gas? Is it measured in integers or can be any real number?
0
votes
1answer
48 views

Can anyone tell me how I can improve gas requirement?

Below is my smart contract. Remix gives warnings on each of the following functions: Gas requirement of function MedicalRecord.addNote(bytes32,bytes32) high: infinite. Gas requirement of function ...
1
vote
3answers
2k views

Truffle - test - how to get more than 10 accounts?

I want to test gas limits of the block. Currently in my tests: console.log(accounts); console.log(accounts.length); I have 10 accounts, what to do if I want more? Related: https://github.com/...