Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Flow paradigm applied to transaction processor and selection #1101

Open
Mikelle opened this issue Aug 17, 2021 · 0 comments
Open

Flow paradigm applied to transaction processor and selection #1101

Mikelle opened this issue Aug 17, 2021 · 0 comments

Comments

@Mikelle
Copy link
Contributor

Mikelle commented Aug 17, 2021

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

  1. We could verify transactions concurrently and add them to the following group.
  2. When group building will be finished, we can proceed to the next step and process txs.
  3. 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
  4. When processing and ZKI calculation will be finished, we can build a batch.

Steps to implement

  1. 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
  2. As the next step, we could make all verifications run concurrently too.
  3. Split tx processing and ZKI calculation
  4. 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

@Mikelle Mikelle added this to the v2.0.0-reviewed milestone Aug 17, 2021
@Mikelle Mikelle self-assigned this Aug 17, 2021
@Mikelle Mikelle added the Epic label Aug 23, 2021
@arnaubennassar arnaubennassar removed this from the v2.0.0-reviewed milestone Nov 11, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants