Skip to content
This repository has been archived by the owner on Aug 2, 2022. It is now read-only.

Read modes : speculative, head, LIB #4196

Closed
moskvanaft opened this issue Jun 18, 2018 · 3 comments
Closed

Read modes : speculative, head, LIB #4196

moskvanaft opened this issue Jun 18, 2018 · 3 comments
Assignees
Milestone

Comments

@moskvanaft
Copy link
Contributor

No description provided.

@moskvanaft moskvanaft added this to the Version 1.1 milestone Jun 18, 2018
@moskvanaft moskvanaft self-assigned this Jun 18, 2018
moskvanaft added a commit that referenced this issue Jun 18, 2018
moskvanaft added a commit that referenced this issue Jun 18, 2018
moskvanaft added a commit that referenced this issue Jun 21, 2018
moskvanaft added a commit that referenced this issue Jun 25, 2018
moskvanaft added a commit that referenced this issue Jun 25, 2018
moskvanaft added a commit that referenced this issue Jun 25, 2018
moskvanaft added a commit that referenced this issue Jun 26, 2018
moskvanaft added a commit that referenced this issue Jun 27, 2018
moskvanaft added a commit that referenced this issue Jun 28, 2018
… block (they are different if read-mode=irreversible) #4196
moskvanaft added a commit that referenced this issue Jun 29, 2018
moskvanaft added a commit that referenced this issue Jul 2, 2018
@moskvanaft
Copy link
Contributor Author

moskvanaft commented Jul 3, 2018

For now irreversible mode doesn't work with bnet plugin (disallowed because of suspicion that they would not get along). It's going to be addressed in #4468

@abourget
Copy link
Contributor

What's the rationale behind these modes?

Is your Jira not sync'd with the public anymore? :)

@wanderingbort
Copy link
Contributor

Nodeos read-mode Settings

EOSIO provides a set of services and interfaces that enable contract developers to persist state across action, and consequently transaction, boundaries. (https://developers.eos.io/eosio-cpp/docs/db-api)
Contracts may use it for different purposes. For example, eosio.token contract keeps balances of all users in the database.

Each instance of nodeos keeps the database in memory, so contracts can read and write data and
nodeos provides access to this data over HTTP RPC API for reading the database.

However, at any given time there can be multiple correct ways to query that data:

  • speculative : this includes the side effects of unconfirmed transactions.
  • head : this only includes the side effects of transactions which have been included in the produced and signed blocks that are part of the best chain nodeos
  • irreversible : this only includes side effects of transactions which have been confirmed by the network as irreversible.

speculative read-mode

speculative

Clients (cleos and RPC API users) will see database state as of current head block plus changes made by all transactions known to this node but potentially not included in the chain (unconfirmed). This mode is low latency but fragile, since there is no guarantee that the transactions reflected in the state will be included in the chain OR that they will reflected in the same order the state implies.

This mode is the lowest latency mode, but also, the lowest consistency.

In this mode nodeos is able to execute transactions which have TaPOS pointing to any valid block in a fork considered to be the best fork by this node.

head read-mode

Clients (cleos and RPC API users) will see database state as of current head block of the chain. Since current head block is not yet irreversible and short-lived forks are possible, state read in this mode may become inaccurate if nodeos switches to a better fork.

This mode represents a good trade between highly consistent views of the data and latency.

In this mode nodeos is able to execute transactions which have TaPOS pointing to any valid block in a fork considered to be the best fork by this node.

irreversible read-mode

Clients (cleos and RPC API users) will see database state as of latest irreversible block (LIB). This state is guaranteed to be accurate as of the given LIB.

This mode has the strongest guarantee of consistency but the highest latency.

In this mode nodeos can only execute and relay transactions with TaPOS pointing to blocks before the LIB or to LIB itself.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants