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: async support for dlc-manager #235

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

Conversation

bennyhodl
Copy link
Contributor

builds on top of #234

Adds a feature flag of async. There are functions for less reliance on oracles for creating offers and closing contracts. In my implementation of dlcdevkit the consumers are typically going to use async runtimes with gRPC servers, REST servers, tauri, etc. Manually closing contracts and tracking for attestations created code and solutions that I was not happy with for something I believe should be handled internally in the library.

I think that dlc-manager should manage contracts agnostic to runtimes. I.e. not having to spawn a blocking thread for periodic checks.

This makes the manual close for situations in which an attestation is produced before the maturity. Not necessarily for async runtimes that are not running periodic checks for confirmed contracts.

@Tibo-lg
Copy link
Contributor

Tibo-lg commented Oct 7, 2024

Having async interfaces would definitely be nice but that's something I'd like to give some thinking rather than just duplicating code tbh. I know bdk and ldk are using some macros to make this better and I'd probably want to check that first before considering which approach to take.

@bennyhodl
Copy link
Contributor Author

Understood, looking at the bdk-macros crate it just supports for wasm targets. Would have to fork the code for the async feature. We could have the maybe async oracle trait and then call [maybe_await] for the calls for attestations and announcements.

Will have to change all of the iterators to for loops to keep the calls to the Oracle traits the same.

Would this be worthwhile to try?

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.

2 participants