Open kostko opened 5 years ago
Now that #1749 introduced a commitment.Pool
which abstracts most of the discrepancy detection logic, I can imagine a smart mempool that uses it to determine when to trigger new consensus rounds. Of course it also needs to consider other factors like the presence of any non-roothash transactions and needs to make sure not to stall consensus.
Since Tendermint blindly schedules when blocks are proposed, the following can happen, causing unnecessary delay while processing batches:
Basically the first commitment causes a new Tendermint block to be proposed and executed, containing only the one transaction corresponding the the first roothash commit. The subsequent three commits that arrive just 80ms later are put into the next block and the whole roothash round is delayed by ~500ms.
Possible solutions:
develop
branch as Mempool is now an interface) which allows ABCI apps to emit some scheduling information from CheckTx based on which it could wait "a bit" before releasing any transactions. This seems much more complex and may be less effective (as the mempool can also contain a bunch of non-roothash transactions).If we decide to do this, I would be in favor of (1) as it keeps this functionality under our control and avoids the complexity of implementing (2).
In any case, these effects probably cannot be completely eliminated so as a mitigation we should make sure that: