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

Internal: TX processing is now event-based #492

Merged
merged 4 commits into from
Nov 2, 2023

Conversation

odesenfans
Copy link
Contributor

Problem: the pending TX processor uses a polling loop to determine which transactions must be processed. This leads to some latency when adding a new transaction when there is no currently pending transaction as the task sleeps while waiting for new transactions.

Solution: make the TX processor event-based by using a RabbitMQ exchange

  • message queue. Upon receiving a new transaction from on-chain, we now publish a RabbitMQ message containing the hash of the transaction. The processor can then find the transaction in the DB.

We still store an entry in the pending TXs table for monitoring purposes.

Problem: the pending TX processor uses a polling loop to determine which
transactions must be processed. This leads to some latency when adding a
new transaction when there is no currently pending transaction as the
task sleeps while waiting for new transactions.

Solution: make the TX processor event-based by using a RabbitMQ exchange
+ message queue. Upon receiving a new transaction from on-chain, we now
publish a RabbitMQ message containing the hash of the transaction. The
processor can then find the transaction in the DB.

We still store an entry in the pending TXs table for monitoring purposes.
@odesenfans odesenfans force-pushed the od-event-based-tx-processor branch from 61691ac to befa366 Compare November 2, 2023 11:49
@odesenfans odesenfans merged commit 8642d31 into dev Nov 2, 2023
4 checks passed
@odesenfans odesenfans deleted the od-event-based-tx-processor branch November 2, 2023 13:17
hoh pushed a commit that referenced this pull request Dec 8, 2023
Problem: the pending TX processor uses a polling loop to determine which
transactions must be processed. This leads to some latency when adding a
new transaction when there is no currently pending transaction as the
task sleeps while waiting for new transactions.

Solution: make the TX processor event-based by using a RabbitMQ exchange
+ message queue. Upon receiving a new transaction from on-chain, we now
publish a RabbitMQ message containing the hash of the transaction. The
processor can then find the transaction in the DB. The RabbitMQ message is only
used as a hint that something must be done. The TX processor still looks for pending
TXs in the database.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant