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

Move subscription notification logic from the TxPool to the GraphQL service #1659

Closed
xgreenx opened this issue Feb 12, 2024 · 0 comments · Fixed by #1723
Closed

Move subscription notification logic from the TxPool to the GraphQL service #1659

xgreenx opened this issue Feb 12, 2024 · 0 comments · Fixed by #1723
Assignees
Labels
bug Something isn't working tech-debt The issue is to improve the current code and make it more clear/generic/reusable/pretty/avoidable.

Comments

@xgreenx
Copy link
Collaborator

xgreenx commented Feb 12, 2024

In the current codebase, the TxPool service handles subscriptions for the transaction statuses. It is expected since the TxPool knows when a transaction is removed from it. But it leads to race conditions with GraphQL of chain workers. Sometimes, the user may receive a notification about the transaction when the GraphQL off-chain database is not updated.

During this task, we need to either move the subscription logic from the TxPool to the GraphQL service or await the processing of the transaction by the GraphQL off-chain worker.

@xgreenx xgreenx added tech-debt The issue is to improve the current code and make it more clear/generic/reusable/pretty/avoidable. bug Something isn't working labels Feb 12, 2024
xgreenx added a commit that referenced this issue Feb 12, 2024
Example of the failed CI
https://github.com/FuelLabs/fuel-core/actions/runs/7865306004/job/21471566710?pr=1656

The change moves receipts into the `TransationStatus` to avoid requests
to the database. The `TxPool` directly listens for blocks and
transaction statuses to notify the user via subscription. But when it
notifies the users, the off-chain database can still be outdated,
leading to empty receipts.

This PR fixes the race condition for the receipts. However, the problem
still exists for the end user if they want to fetch some updated
information from the off-chain database. I created a separate issue to
track it: #1659.

It is the fix for the #1656
@xgreenx xgreenx self-assigned this Mar 4, 2024
crypto523 pushed a commit to crypto523/fuel-core that referenced this issue Oct 7, 2024
Example of the failed CI
https://github.com/FuelLabs/fuel-core/actions/runs/7865306004/job/21471566710?pr=1656

The change moves receipts into the `TransationStatus` to avoid requests
to the database. The `TxPool` directly listens for blocks and
transaction statuses to notify the user via subscription. But when it
notifies the users, the off-chain database can still be outdated,
leading to empty receipts.

This PR fixes the race condition for the receipts. However, the problem
still exists for the end user if they want to fetch some updated
information from the off-chain database. I created a separate issue to
track it: FuelLabs/fuel-core#1659.

It is the fix for the FuelLabs/fuel-core#1656
crypto523 pushed a commit to crypto523/fuel-core that referenced this issue Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working tech-debt The issue is to improve the current code and make it more clear/generic/reusable/pretty/avoidable.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant