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

Fix/updated hash #97

Merged
merged 7 commits into from
Nov 9, 2022
Merged

Fix/updated hash #97

merged 7 commits into from
Nov 9, 2022

Conversation

lok52
Copy link
Collaborator

@lok52 lok52 commented Nov 9, 2022

Updates:

  • Fix minor logging issues found after deploying on staging:
    1. Validation errors now are considered as warnings
    2. Changed debug level to info in some places
    3. Added log for re-sent transaction hash (Closes Log txhash for resent transactions #89)
  • Enhance signature validation (Closes Validate permit deposit signature more precisely {22.11} #95). Compare recovered address with owner field from memo. If these addresses mismatch, the we don't need to check token balance and can throw a corresponding error.
  • Update job status model with following statuses: waiting, failed, sent, reverted, completed. Description:
    waiting - job is waiting in queue or being processed by poolTxWorker
    failed - job failed validation step before it was submitted to contract
    sent - job is being processed by sentTxWorker
    reverted - job got a confirmed revert
    completed - job completed successfully
    Expected /job/:id response type for each status:
    • waiting:
      {
          createdOn: number
          failedReason: null
          finishedOn: null
          state: "waiting"
          txHash: null
      }
    • failed:
      {
          createdOn: number
          failedReason: string
          finishedOn: number
          state: "failed"
          txHash: null
      }
    • sendt:
      {
          createdOn: number
          failedReason: null
          finishedOn: null
          state: "sent"
          txHash: string
      }
    • reverted:
      {
          createdOn: number
          failedReason: null
          finishedOn: number
          state: "reverted"
          txHash: string
      }
    • completed:
      {
          createdOn: number
          failedReason: null
          finishedOn: number
          state: "completed"
          txHash: string
      }
  • Added JobIdsMapping. It is required to track statuses of re-submitted to poolTxQueue failed jobs. After job is re-submitted back to the queue, a new record is stored in redis linking original pool job id to the new one.
  • Update transaction hash in optimistic state after transaction re-send (Closes Return updated hash {R22.11} #81)

zp-relayer/endpoints.ts Outdated Show resolved Hide resolved
zp-relayer/endpoints.ts Show resolved Hide resolved
zp-relayer/endpoints.ts Show resolved Hide resolved
zp-relayer/workers/sentTxWorker.ts Show resolved Hide resolved
zp-relayer/endpoints.ts Show resolved Hide resolved
Copy link

@k1rill-fedoseev k1rill-fedoseev left a comment

Choose a reason for hiding this comment

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

lgtm

@akolotov akolotov merged commit b9b9fa0 into devel Nov 9, 2022
@akolotov akolotov deleted the fix/updated-hash branch November 9, 2022 18:48
Copy link

@EvgenKor EvgenKor left a comment

Choose a reason for hiding this comment

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

The code looks good. It's need to test it on the staging

akolotov added a commit that referenced this pull request Nov 21, 2022
This merge contains the following set of changes:
- Reworked approach to resend transactions (#96)
- New job status model, sender consistency check, improved transaction hash tracking (#97)
- Fix possible completed job state issue (#99)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants