dwallet-labs / dwallet-network

dWallet Network, a composable modular signature network that is the home of dWallets. A dWallet is a noncollusive and massively decentralized signing mechanism, used as a building block by builders on other networks to add native multi-chain interoperability to any smart contract.
https://docs.dwallet.io
Other
40 stars 35 forks source link

Make sure active instances counter is always in sync #257

Open ItayLevyOfficial opened 2 months ago

ItayLevyOfficial commented 2 months ago

Right now your'e right. I don't understand how a struct solves the issue; Anyhow, the way to go imo is:

  1. When we implement instance completion, make sure we decrease the counter upon a completed instance (we'll have it's completed event).

  2. Start an async task after any instance starts to change it's status after some reasonable timeout (10 minutes let's say) to "failed" and decrease the counter.

Wdyt?

_Originally posted by @ItayLevyOfficial in https://github.com/dwallet-labs/dwallet-network/pull/244#discussion_r1772935091_