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: improve event listeners #5495

Closed
Tracked by #5472
michalkucharczyk opened this issue Aug 27, 2024 · 1 comment
Closed
Tracked by #5472

fatxpool: improve event listeners #5495

michalkucharczyk opened this issue Aug 27, 2024 · 1 comment
Assignees
Labels
T0-node This PR/Issue is related to the topic “node”.

Comments

@michalkucharczyk
Copy link
Contributor

michalkucharczyk commented Aug 27, 2024

Some improvements can be made to internal eventing system:

  • update_view: InBlock event could be sent via side-channel, instead of registering listener in view (in case transaction is already in the cloned view). This can simplify the code.
  • TxInMemPool::watched - this could be replaced with listener, TxMemPool::listener would become redundant.
  • optimization: view should communicate with MVL over the aggregated stream instead of per-transaction streams. This should greatly increase performance (e.g. registering per-tx listeners in new view is very costly now).
@michalkucharczyk
Copy link
Contributor Author

update_view: InBlock event could be sent via side-channel, instead of registering listener in view (in case transaction is already in the cloned view). This can simplify the code.

As long as we have old pool, we need to send events via listener. So no big gain here. Also aggregated stream reduces the overall cost of eventing (at least in maintain thread).

TxInMemPool::watched - this could be replaced with listener, TxMemPool::listener would become redundant.

I reviewed the code, and I don't consider this point to be valid. I think what we have today is well structed, moving listener will not improve existing codebase.

optimization: view should communicate with MVL over the aggregated stream instead of per-transaction streams. This should greatly increase performance (e.g. registering per-tx listeners in new view is very costly now).

This was valid point, and is addressed in dedicated issue: #7071

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
Status: Done
Development

No branches or pull requests

1 participant