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

VRF oracle on bridge v2 #85

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open

VRF oracle on bridge v2 #85

wants to merge 8 commits into from

Conversation

DNK90
Copy link
Contributor

@DNK90 DNK90 commented Aug 14, 2023

Implement Random seed request task handler on bridge-v2. There are 2 main parts: event trigger function and task handling

1/ Event trigger

  • Bridge listens to event RandomSeedRequested and trigger function RandomSeedRequestedCallback
  • The function then check if the request is finalized or not. If not, it creates a pending "request random" task and store to database and wait to be handled by the task handler

2/ Task handler

  • Pending Random Request Tasks are collected periodically from the database. The flow of processing pending task is explained as the following image

pending_vrf drawio

  • The processing task then is checked if the transaction is success or not. If it failed, increase try count by 1 and update the task to PENDING and return to handling PENDING process

  • Task will be marked as failed if any error happened during handling PENDING task. The task try count is increased by 1. If the try count reaches 10 (max try), the task is updated to FAILED

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