0

Right now I'm iterating over a map (not a big_map) that would have at most 10,000 entries. I know big_map is recommended for a large number of entries, however, I'm testing the limitations of both approaches.

When the map reaches 10,000 entries, it costs to iterate it:
gas: 158403
total cost: 0.106882ꜩ
When the map only had 100 entries, it cost to iterate it:
gas: 4067
total cost: 0.090447ꜩ

At what point would this contract get "gas locked"? Is it when it reaches the following hard cap limits?

"hard_gas_limit_per_operation":"1040000",
"hard_gas_limit_per_block":"5200000"

On the main-net, could bakers reject transactions that use too much gas because the transaction fee doesn't scale in relation to the gas fees?

2 Answers 2

1

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 will contribute to the total gas of the transaction.

Could bakers reject transactions that use too much gas because the transaction fee doesn't scale in relation to the gas fees?

Bakers can ignore operations, but it does not invalidate them. The operations can still be included in future blocks by other bakers.

2
  • 1
    Got it. If the consumed_gas never reaches the hard_gas_limit_per_operation, then the entrypoint will not be gas locked. Are there any other downsides to having high gas consumption that doesn't exceed the hard_gas_limit_per_operation? I was expecting the fees to increase like on Ethereum, but I was surprised that they didn't.
    – JJJ
    Feb 12 at 22:45
  • 1
2

Being gas locked means that some functions of the smart contract are not possible within the gas limit per operation.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.