Scheduler
Last updated
Last updated
The scheduler is responsible for allocating transactions, making optimal transaction execution plans, and managing resources available based on the execution strategy.
The scheduler first scans through all the transactions it has received from transaction pool service for their characteristics and then divides them into subsets called generations. The whole transaction execution process may comprise a number of generations. Smart contracts are presumed parallelizable until proven otherwise.
Different generations will be processed in a serial order. For better performance, the scheduler will try to put in as many parallelizable transactions as possible in a single generation. Each generation is further subdivided into multiple batches. Different transaction batches will be sent to different EUs for execution.
At the end of each block cycle, the scheduler will update its internal conflict database based on conflict information detected by the feedback from the Arbitrator. If two different smart contracts are found conflicting with another, the scheduler will avoid putting a them in a same generation in a future cycle.