refactor: replace proof swap with state check in error recovery #1256

Merged
crodas merged 5 commits from feature/better-automatic-reclaim into main 2025-11-08 02:32:07 +00:00
crodas commented 2025-11-06 02:39:10 +00:00 (Migrated from github.com)

Description

This commit improves the proof recovery mechanism by replacing the swap operation with a more efficient state check approach when recovering from failed operations.

Fixes #1255


Notes to the reviewers


Suggested CHANGELOG Updates

CHANGED

ADDED

REMOVED

FIXED


Checklist

### Description This commit improves the proof recovery mechanism by replacing the swap operation with a more efficient state check approach when recovering from failed operations. Fixes #1255 ----- ### Notes to the reviewers <!-- In this section you can include notes directed to the reviewers, like explaining why some parts of the PR were done in a specific way --> ----- ### Suggested [CHANGELOG](https://github.com/cashubtc/cdk/blob/main/CHANGELOG.md) Updates <!-- Please do not edit the actual changelog but note what you changed here. --> #### CHANGED #### ADDED #### REMOVED #### FIXED ---- ### Checklist * [ ] I followed the [code style guidelines](https://github.com/cashubtc/cdk/blob/main/CODE_STYLE.md) * [ ] I ran `just final-check` before committing
callebtc (Migrated from github.com) reviewed 2025-11-06 02:39:10 +00:00
a1denvalu3 (Migrated from github.com) reviewed 2025-11-06 02:39:10 +00:00
a1denvalu3 (Migrated from github.com) reviewed 2025-11-06 17:07:43 +00:00
@ -30,9 +34,42 @@ impl<T: ?Sized> MaybeSend for T {}
const BATCH_PROOF_SIZE: usize = 100;
a1denvalu3 (Migrated from github.com) commented 2025-11-06 17:07:16 +00:00

Why are we removing the transaction

Why are we removing the transaction
a1denvalu3 (Migrated from github.com) commented 2025-11-06 17:05:46 +00:00
                        "Http operation failed with \"{}\", reverting  {} proofs states to UNSPENT",
```suggestion "Http operation failed with \"{}\", reverting {} proofs states to UNSPENT", ```
crodas (Migrated from github.com) reviewed 2025-11-06 20:21:54 +00:00
@ -30,9 +34,42 @@ impl<T: ?Sized> MaybeSend for T {}
const BATCH_PROOF_SIZE: usize = 100;
crodas (Migrated from github.com) commented 2025-11-06 20:21:54 +00:00

This is a standard practice that I copied from other places, @thesimplekid. I'm fine with dropping this line. Wdyt?

This is a standard practice that I copied from other places, @thesimplekid. I'm fine with dropping this line. Wdyt?
thesimplekid (Migrated from github.com) reviewed 2025-11-07 02:54:40 +00:00
@ -30,9 +34,42 @@ impl<T: ?Sized> MaybeSend for T {}
const BATCH_PROOF_SIZE: usize = 100;
thesimplekid (Migrated from github.com) commented 2025-11-07 02:52:18 +00:00

Where else do we remove it? My intuition is that we shouldn't have to remove it and it should never be added if the tx fails. Since I don't believe we have a failed tx state and we only add successful ones.

Where else do we remove it? My intuition is that we shouldn't have to remove it and it should never be added if the tx fails. Since I don't believe we have a failed tx state and we only add successful ones.
thesimplekid (Migrated from github.com) commented 2025-11-07 02:54:20 +00:00

These should be logs not prints.

These should be logs not prints.
thesimplekid (Migrated from github.com) approved these changes 2025-11-08 02:31:52 +00:00
thesimplekid (Migrated from github.com) left a comment

LGTM. ACK 91e89a542d

LGTM. ACK 91e89a542dbbbf76c02b03c327e72fab5bebf827
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cashubtc/cdk!1256
No description provided.