Replies: 2 comments 10 replies
-
There are patch solutions for some individual problems, but it would be great to have a more general solution that ensures our current state is sane given the history of the CFD. One general solution was outlined by #1317 The idea is to go over CFD states and decide to add a However, it would be great to be able to run this task periodically while the application is running and not just upon startup. This requires time boundaries to decide if a CFD is in a problematic state or not. We have to decide how much time a CFD that was just created or a protocol that was just started should have until we consider it Constraints:
|
Beta Was this translation helpful? Give feedback.
-
We could go one step further and question the pattern to start and "finish" protocols (where finish can be a successful completion or a failed event). We introduced the started event mainly to be able to decide:
We could try to re-define these constraints in a different way, but I don't have an overall better solution in my head yet. |
Beta Was this translation helpful? Give feedback.
-
We have some cases where CFDs should get cleaned up because their state is causing trouble.
Cases that require cleanup because the CFDs remain in "the taker UI forever" (and remains in
cfds
table forever):Pending Setup
if taker hasInsufficient Funds
error #2127ContractSetupStarted
but no failed event (but the contract setup failed) - Testnet position remains inContractSetup
"forever" #1987Cases that could be cleaned up because we are not in a proper state:
RolloverStarted
but no failed event (but the rollover failed)CollaborativeSettlementStarted
but no failed event (but the collab settlement failed)Note that special cases where CFDs are not in a correct state are not handled here but in separate tickets. This discussion concerns cases where we started something, but did not finish in a state that the application can handle properly.
General recommendations:
creation_timestamp
to thecfds
(and the closed/failed cfd tables) before adding cleanup to CFDs that don't have any eventsBeta Was this translation helpful? Give feedback.
All reactions