github.com/line/ostracon@v1.0.10-0.20230328032236-7f20145f065d/spec/abci/apps.md (about)

     1  # Applications
     2  
     3  Please ensure you've first read the spec for [CometBFT Applications](https://github.com/cometbft/cometbft/blob/v0.34.x/spec/abci/apps.md). Here only defines the difference between CometBFT.
     4  
     5  ## Connection State
     6  
     7  ### Commit
     8  
     9  Ostracon fixes [CometBFT Commit](https://github.com/cometbft/cometbft/blob/v0.34.x/spec/abci/apps.md#commit).
    10  
    11  In CometBFT、`Commit` assumes mempool is locked. It needs this assumption only for connection states sync. However `Commit` usually takes long time (about 500ms~1s), mempool is locked too long. Additionally, connection state sync only needs to be performed between `Commit` and rechecks. `BeginRecheckTx` and `EndRecheckTx` are added to notify the application of the start and end of the recheck so that connection states sync can be performed at the appropriate time.
    12  
    13  The PR [#160](https://github.com/line/ostracon/pull/160) contains this change.
    14  
    15  ### BeginRecheckTx
    16  
    17  Before `BeginRecheckTx` is called, Ostracon locks and flushes the mempool so that no new messages will be received on the mempool connection. This provides an opportunity to safely update all four connection states to the latest committed state at once.
    18  
    19  After `EndRecheckTx` is called, it unlocks the mempool.
    20  
    21  ### Mempool Connection
    22  
    23  Ostracon fixes [CometBFT Mempool Connection](https://github.com/cometbft/cometbft/blob/v0.34.x/spec/abci/apps.md#mempool-connection).
    24  
    25  Ostracon calls `Commit` without locking the mempool connection. After `Commit`, Ostracon locks the mempool.
    26  
    27  After `BeginRecheckTx`, CheckTx is run again on all transactions that remain in the node's local mempool after filtering those included in the block.
    28  
    29  Finally, after `EndRecheckTx`, Ostracon will unlock
    30  the mempool connection. New transactions are once again able to be processed through CheckTx.