Questions tagged [gas-limit]

Question related to either the transaction or block gas limit.

Filter by
Sorted by
Tagged with
3
votes
1answer
15 views

Can I add an int32 to an int256?

I'm trying to reduce the storage size of my contracts by reducing the bytes required to store my int data types (among other things). Can I get the best practice for adding int256 and other smaller ...
0
votes
1answer
49 views

remix - gas limit exceeded, but contract is running on blockchain

i studying remix and ethereum, and create my local blockchain. and create contract with remix.the contract just print simple word. pragma solidity ^0.4.8; contract HelloWorld{ string public ...
0
votes
0answers
32 views

Gas estimation errored with the following message (see below). The transaction execution will likely fail

When I try to excute the deposit function it shows Gas estimation errored with the following message (see below). The transaction execution will likely fail. Do you want to force sending? execution ...
1
vote
1answer
26 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
1answer
135 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
18 views

Can I estimate the total gas limit of several dependent transactions?

Assume two dependent transactions A and B. Transaction B depends on transaction A and will fail if transaction A has failed. I would like to estimate the gas limit required for the success of both ...
0
votes
0answers
39 views

Insufficients funds to Deploy Contract on Test Network

Here are my files on github, https://github.com/ArtieLadie/gas_limit https://github.com/ArtieLadie/gas_limit/blob/master/deploy.js sets gas limit here, async function deployContract(web3, contract, ...
1
vote
1answer
20 views

My private ethereum block gas limit decrease when mining

I set 'genesis.json' like this. ... "gasLimit":"0x30479e80", ... It's 810,000,000 at decimal. But when I run the blockchain and start mining, the block gas limit decrease. I'm using Geth/v1.9.7-...
0
votes
1answer
53 views

Sending funds to a possible smart-contract

When sending funds to an Ethereum address, Should my wallet check in the blockchain whether the address is associated with a smart contract? In order to choose the gas limit automatically. If someone ...
0
votes
1answer
25 views

Size limit to number of items in a struct

If I loop over mapping into a struct the gas fee is very low. However, in trying to test its limits, the EVM often causes Remix to crash in creating edge cases, because I'm creating blocks of 50 new ...
0
votes
2answers
28 views

Internal contract-to-contract call

I am confused with the following sentence in the Solidity documentation: During the execution of the fallback function, the contract can only rely on the “gas stipend” it is passed (2300 gas) being ...
1
vote
1answer
18 views

Explanation for small variation in gasUsed while recursively deploying same contract

https://github.com/christianlundkvist/simple-multisig/blob/master/contracts/SimpleMultiSig.sol I'm deploying the above contract recursively and I find that the gasUsed varies by specifically 12 gas. ...
0
votes
2answers
53 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; ...
0
votes
1answer
40 views

ethers.js - estimating gas limit

Using the ethers.js library, how can I determine the gas limit when sending a transaction to a contract or deploying a new contract?
0
votes
2answers
26 views

handling block gas-limit in a large loop

I have a loop like this: struct User { string name; uint tokens; uint frozenTokens; bool isValid; } mapping(address => User) users; address[] public usersAddresses; function ...
0
votes
1answer
34 views

Defined GasLimit in genesis file and in web3j gasprovider

Im having issues when I try to implement a back end that generate smart-contract transaction calls using web3j. But I'm a lit confused with the gas limit concept. I have defined inside the genesis ...
6
votes
1answer
2k views

Gas limit of a contract method call

When we call a contract method, what will be the gas limit? Is there any other gas limit besides the block gas limit? If there are any others, can we manually set the gas limit when we call a method?...
2
votes
3answers
149 views

gasLimit 5000 on private Ethereum geth node

Problem: I've upgraded my geth node to the latest version (1.9.0-unstable). The block gasLimit of the node is fixed at 5000: eth.getBlock("latest").gasLimit 5000 When I try to send a transaction, I ...
0
votes
1answer
66 views

Locked ERC20 paid out as tx-fees to DAO holders

I'm creating a contract where people transact by using locked ERC20 tokens. For example - you'd have 500 of token A locked in the DAO contract. You decide to send 100 of token A to some other ...
1
vote
1answer
426 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 ...
0
votes
0answers
82 views

Returned error: gas required exceeds allowance (91135865401031) or always failing transaction

I am trying to deploy smart contract on private network and do transactions via nodejs script. This is my genesis block: { "config": { "chainId": 16, "homesteadBlock": 0, "...
0
votes
1answer
212 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 ...
1
vote
0answers
42 views

Store constants as non-256 bit fields

My contract has a lot of uint256 constant fields that are later used for various calculations. I am close to reaching the maximum allowed contract size and I am looking for optimizations. I see that ...
1
vote
0answers
20 views

How can we increase block gasLimit without reinitialiting the genesis block? [duplicate]

Is it possible to increase block gas limit without reinitializing the blockchain ?
0
votes
1answer
223 views

Can't invoke SC function: Error: gas required exceeds allowance or always failing transaction

I've deployed my smart contract to Rinkeby test net. The "addProject" function works fine. But when I try the "addProjectFile" function I got error. "Error: gas required exceeds allowance or ...
0
votes
1answer
25 views

Kovan contract creation gas limit behavior

I have a fairly large contract that I must create on Kovan network for testing. There is fairly weird behavior occurring when I am trying to create the said contract. Behavior being: whenever ...
0
votes
1answer
31 views

What are the parameters for the ideal gas limit?

I am new to writing smart contracts, in recent times I am having trouble in deploying the smart contracts couple of times so I need a solution for that. I am using the truffle most of the time so ...
0
votes
2answers
185 views

Finding gas to be used by a transaction

Is there a way to find the total gas that will be used by the transaction before a tx actually takes place? Does the gas used depend on the amount of tx size in kb?
1
vote
1answer
35 views

Does using a very high gas limit somehow get your transactions executed slower?

I'm executing transactions on mainnet with a NodeJS script: async function send(web3, transaction, destAddr, gasPrice, privateKey) { const options = { data : transaction.encodeABI(), ...
3
votes
1answer
152 views

Can someone verify this answer: gasLimit vs. minGasLimit

I would have thought that these are the upper and lower bounds of how much gas can be used in any one transaction. But the mainnet file has the same value for each of these. Can someone explain what ...
1
vote
1answer
221 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
186 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 ...
0
votes
1answer
171 views

change gasLimit parameter into the genesis.json file on azure priavte blockchain

I am trying to deploy a smart contract to an azure blockchain. The contract is deployed without errors but i can't submit transaction to the blockchain through this contract. I guess this is an issue ...
0
votes
1answer
149 views

Infinite gas estimate for almost all the functions. Is it normal?

When I deploy contract test net, it shows an error that gas limit exceeds: 3000000 What's the solution? Github Link to the smart contract. And is it normal to have the infinite gas estimate of ...
0
votes
1answer
137 views

Deploying Crowdsale in Ropsten Network givin Gas Limit issue

Below is the Code of My CrowdSale , which is giving The contract code couldn't be stored, please check your gas amount. pragma solidity ^0.4.18; import "./TorCoin.sol"; import "zeppelin-solidity/...
0
votes
1answer
273 views

infinite gas required of simple external function call

I have minimized the following solidity code generated in remix to demonstrate the issue. This code warns the test001.regester function requires infinite gas which obviously by the code cannot be. ...
0
votes
0answers
33 views

“Out of Gas” while transferring ethereum from account to contract

I am using ganache to create 10 ethereum accounts. I want to transfer ethereum from one account to a smart contract. I am doing this by writing two following smart contracts in solidity; pragma ...
1
vote
1answer
121 views

Can't call function from contract using web3.js due to gas issue

I'm building a smart contract and dapp using ganache and web3.js. In my smart contract I have a function (named "add_pilot") which gets 4 parameters and add them to a mapping. It looks like this: ...
0
votes
1answer
364 views

Why do my FAILED transactions get charged the max gas price?

I tried buying TEL on EtherDelta and had two failed transactions in a row, both charged at the max gas price, one after like 15 mins and the other instantly. How come I get charged for a failed ...
1
vote
1answer
20 views

divide ethers to current token holders only

My task is to divide the dividend sent by owner to the contract to the current token holders.The token holders can come later and redeem their pending amounts, the important point here is that, when a ...
0
votes
2answers
25 views

Does a transaction that consumes the block gas limit take an entire block by itself?

Does a transaction that requires the entire block gas limit to be executed (currently ~8M) take the entire block by itself? And if that's true, will that transaction take longer to get confirmed than ...
0
votes
2answers
133 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 ...
0
votes
2answers
710 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
1answer
17 views

When calling a contract from an other contract, what happends if the value of callgas argument is above availaible gas?

In such case, the value is replaced with available gas right ? Or Does an out of gas exception is thrown ?
1
vote
2answers
63 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
71 views

What should gas prices be for sending out tokens?

I constantly get failed transactions when sending out tokens like USDT using metamask. I have my gwei set at 10 and the gas limit at 21000. I even tried gas limit set to 51000 and it still fails. ...
0
votes
1answer
19 views

Get gas limit beforehand with Web3

I know that web3 exposes a function to estimate gas limit, but is it accurate when sending to a contract? AFAIK the amount of gas I'm gonna need if sending to a contract depends on the contract code, ...
0
votes
0answers
13 views

Can web3js accurately estimate a transaction that includes an external call?

Can web3js accurately estimate a transaction that includes an external call? For example, will it be accurate in estimating: (bool _success, bytes memory _response) = _to.call.value(_value)(_data); ...
3
votes
0answers
43 views

Does 'estimateGas' behave the same on Ganache and on mainnet?

I noticed that estimateGas behavior in Ganache has changed: In version 6.4.1, it throws an exception if exceeding the gas-limit. In version 6.5.1, it returns the estimation even if exceeding the gas-...
0
votes
0answers
29 views

Is gas limit constant for regular transfers? [duplicate]

Afaik the minimum amount of gas, required for a regular ETH transfer is 21000. Is 21000 specific to the protocol itself, or does it depend on the particular network? Does it depend on custom data, ...