iykyk-syn / unison

Consensus nodes performing in unison!
Apache License 2.0
29 stars 2 forks source link

poc: Batch randomizer #23

Closed abstraking closed 2 months ago

abstraking commented 2 months ago

We need a mechanism that produces dummy Batches with a configured throughput, e.g., 1mb/s of 256kb batches. In this example, we would create 4 batches of random data per second and submit it to BatchPool.

Ideally, this mechanism will have a backpressure if the system doesn't handle the load, so the production slows down.

The implementation (without backpressure) can be a simple ticker that generates D data every N seconds, splits it evenly across equal-size batches, and calls BatchPool Push for each batch in a separate goroutine. Those batches will later be picked up by Dag Loop for inclusion.