Currently, transactions in tx processor got processed one by one. The idea is to make tx processor process transactions concurrently, using flow programming, for example, make transaction verification from step by step to verify each condition in separate goroutine
Implementation
Tx processor and tx selector refactor
Currently transactions are verified and processed sequentially one by one. So the idea is to make this process run concurrently using pipeline pattern.
New algorithm
We could verify transactions concurrently and add them to the following group.
When group building will be finished, we can proceed to the next step and process txs.
To process txs we have to divide ZKI calculation from the processing. Currently, it's strongly coupled in the code, but the calculation is not reliant on the tx processing
When processing and ZKI calculation will be finished, we can build a batch.
Steps to implement
Make process of verification and group setting run concurrently. For every group of txs we can define channel and add txs to them.
Note: atomic group txs are strongly coupled to a sequential process. Have to rethink this
As the next step, we could make all verifications run concurrently too.
Split tx processing and ZKI calculation
Make the process of processing txs and zki calculation run concurrently.
Note: as the next step we could try not to wait until all transactions are selected, but start to process selected tx right away
Rationale
Currently, transactions in tx processor got processed one by one. The idea is to make tx processor process transactions concurrently, using flow programming, for example, make transaction verification from step by step to verify each condition in separate goroutine
Implementation
Tx processor and tx selector refactor
Currently transactions are verified and processed sequentially one by one. So the idea is to make this process run concurrently using pipeline pattern.
New algorithm
Steps to implement