-
Notifications
You must be signed in to change notification settings - Fork 52
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
NUT-19: Cached Responses #195
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not a grammar pro myself, but I think this is correct?
Awesome work and thank you for the implementations. I wonder whether we want to add this to the existing NUTs or formulate it as a separate NUT. In both cases, I think it would be better to formulate this as an optional feature. Right now it is formulated as a MUST. |
One argument for putting this in its own NUT would be that we would have to add a note about caching into every method that we add (like bolt12) whereas it could be formulated more generally as "any endpoint that produces outputs" and we could reference the specific NUTs for mint/melt/swap (and further future methods). This NUT should also defined a setting flag for each cached endpoint that we announce in the mint info (together with a TTL) |
There are two unrelated files in the PR. Questions in my mind:
|
Co-authored-by: gandlafbtc <[email protected]>
Co-authored-by: gandlafbtc <[email protected]>
Co-authored-by: gandlafbtc <[email protected]>
2d7cf70
to
128ea4e
Compare
XX.md
Outdated
|
||
## Requests & Responses | ||
|
||
Any Mint implementation should elect a data structure `D` that maps request objects to their respective responses. `D` should be fit for fast insertion, look-up and deletion (eviction) operations. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Example: Redis?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some minor corrections on first pass
Co-authored-by: callebtc <[email protected]>
Cache every successful
PostMintResponse
,PostMeltResponse
andPostSwapResponse
using the respective requests as keys.In case of a network error, clients can replay the same exact requests receive the same responses. This safe-guards against clients accidentally losing money because of connectivity issues.
Implementations:
SwapResponse
,MeltBolt11Response
andMintBolt11Response
cdk#361