Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fatxpool: optimize per-transaction listeners #7071

Open
Tracked by #5472
michalkucharczyk opened this issue Jan 7, 2025 · 0 comments
Open
Tracked by #5472

fatxpool: optimize per-transaction listeners #7071

michalkucharczyk opened this issue Jan 7, 2025 · 0 comments
Assignees
Labels
T0-node This PR/Issue is related to the topic “node”.

Comments

@michalkucharczyk
Copy link
Contributor

michalkucharczyk commented Jan 7, 2025

During 2s block investigation it turned out that ForkAwareTxPool::register_listeners call takes significant amount of time.

As the current implementation was delivered in the sprit of "make it work, make it fast", the time for optimization has come. Here is the idea.

Instead of having a single listener for every transaction in every view, we need to use the single stream of aggregated events for every transaction in the single view.

Some implementation details / hints:

  • view provides the stream of tuples: (tx_hash, status), new stream needs to be added here, and should follow logic of dropped_by_limits_sink.
  • new task for multi_view_listener needs to be added. It will select: aggregated streams map, add/remove view msgs, per-tx msgs: invalidate,finalize,...,
  • external listener is a stream (could be unfold). Internally it selects: add/remove view, view event (block_hash,status), per-tx msgs: invalidated, drpoped, finalzied, broadcated) and implements required logic (which currently is implemneted in ExternalWatcherContext,
  • create_external_watcher adds a new channel (rx,tx) between an unfolded stream (external listener instance) and mvl task. New enum for messages is needed.

Brain dump pic attached for the record.
mvl-opimize-braindump

@michalkucharczyk michalkucharczyk self-assigned this Jan 7, 2025
@michalkucharczyk michalkucharczyk added the T0-node This PR/Issue is related to the topic “node”. label Jan 8, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T0-node This PR/Issue is related to the topic “node”.
Projects
None yet
Development

No branches or pull requests

1 participant