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

[SDP-1397] Circle payouts pt1 #486

Merged
merged 31 commits into from
Dec 10, 2024
Merged

Conversation

marcelosalloum
Copy link
Collaborator

@marcelosalloum marcelosalloum commented Dec 5, 2024

What

Replace the usage of Circle's POST /transfers API endpoint with the combination of POST /recipients and POST /payouts API endpoint.

Why

Circle plans to stop support for the /transfers API endpoint.

Pending

Errors in the POST /recipient endpoint are not being properly handled. What;s missing?

  • When POST /recipient fails with ErrCircleRecipientCreationFailedTooManyTimes, it should update the payments table with the failed status
  • When a payment is retried, recipients should be retried as well, either by creating a new circle_recipient in our DB, or by cleaning the sync_attempts counter from the existing recipient (TBD).
  • Split logic from ensureRecipientIsReady as suggested in [SDP-1397] Circle payouts pt1 #486 (comment).

Checklist

PR Structure

  • This PR has a reasonably narrow scope (if not, break it down into smaller PRs).
  • This PR title and description are clear enough for anyone to review it.
  • This PR does not mix refactoring changes with feature changes (split into two PRs otherwise).

Thoroughness

  • This PR adds tests for the new functionality or fixes.
  • This PR contains the link to the Jira ticket it addresses.

Configs and Secrets

  • No new CONFIG variables are required -OR- the new required ones were added to the helmchart's values.yaml file.
  • No new CONFIG variables are required -OR- the new required ones were added to the deployments (pr-preview, dev, demo, prd).
  • No new SECRETS variables are required -OR- the new required ones were mentioned in the helmchart's values.yaml file.
  • No new SECRETS variables are required -OR- the new required ones were added to the deployments (pr-preview secrets, dev secrets, demo secrets, prd secrets).

Release

  • This is not a breaking change.
  • This is ready for production.. If your PR is not ready for production, please consider opening additional complementary PRs using this one as the base. Only merge this into develop or main after it's ready for production!

Deployment

  • Does the deployment work after merging?

@marcelosalloum marcelosalloum self-assigned this Dec 5, 2024
@marcelosalloum marcelosalloum temporarily deployed to Anchor Integration Tests December 5, 2024 00:43 — with GitHub Actions Inactive
@marcelosalloum marcelosalloum marked this pull request as draft December 5, 2024 00:43
@marcelosalloum marcelosalloum temporarily deployed to Receiver Registration - E2E Integration Tests (Stellar) December 5, 2024 00:43 — with GitHub Actions Inactive
@marcelosalloum marcelosalloum temporarily deployed to Anchor Integration Tests December 5, 2024 23:27 — with GitHub Actions Inactive
@marcelosalloum marcelosalloum temporarily deployed to Receiver Registration - E2E Integration Tests (Stellar) December 5, 2024 23:27 — with GitHub Actions Inactive
@marcelosalloum marcelosalloum temporarily deployed to Anchor Integration Tests December 6, 2024 01:22 — with GitHub Actions Inactive
@marcelosalloum marcelosalloum temporarily deployed to Receiver Registration - E2E Integration Tests (Stellar) December 6, 2024 01:22 — with GitHub Actions Inactive
@marcelosalloum marcelosalloum force-pushed the feat/SDP-1397-circle-payouts branch from a46248e to 5652b7e Compare December 6, 2024 01:34
@marcelosalloum marcelosalloum temporarily deployed to Receiver Registration - E2E Integration Tests (Stellar) December 6, 2024 01:34 — with GitHub Actions Inactive
@marcelosalloum marcelosalloum temporarily deployed to Anchor Integration Tests December 6, 2024 01:34 — with GitHub Actions Inactive
@marcelosalloum marcelosalloum temporarily deployed to Anchor Integration Tests December 6, 2024 18:24 — with GitHub Actions Inactive
@marcelosalloum marcelosalloum temporarily deployed to Receiver Registration - E2E Integration Tests (Stellar) December 6, 2024 18:24 — with GitHub Actions Inactive
@marcelosalloum marcelosalloum temporarily deployed to Receiver Registration - E2E Integration Tests (Stellar) December 6, 2024 23:11 — with GitHub Actions Inactive
@marcelosalloum marcelosalloum temporarily deployed to Anchor Integration Tests December 6, 2024 23:11 — with GitHub Actions Inactive
@marcelosalloum marcelosalloum temporarily deployed to Anchor Integration Tests December 7, 2024 01:04 — with GitHub Actions Inactive
@marcelosalloum marcelosalloum temporarily deployed to Receiver Registration - E2E Integration Tests (Stellar) December 7, 2024 01:04 — with GitHub Actions Inactive
@marcelosalloum marcelosalloum temporarily deployed to Anchor Integration Tests December 7, 2024 01:04 — with GitHub Actions Inactive
@marcelosalloum marcelosalloum temporarily deployed to Receiver Registration - E2E Integration Tests (Stellar) December 7, 2024 01:04 — with GitHub Actions Inactive
@stellar-jenkins
Copy link

Something went wrong with PR preview build please check

@marcelosalloum marcelosalloum force-pushed the feat/SDP-1397-circle-payouts branch from 9f12f0d to eb34fe4 Compare December 9, 2024 22:07
@marcelosalloum marcelosalloum temporarily deployed to Receiver Registration - E2E Integration Tests (Stellar) December 9, 2024 22:07 — with GitHub Actions Inactive
@marcelosalloum marcelosalloum temporarily deployed to Anchor Integration Tests December 9, 2024 22:07 — with GitHub Actions Inactive
@stellar-jenkins
Copy link

Something went wrong with PR preview build please check

@marcelosalloum marcelosalloum force-pushed the feat/SDP-1397-circle-payouts branch from a15b635 to 0480232 Compare December 10, 2024 23:42
@marcelosalloum marcelosalloum had a problem deploying to Receiver Registration - E2E Integration Tests (Stellar) December 10, 2024 23:42 — with GitHub Actions Failure
@marcelosalloum marcelosalloum temporarily deployed to Anchor Integration Tests December 10, 2024 23:42 — with GitHub Actions Inactive
@marcelosalloum marcelosalloum had a problem deploying to Receiver Registration - E2E Integration Tests (Stellar) December 10, 2024 23:45 — with GitHub Actions Failure
@marcelosalloum marcelosalloum temporarily deployed to Receiver Registration - E2E Integration Tests (Stellar) December 10, 2024 23:53 — with GitHub Actions Inactive
@marcelosalloum marcelosalloum merged commit fa51cec into develop Dec 10, 2024
13 checks passed
@marcelosalloum marcelosalloum deleted the feat/SDP-1397-circle-payouts branch December 10, 2024 23:56
marcelosalloum added a commit that referenced this pull request Dec 13, 2024
### What

Errors in the POST /recipient endpoint are not being properly handled. What;s missing?
- When POST /recipient fails with `ErrCircleRecipientCreationFailedTooManyTimes`, we update the payments table with the failed status explaining the reason.
- When a payment that failed due to recipient creation issues is retried, the recipient is reset with `status=NULL` and `sync_attempts=0`.
- The method `ensureRecipientIsReady` was split into different sub-methods for better modularity and clarity, as suggested in #486 (comment).

<img width="1151" alt="Screenshot 2024-12-12 at 4 39 08 PM" src="https://github.com/user-attachments/assets/53ed59d9-bba0-42e2-b149-0fca3bfb5a66" />

- [x] Tested with scheduled jobs
- [x] Tested with Kafka

### Why

To wrap up https://stellarorg.atlassian.net/browse/SDP-1397
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.

3 participants