Skip to content
Egor Lysenko edited this page Mar 5, 2022 · 3 revisions

EVM

EVM in Opera works the same way as in Ethereum with the following exceptions:

  • 10% of unspent gas gets spent as a disincentive to militate against excessive transaction gas limits (see examples below) [^1]
  • Transactions in blocks aren't necessarily sorted by gas price. Even though transactions in each event and in the txpool are sorted by gas price, events are sorted by their topological ordering in the DAG. A new block includes transactions from multiple confirmed events in that topological order. [^2]
  • Berlin and London upgrades are supported only in public testnet but not mainnet yet.

[^1] The disincentive is required because Fantom is leaderless decentralized aBFT and blocks are not known in advance to a validator (unlike Ethereum miner) until blocks are created from confirmed events. There is no single proposer who originated transactions for a block and so validator doesn't know in advance how much gas will be spent by a transaction, this is different from Ethereum and so adjustments were made to address this issue. The penalty (10% charge of unspent gas) is introduced to avoid many of such cases.

[^2] This is due to the usage of our Lachesis -- a DAG aBFT consensus algorithm.

Examples of penalty for excessive transaction gas limit

Case with perfect gas limit:

  • Transaction gas limit is 500000, and it used 500000 for its execution. Final gas used is 500000. Penalty is 0%.

Case with normal gas limit:

  • Transaction gas limit is 500000, and it used 490000 for its execution. Final gas used is 490000+(500000−490000)×0,1 = 491000. Penalty is 0.2%.

Case with excessive gas limit:

  • Transaction gas limit is 500000, and it used 21000 for its execution. Final gas used is 21000+(500000−21000)×0,1 = 68900. Penalty is 228%.

The gas limit returned by MetaMask is sometimes much larger than needed for a transaction. It could be due to the estimate from the application API that connect to MetaMask, so you'd better to double check your transaction's requirement. To avoid penalty for excessive gas limit, make sure you specify a suitable gas limit amount.

Clone this wiki locally