|
@ -1,4 +1,4 @@ |
|
|
# ABCI Applications |
|
|
|
|
|
|
|
|
# Applications |
|
|
|
|
|
|
|
|
Please ensure you've first read the spec for [ABCI Methods and Types](abci.md) |
|
|
Please ensure you've first read the spec for [ABCI Methods and Types](abci.md) |
|
|
|
|
|
|
|
@ -18,7 +18,7 @@ Here we cover the following components of ABCI applications: |
|
|
|
|
|
|
|
|
Since Tendermint maintains multiple concurrent ABCI connections, it is typical |
|
|
Since Tendermint maintains multiple concurrent ABCI connections, it is typical |
|
|
for an application to maintain a distinct state for each, and for the states to |
|
|
for an application to maintain a distinct state for each, and for the states to |
|
|
be sycnronized during `Commit`. |
|
|
|
|
|
|
|
|
be synchronized during `Commit`. |
|
|
|
|
|
|
|
|
### Commit |
|
|
### Commit |
|
|
|
|
|
|
|
@ -41,7 +41,7 @@ the working state for block execution. It should be updated by the calls to |
|
|
disk as the "latest committed state" during `Commit`. |
|
|
disk as the "latest committed state" during `Commit`. |
|
|
|
|
|
|
|
|
Updates made to the DeliverTxState by each method call must be readable by each subsequent method - |
|
|
Updates made to the DeliverTxState by each method call must be readable by each subsequent method - |
|
|
ie. the updates are linearizeable. |
|
|
|
|
|
|
|
|
ie. the updates are linearizable. |
|
|
|
|
|
|
|
|
### Mempool Connection |
|
|
### Mempool Connection |
|
|
|
|
|
|
|
@ -73,10 +73,11 @@ block full of invalid transactions if it wants. |
|
|
|
|
|
|
|
|
### Info Connection |
|
|
### Info Connection |
|
|
|
|
|
|
|
|
The Mempool Connection should maintain a `QueryState` for answering queries from the user, |
|
|
|
|
|
and for initialization when Tendermint first starts up. |
|
|
|
|
|
|
|
|
The Info Connection should maintain a `QueryState` for answering queries from the user, |
|
|
|
|
|
and for initialization when Tendermint first starts up (both described further |
|
|
|
|
|
below). |
|
|
It should always contain the latest committed state associated with the |
|
|
It should always contain the latest committed state associated with the |
|
|
latest commited block. |
|
|
|
|
|
|
|
|
latest committed block. |
|
|
|
|
|
|
|
|
QueryState should be set to the latest `DeliverTxState` at the end of every `Commit`, |
|
|
QueryState should be set to the latest `DeliverTxState` at the end of every `Commit`, |
|
|
ie. after the full block has been processed and the state committed to disk. |
|
|
ie. after the full block has been processed and the state committed to disk. |
|
@ -97,7 +98,7 @@ though see issues |
|
|
[#2310](https://github.com/tendermint/tendermint/issues/2310) for how this may |
|
|
[#2310](https://github.com/tendermint/tendermint/issues/2310) for how this may |
|
|
change. |
|
|
change. |
|
|
|
|
|
|
|
|
## CheckTx |
|
|
|
|
|
|
|
|
### CheckTx |
|
|
|
|
|
|
|
|
If `Code != 0`, it will be rejected from the mempool and hence |
|
|
If `Code != 0`, it will be rejected from the mempool and hence |
|
|
not broadcasted to other peers and not included in a proposal block. |
|
|
not broadcasted to other peers and not included in a proposal block. |
|
@ -108,7 +109,7 @@ semantically meaningless to Tendermint. |
|
|
`Tags` include any tags for the execution, though since the transaction has not |
|
|
`Tags` include any tags for the execution, though since the transaction has not |
|
|
been committed yet, they are effectively ignored by Tendermint. |
|
|
been committed yet, they are effectively ignored by Tendermint. |
|
|
|
|
|
|
|
|
## DeliverTx |
|
|
|
|
|
|
|
|
### DeliverTx |
|
|
|
|
|
|
|
|
If DeliverTx returns `Code != 0`, the transaction will be considered invalid, |
|
|
If DeliverTx returns `Code != 0`, the transaction will be considered invalid, |
|
|
though it is still included in the block. |
|
|
though it is still included in the block. |
|
@ -217,7 +218,7 @@ storeBlockHeight = height of the last block Tendermint saw a commit for |
|
|
stateBlockHeight = height of the last block for which Tendermint completed all |
|
|
stateBlockHeight = height of the last block for which Tendermint completed all |
|
|
block processing and saved all ABCI results to disk |
|
|
block processing and saved all ABCI results to disk |
|
|
appBlockHeight = height of the last block for which ABCI app succesfully |
|
|
appBlockHeight = height of the last block for which ABCI app succesfully |
|
|
completely Commit |
|
|
|
|
|
|
|
|
completed Commit |
|
|
``` |
|
|
``` |
|
|
|
|
|
|
|
|
Note we always have `storeBlockHeight >= stateBlockHeight` and `storeBlockHeight >= appBlockHeight` |
|
|
Note we always have `storeBlockHeight >= stateBlockHeight` and `storeBlockHeight >= appBlockHeight` |
|
@ -225,7 +226,7 @@ Note also we never call Commit on an ABCI app twice for the same height. |
|
|
|
|
|
|
|
|
The procedure is as follows. |
|
|
The procedure is as follows. |
|
|
|
|
|
|
|
|
First, some simeple start conditions: |
|
|
|
|
|
|
|
|
First, some simple start conditions: |
|
|
|
|
|
|
|
|
If `appBlockHeight == 0`, then call InitChain. |
|
|
If `appBlockHeight == 0`, then call InitChain. |
|
|
|
|
|
|
|
|