Hot answers tagged

15 votes
Accepted

How to calculate gas and storage for an operation?

There's no other way, you have to simulate what the operation does if you want to estimate this value, and this is exactly what a dry run does. You could try to reimplement it outside of a node, but ...
user avatar
  • 4,409
9 votes
Accepted

Fees in proto 003?

The information is available from the official documentation in the « Baker » section https://tezos.gitlab.io/mainnet/protocols/003_PsddFKi3.html The basic formula specifies that fees are now ...
user avatar
  • 6,006
8 votes

What is the difference between fee and gaslimit?

In Tezos, the fee is independant from the gas : whatever the gas consumed, you always pay the full fee. However, bakers will probably compute the ratio fee/gas, and prefer transactions with higher ...
user avatar
  • 3,278
8 votes

What is gas on the Tezos network?

Gas represents computational cost related to a transaction, e.g. gas for basic transactions are about 10,000 units, where as more costly transactions that invoke smart contracts can cost a lot more. ...
user avatar
7 votes
Accepted

Relative gas cost of map vs bigmap

Let's find out. We start by running a sandbox node. We'll originate two contracts, one for maps, the other for bigmap. parameter (pair address nat); storage (big_map address nat); code { UNPAIR; ...
user avatar
  • 4,409
7 votes

Gas costs types in Michelson

There are eight types of costs: 1 Reading cost 2 Deserialization cost 3 Parsing cost 4 Type comparison cost 5 Interpreter cost 6 Unparsing cost 7 Serialization cost 8 Writng ...
user avatar
  • 6,006
5 votes

What is the difference between fee and gaslimit?

The full fee is always paid for every transactions - the gas limit is just that, a cap on the amount of gas a given transaction can consume. A baker can be guaranteed that they are paid at least fee/...
user avatar
4 votes
Accepted

Gas consumption in a chain of internal transfers

You cannot exceed the hard_gas_limit_per_operation = 400000. It will probably be increased in future protocols, though (see e.g. the "Athens" proposals). Internal transfers can use up a lot of gas. ...
user avatar
  • 2,501
4 votes

How to calculate price of gas

In Tezos, gas does not have a monetary translation. It does not "cost" you anything to execute a contract with 10 gas vs 1M gas. Gas is simply an internal limitation to prevent contracts from running ...
user avatar
  • 3,364
3 votes

Is Tezos blockchain vulnerable to "frontrunning"?

Choosing the order in which operations are applied is a privilege of the baker. So yes, frontrunning is possible on Tezos and can either be done by setting high fees (the default baker strategy is to ...
user avatar
3 votes

How to calculate price of gas

After asking, there is no equivalent of a gas price in Tezos. You pay a transaction fee, and this fee should include everything. Doing some stats on the fees you may get an upper-bound on the gas ...
user avatar
  • 31
3 votes
Accepted

Michelson contract files - spaces, new lines and comments

No, whitespace and comments do not affect storage or gas costs. The syntax of Michelson code and values is called "Micheline". The concrete syntax (the way you actually write Micheline expressions ...
user avatar
  • 2,501
3 votes

Michelson gas cost optimizations: any techniques, patterns and rules of thumb

You may find this article useful: https://medium.com/tqtezos/how-to-minimize-transaction-costs-of-tezos-smart-contracts-9962347faf64
user avatar
3 votes

Translating gas and storage units to XTZ

Storage price is 0.25tez per kilobyte. Gas units are not directly charged, see https://forum.tezosagora.org/t/psa-do-not-quote-gas-cost-in-tez/1618.
user avatar
3 votes

How do baking node choose the transactions from the mempool

A baker is free to include whatever operations it wants, as long as they are valid. By default a baker want to create the block that generate the highest amount of fees (most bakers will also have a ...
user avatar
  • 1,320
2 votes

Fees in proto 003?

The fees have been updated for proto004 (athens) please have a look here going forward https://github.com/keefertaylor/TezosKit/blob/master/docs/AthensProtocolFees.md
user avatar
  • 6,006
2 votes
Accepted

Michelson gas cost optimizations: any techniques, patterns and rules of thumb

What are you doing to reduce gas costs? The first thing to do is to do algorithmic optimisation, without worrying about Michelson's own constraints. Then, to make additional savings, lower level ...
user avatar
2 votes
Accepted

Can a FAILWITH error be caused by improper gas_limit or storage_limit?

The only thing that can trigger a FAILWITH error is the execution of the FAILWITH instruction. You might however get a gas exhaustion error during the interpretation of a FAILWITH instruction, this ...
user avatar
2 votes

Can't see 35% gas optimization on protocol 009

Florence gas optimizations are only about the Michelson interpreter. During a call to a smart contract, gas is charged for the following things: checking the signature of the operation account ...
user avatar
2 votes

When does a contract get gas locked?

Being gas locked means that some functions of the smart contract are not possible within the gas limit per operation.
user avatar
1 vote
Accepted

When does a contract get gas locked?

When the contract transaction reaches the hard_gas_limit_per_operation limit, it means that the given entry point is gas-locked. Both the storage & code deserialization and entry point execution ...
user avatar
1 vote

Does Tezos largely adopt the gas model from Ethereum?

There are gas caps per operation, and an overall gas cap per block. Each 'step' within a contract has a gas cost, so you can pre-calculate (in a sense) how much gas it could take. The cost of these ...
user avatar
  • 3,364
1 vote
Accepted

gas_exhausted.operation when sending max balance

The answer given by Raphael Cauderlier in the gitlab issue helped solve the issue: "I have tried to reproduce this in sandbox (well, actually in mockup client); I think your problem is that 100 ...
user avatar
1 vote

Increase gas_limit for tz1 to tz1 transfers

You can set the gas limit to whatever you want. Say 20000. Tezos will only consume however much it needs. If it only needs 5000, then it'll only consume 5000, not 20000.
user avatar
  • 3,364
1 vote

How to calculate gas and storage for an operation?

According to the official documentation available here you can get the gas and storage cost of the operation you plan to broadcast to the network by passing the parameter --dry-run to the client node ...
user avatar
  • 6,006

Only top scored, non community-wiki answers of a minimum length are eligible