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

feat: sidecar long pending deposits management #1507

Open
wants to merge 3 commits into
base: feat/sidecar-manage-rbf
Choose a base branch
from

Conversation

Jiloc
Copy link
Contributor

@Jiloc Jiloc commented Mar 12, 2025

Description

This PR adds support for handling long-pending transactions. It addresses the issue of transactions that remain in a pending state for extended periods without being confirmed in the mempool, which can lead to system bloat.

Changes

  • Added long-pending transaction detection and processing to the DepositProcessor service:
  • Implemented process_long_pending method to identify transactions that have been pending for too long
  • Added logic to mark transactions as FAILED if they:
    - Are in PENDING status
    - Cannot be found in the mempool (likely dropped)
    - Have been pending for longer than the configured maximum time (default: 24 hours)
    - Integrated long-pending transaction processing into the main deposit update workflow
  • Added MAX_UNCONFIRMED_TIME configuration setting (default: 86400 seconds / 24 hours) to control how long a transaction can remain unconfirmed before being marked as failed

Testing Information

  • Added unittests
  • uv run python -m unittest

Checklist:

  • I have performed a self-review of my code
  • My changes generate no new warnings
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

@Jiloc Jiloc requested a review from djordon March 12, 2025 16:36
@Jiloc Jiloc assigned matteojug and Jiloc and unassigned matteojug Mar 12, 2025
@Jiloc Jiloc added this to the sBTC: Withdrawal fine tuning milestone Mar 12, 2025
@Jiloc Jiloc requested a review from matteojug March 12, 2025 16:41
@Jiloc Jiloc marked this pull request as ready for review March 12, 2025 19:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In Review
Development

Successfully merging this pull request may close these issues.

3 participants