rollmint icon indicating copy to clipboard operation
rollmint copied to clipboard

Lazy Aggregator: remaining transactions in mempool

Open S1nus opened this issue 1 year ago • 2 comments

When in lazy mode, centralized aggregators will build a block 1 second after transactions become available in the mempool. If transactions remain in the mempool after block-building is complete, those transactions will sit there until mempool.TxsAvailable is triggered again, by an incoming transaction.

Previously, Executor would notify BlockManager if transactions remained after building a block, however that was removed to reduce complexity.

If this becomes an annoyance, refer to this issue when restoring the fix.

S1nus avatar Mar 14 '23 19:03 S1nus

cc: @S1nus

Manav-Aggarwal avatar Sep 12 '23 16:09 Manav-Aggarwal

After the 1 second timer in lazy sequencing, transactions remaining in the mempool will stay pending in there until the lazy sequencer is awakened by a new transaction from a user. One solution is for the Executor to signal the BlockManager to make and publish another block, if transactions remain in the pool after building the block.

Create a channel in the Manager, pass it into NewBlockExecutor. Have the Executor signal the channel if transactions remain in the mempool following ReapMaxBytesMaxGas, and immediately build another block.

However, this issue will only arise if the rollup is lazy-sequenced, and simultaneously busy enough for lots of transactions to arrive in the 1 second window, but not busy enough for inflow of transactions to keep the pipes clean. It doesn't seem to be a likely scenario, so one option is to leave it be unless it becomes a problem in production.

S1nus avatar Jan 05 '24 17:01 S1nus

After the 1 second timer in lazy sequencing, transactions remaining in the mempool will stay pending in there until the lazy sequencer is awakened by a new transaction from a user. One solution is for the Executor to signal the BlockManager to make and publish another block, if transactions remain in the pool after building the block.

Create a channel in the Manager, pass it into NewBlockExecutor. Have the Executor signal the channel if transactions remain in the mempool following ReapMaxBytesMaxGas, and immediately build another block.

However, this issue will only arise if the rollup is lazy-sequenced, and simultaneously busy enough for lots of transactions to arrive in the 1 second window, but not busy enough for inflow of transactions to keep the pipes clean. It doesn't seem to be a likely scenario, so one option is to leave it be unless it becomes a problem in production.

#1800 refactors the window to be 10% of the block time and maybe be configurable in the future so the 1 second is not hard coded any more. The remaining edge case is an optimization that can be revisited in the future, closing for now.

tuxcanfly avatar Aug 19 '24 15:08 tuxcanfly