[Reputation Oracle] Mark escrow completion as completed before webhook creation#3876
[Reputation Oracle] Mark escrow completion as completed before webhook creation#3876
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub. 5 Skipped Deployments
|
Co-authored-by: portuu3 <61605646+portuu3@users.noreply.github.com>
dnechay
left a comment
There was a problem hiding this comment.
After this change, if webhook creation fails - it will never be retried, making the guarantee of webhook sending "at most once", but we need "at least once" in order to notify other oracle and let the whole flow finish.
If we fail to get operator data or fail to create webhook in DB (which can be only DB error), then we should fail and retry later. If oracle doesn't have webhook url set at all - we fail as well, but can consider a possibility of skipping webhook creation for such oracles
| oracleAddress, | ||
| ); | ||
| if (!oracleData) { | ||
| throw new Error('Oracle data is missing'); |
There was a problem hiding this comment.
It is mainly a safety belt for lagging subgraph, because it shouldn't be possible since at least fee and role must be set
Issue tracking
Freestyle
Context behind the change
Persist escrow completion immediately after successful on-chain finalization, so webhook creation failures no longer leave the escrow stuck in an inconsistent DB state.
How has this been tested?
Ran unit tests locally
Release plan
None
Potential risks; What to monitor; Rollback plan
None