laconicd/docs/core/pending_state.md
Daniel Choi 71090323c0
docs: updates (#590)
* gas docs

* add period

* pending state docs

* format

* fix links

* add more to pendingstate docs

* add more to gas docs

* add hardspoon doc

* minor fix to pendingstate doc

* note on rlp encoding

* usecase doc

* update encoding doc

* gas docs

* hard spoon and reorder

* fix links

* encoding

* pending state

* final touches

* update intro

* use cases and resources

* typo

Co-authored-by: Federico Kunze <federico.kunze94@gmail.com>
Co-authored-by: Federico Kunze <31522760+fedekunze@users.noreply.github.com>
2020-11-12 20:42:24 +01:00

2.7 KiB

Pending State

Learn how Ethermint handles pending state queries. {synopsis}

Pre-requisite Readings

Ethermint vs Ethereum

In Ethereum, pending blocks are generated as they are queued for production by miners. These pending blocks include pending transactions that are picked out by miners, based on the highest reward paid in gas. This mechanism exists as block finality is not possible on the Ethereum network. Blocks are committed with probabilistic finality, which means that transactions and blocks become less likely to become reverted as more time (and blocks) passes.

Ethermint is designed quite differently on this front as there is no concept of a "pending state". Ethermint uses Tendermint Core BFT consensus which provides instant finality for transaction. For this reason, Etheremint does not require a pending state mechanism, as all (if not most) of the transactions will be committed to the next block (avg. block time on Cosmos chains is ~8s). However, this causes a few hiccups in terms of the Ethereum Web3-compatible queries that can be made to pending state.

Another significant difference with Ethereum, is that blocks are produced by validators or block producers, who include transactions from their local mempool into blocks in a first-in-first-out (FIFO) fashion. Transactions on Ethermint cannot be ordered or cherry picked out from the Tendermint node mempool.

Pending State Queries

Ethermint will make queries which will account for any unconfirmed transactions present in a node's transaction mempool. A pending state query made will be subjective and the query will be made on the target node's mempool. Thus, the pending state will not be the same for the same query to two different nodes.

RPC Calls on Pending Transactions

Next {hide}

Learn how to deploy a Solidity smart contract on Ethermint using Truffle {hide}