Skip to content
This repository has been archived by the owner on Jul 25, 2024. It is now read-only.

Handling Errors from Blockchain #72

Merged
merged 22 commits into from
Oct 3, 2023
Merged

Conversation

saraswatpuneet
Copy link
Collaborator

@saraswatpuneet saraswatpuneet commented Oct 2, 2023

Closes: #18

Details

  • Check for the existence of txHash: this should always be there even if messages pallet failed (reason: capacity will be withdrawn as expected and low capacity related error is handled in publisher itself: read signed extensions)
  • Check for success events: If capacity withdrawn found and message stored events are found then it is a complete success
  • Check for error from module (messages pallet) : here based on error take action like, fail the job, re-queue or anything else
  • Refactor parts to blockchain lib

@saraswatpuneet saraswatpuneet changed the title Handling Errors from Blockchain [WIP] Handling Errors from Blockchain Oct 2, 2023
@saraswatpuneet saraswatpuneet marked this pull request as ready for review October 2, 2023 17:10
@saraswatpuneet saraswatpuneet requested a review from aramikm October 2, 2023 19:49
@saraswatpuneet saraswatpuneet changed the title [WIP] Handling Errors from Blockchain Handling Errors from Blockchain Oct 2, 2023
Copy link
Collaborator

@aramikm aramikm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added some comments. Please let me know if you might like to go over a couple of those errors to figure out what are the options to handle them.

apps/worker/src/monitor/tx.status.monitor.service.ts Outdated Show resolved Hide resolved
apps/worker/src/monitor/tx.status.monitor.service.ts Outdated Show resolved Hide resolved
apps/worker/src/monitor/tx.status.monitor.service.ts Outdated Show resolved Hide resolved
apps/worker/src/monitor/tx.status.monitor.service.ts Outdated Show resolved Hide resolved
apps/worker/src/monitor/tx.status.monitor.service.ts Outdated Show resolved Hide resolved
@saraswatpuneet
Copy link
Collaborator Author

saraswatpuneet commented Oct 3, 2023

Here is how we are currently handling errors

  1. if a tx is not found i.e. did not make it to block by the time we check, an error is thrown so that retry can trigger
  2. if a tx is found and success events are discovered then we are good
  3. if a tx is found and error is found for messages pallet then we take action to either pause the publishing or retry it, while i most cases the job is marked failed as we want to have a receipt of tx given it did consume capacity when failed too
  4. Ideally in retry logic we queue the publish job and mark the tx receipt job as failed and once publishQueue gets the job done it will be re-queued in tx-receipt

Copy link
Collaborator

@aramikm aramikm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks awesome! I just added a few suggestions.

@saraswatpuneet saraswatpuneet merged commit 8e7b80a into main Oct 3, 2023
@saraswatpuneet saraswatpuneet deleted the pallet_handle_errors branch October 3, 2023 18:08
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Handle messages pallet errors in publisher
2 participants