Skip to main content

EVM & API differences

While the StateMesh blockchain node is implemented on top of go-ethereum (or geth), it has small differences due to its DAG-based asynchronous leaderless consensus.

In terms of programmability, the chain is similar to Ethereum. Both networks run the Ethereum Virtual Machine (EVM) to support smart contract functionality. This means that all programming languages, developer tooling and standards that target the EVM are relevant to StateMesh as well. Developers building on StateMesh can write smart contracts in Solidity, using their tooling of choice and take advantage of smart contract standards that have already been developed for Ethereum.

Differences

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

  • 10% of unspent gas gets spent as a disincentive to militate against excessive transaction gas limits
  • 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.
  • the protocol uses an asynchronous BFT Proof-of-Stake for consensus. This allows blocks to be created in 1 second compared to ~12+ seconds on Ethereum. In addition, all blocks are finalized immediately, so there is no need to wait for more than 1 block confirmation to ensure that a transaction won't be reverted.
  • retrieval of pending blocks is not supported, because StateMesh does not have this concept.

Solidity differences

The following Solidity global variables behave differently:

  • block.difficulty is always 0
  • block.gaslimit is always 0xFFFFFFFFFFFF (infinite)

JSON-RPC API differences

Pending blocks

Retrieval of pending blocks is not supported, because StateMesh does not have this concept.

Block Header fields

The following fields in the block header are different:

  • nonce is always 0
  • mixHash is always 0
  • sha3Uncles is always 0
  • mixHash is always 0
  • miner field is an undefined address
  • difficulty is always 0
  • extraData is always empty
  • gasLimit is always 0xFFFFFFFFFFFF (infinite)
  • receiptsRoot is always 0
  • timestampNano is a new field and returns the block's consensus time in UnixNano

Unavailable namespaces

The following namespaces are not available:

  • shh
  • db
  • bzz