The problem here is essentially the contradiction between deterministic execution and unpredictable participation. There are accordingly two distinct methods to solve it. One is to leave the execution indeterminately until the transaction is packed into blocks and executed by miners, which is adopted by account based blockchains like Ethereum. Another method is to make the random participation sort of predictable. For example, we can seperate the users’ request into different state shards, so that their actions are independent. Or we can seperate the state transition into submit period and commit period. We collect users’ request during the submit period, and generate the state transition in commit period. All the operations are on-chain, and trustless.
Although it’s not so obvious, CKB actually accepts Ethereum like state transition model. Users send their intentions instead of the consequences to the chain, and then the miners (or some aggregators) calculate the result then commit it to the chain. One possible trick to achieve this is to use open transaction. Let’s say a vote dApp, there is a global state cell manages the votes for all candidates, and users send transactions to vote them. User sends an open transaction with specific input cells (to stand for their voting power) and the restriction to the output cell’s typehash. The transaction doesn’t constrain on the output cell’s data, only on the verification logics. Some off-chain aggregator collects such otxs, combines them into one single transaction, then calculates the final result, and set it as the content of the output cell. The aggregator is decentralized and trustless, anyone can be the aggregator.