Conversation
40d4c47 to
8678312
Compare
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #801 +/- ##
==========================================
+ Coverage 61.12% 64.21% +3.08%
==========================================
Files 89 90 +1
Lines 10565 10875 +310
==========================================
+ Hits 6458 6983 +525
+ Misses 4107 3892 -215 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
LGTM |
|
I might add a comment to clarify that internal melts are always processed synchronously, ignoring the |
yes we could, but the support for async doesn't mean that the mint will always honor the request. I'm thinking about whether it makes sense to process transactions synchronously up to, say, 2s time and return the PENDING if it hasn't resolved in that time or not. |
|
found an issue (likely race condition) that causes a db exception when you call |
2s probably sounds reasonable. I had just been thinking about the slog of defining SLAs and communicating those out in my past life. It might be good to set some basic SLA goals we can unify around for mints in the larger space. Cashu is pretty good about defining everything in specs and setting out expectations. I tend to error on the side of being overly verbose around these kinds of things. Its nice for a consumer to be able to build against expectations for the final end user, and everything starts to add up. |
d4f931f to
b81ce72
Compare
77e3de1 to
fec0f1e
Compare
I have fixed this. |
|
Sorry I am a little late to the discussion (if the NUT update would be still in the making I'd likely propose to have sync or async as a property of a melt method, to avoid all optionality here). Now with the custom header in place, I'd vote for having either sync or async behavior depending on header - and just handle internal bolt11 melts as async from outside POV if that's what wallet asked for. The melt handling from wallet POV is already now full of traps and limit the number of possible behaviors would be a good choice. |
|
It is already merged. |
|
I have refactored the code to use request body for prefer_async options. |
cc197c6 to
3dbba73
Compare
|
Updated the implementation to provide prefer_async field directly in PostMeltRequest body. |
|
@a1denvalu3 - are you going to add the wallet cli flag support etc from #887? |
Summary
This PR adds support for
prefer_asyncoption in thePOST /v1/melt/bolt11request body. If a request contains this option set to true, the Mint no longer blocks until the operation is completed, but rather it schedules a task for the backend and returns immediately with aPENDINGmelt quote response.Relevant specification PR is here.
Changes
prefer_asyncfield toPostMeltRequestmodel.Wallet.meltto supportprefer_asyncargument.POST /v1/melt/bolt11endpoint to handleprefer_asyncfrom the request body.