I see from https://eosnetworkmonitor.io/ (or https://eosmonitor.io/) that the difference of current block height and irreversible block height is around 330. But in my understanding the max difference of them should be 180 since 2/3+1(15) BPs confirming can make a block irreversible. So why is reality different from theory?
Last irreversible block (LIB) is the way of providing BFT finality assuming at least 2/3+1 honest producers. However, a single confirmation from a BP is not sufficient proof to contribute to making an irreversible block--this would mean that when the last of the 2/3+1 BPs signs the block, it's immediately irreversible. However, by the time the other (honest) BPs are informed about this, there is a chance that they may sign a different LIB on a different fork because of imperfect network connection and fewer than 1/3 byzantine producers. This would make finality not guaranteed under BFT requirements.
Therefore, the algorithm for LIB consists of a pre-commitment phase and a commitment phase. In other words, the first 2/3+1 BPs sign for a proposed LIB, but then the 2/3+1 BPs have to sign once again to acknowledge that the proposed LIB was signed by a supermajority and it can now be made irreversible safely.
Thus, as an upper bound, we'd need
2 x (2/3 + 1) = 4/3 + 2 confirmations. There are 21 BPs, and each BP creates 12 blocks, so we need
(21 * 4/3 + 2) * 12 = 360 blocks (or
360 x 0.5s = 180 seconds), which is what you're seeing on the explorers you mentioned.
Note that this delay can be theoretically reduced to a few seconds if BPs communicate both commitments for current round and pre-commitments for next round at the same time rather than inferring commitments based on block headers at a later time. This, however, requires additional computational and network resources, and it is not yet implemented.
The algorithm as described by Dan is as follows:
- Propose block
- All participants acknowledge block (pre-commitment)
- All participants acknowledge when ⅔+ have sent them pre-commitments (commitment)
- A block is final once a node has received ⅔+ commitments
- Unanimous agreement on finality is guaranteed unless ⅓+ are bad and evidence of bad behavior is available to all
I see many cryptocurrency exchanges like Huobi and Binance credit EOS deposits to a client’s account after only one confirmation.
Yes, I assume those exchanges may be willingly accepting the unquantified risk associated with accepting those transactions, or they believe the risk is insignificant. Given that those exchanges are often listing PoW coins that can be 51% attacked for a cost lower than $1,000/hour in hash power renting, I would assume that either their risk tolerance is quite high or their legal agreements are designed to share liabilities with their users in exchange for better UX. Further, Dan often reassures users that the "probability that a produced block will reach finality is already 99.999% which means that the average user gets near-certain finality in under a second." (source), which may reassure exchanges, but I'm not aware of any compelling public attempt of supporting that number despite existing in the whitepaper in a similar form as well. Perhaps they adjust their confirmation times if the value deposited is high enough to present a notable risk if it were reverted?
There is a similar discussion here.