-
Notifications
You must be signed in to change notification settings - Fork 43
[Reputation Oracle] feat: add support for batched payouts #2946
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
Conversation
|
The latest updates on your projects. Learn more about Vercel for Git ↗︎
2 Skipped Deployments
|
64b35ec to
6855913
Compare
...apps/reputation-oracle/server/src/database/migrations/1734697642348-escrowAwaitingPayouts.ts
Outdated
Show resolved
Hide resolved
packages/apps/reputation-oracle/server/src/database/database.module.ts
Outdated
Show resolved
Hide resolved
04ffde8 to
f97eb0f
Compare
Dzeranov
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm, lets wait for @portuu3
portuu3
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TS sdk docs missing
...ges/apps/reputation-oracle/server/src/modules/escrow-completion/escrow-completion.service.ts
Outdated
Show resolved
Hide resolved
portuu3
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm
Issue tracking
Resolves #2903
Context behind the change
Functionality to create raw transaction and calculate its hash is placed to SDK because it should encapsulate contract interaction, but sending raw transaction can be done manually in the service.
When processing batches, we have to store nonce in the DB in order to handle different edge-cases by providing it for retry.
When running
processPaidEscrowCompletionwe now have to check also forPartialescrow status because when paying in batchesbulkPayOutis called withforceComplete=false, so escrow won't be inPaidand won't autocomplete.How has this been tested?
TS SDK
createBulkPayoutTransactionwith testnet credentials, sendrawTransaction, verify that real transaction hash matches the one calculated by lib methodcreateBulkPayoutTransactionwith old nonce and make sure that real transaction fails withNONCE_EXPIREDerrorPython SDK
RepO
Locally, while connecting to local DB and testnet blockchain, implemented "test" endpoint to trigger it and manipulate different parts of the
EscrowCompletionServiceclasscreateEscrowPayoutsBatch, make sure that entity is created with correct propertiescreateEscrowPayoutsBatchwith replay; make sure that replay fails due to unique indexprocessPayoutsBatch, callprocessAwaitingPayouts; make sureescrowCompletionEntitygets updated retries countprocessAwaitingPayouts, make sure that upon successful payout txescrowCompletionEntitygetsPAIDstatusRelease plan
Note
Maintenance window can be omitted if there are no
pendingitems inescrow_completion_trackingtable and if we can block "webhook" endpoint for some time so creatingescrow_completion_trackingitems is pausedPotential risks; What to monitor; Rollback plan
In case we run a migration w/ service running - it can lead to some jobs get stuck. It can be solved by removing their "lock" in
cron-jobstable.