Originally posted on Riot by @zvezdin
Hello! I’m trying to implement timing constraints in a Tendermint application. The goal is to request nodes to send a specific transaction every, say, round hour and not before or later than that (with a few seconds tolerance). How can the consensus enforce that?
One option is to check the blocktime when receiving a block. However, this allows the block creator to censor transactions from specific nodes (not include them in a block and by the time they can get included in the next block, enough time will have passed to invalidate them). Also as I understand by the BFT-Time section in the documentation, the blocktime of a block is based on the median time of the commits for the previous block (essentially being the time of the previous block).
Another option is to include custom checks before block creation, when including a transaction in the mempool or distributing it to other peers. The node can check the system time when it received the transaction and reject the transaction if it is not received in the expected time. This is a source of non-determinism in the system, though. And as I understand, not every node in the network receives the transaction to include it in its mempool before block creation. A possible workaround is for validators to vote nil for blocks that include transactions that they have not received previously to validate their time for submission. Once a block is committed, no more timing checks will be done by regular nodes.
Is my understanding for all these concepts correct and how would you recommend to implement such functionality?