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

switchrpc: protect from attemptID reuse #16

Open
wants to merge 1 commit into
base: switchrpc
Choose a base branch
from

Conversation

starius
Copy link

@starius starius commented Jan 13, 2025

Change Description

Add a memory optimized store for SendOnion/TrackOnion duplication/safe ordering protection. This ensures that if TrackOnion returns PAYMENT_ID_NOT_FOUND or SendOnion initiates HTLC creation for a given attempt ID, SendOnion cannot subsequently succeed with the same attempt ID. This mechanism safeguards against overpayment in scenarios where network requests are reordered. If an attempt ID has already been used by either SendOnion or TrackOnion, SendOnion will return DUPLICATE_HTLC for that attempt ID.

Used https://github.com/RoaringBitmap/roaring as a store for attemp IDs.

@calvinrzachman calvinrzachman force-pushed the switchrpc branch 3 times, most recently from ffe811c to fb84a6c Compare January 13, 2025 22:31
Add a memory optimized store for SendOnion/TrackOnion duplication/safe ordering
protection. This ensures that if TrackOnion returns PAYMENT_ID_NOT_FOUND or
SendOnion initiates HTLC creation for a given attempt ID, SendOnion cannot
subsequently succeed with the same attempt ID. This mechanism safeguards against
overpayment in scenarios where network requests are reordered. If an attempt ID
has already been used by either SendOnion or TrackOnion, SendOnion will return
DUPLICATE_HTLC for that attempt ID.

Used https://github.com/RoaringBitmap/roaring as a store for attemp IDs.
@starius starius force-pushed the protect-from-attempt-id-reuse branch from 49ed723 to c08ed3f Compare January 14, 2025 15:44
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