Replies: 2 comments 7 replies
-
Is the concrete problem you are describing actually the problem of the process manager? I feel the underlying problem is, that My understanding: Refund should only be available if both oracle and maker are unavailable. If we get an attestation we should not have refund available. So, the model is wrong to make it available! Or am I misunderstanding something? |
Beta Was this translation helpful? Give feedback.
-
That I agree with, but I would try to keep an actor's business logic to a minimum and cover most cases (including tests) of what is "possible" and what not in If reasoning logic is necessary for prioritizing transactions then the monitor, as you say, is the right place for this. But I would ask: Why was the event that gave you refund available in the first place? |
Beta Was this translation helpful? Give feedback.
-
Currently the process manager makes the decision to broadcast a transaction based on the occurrence of an event. The problem with this strategy is that the process manager often does not have enough information to make the correct decision. For example, the process manager broadcasts the refund transaction when the refund timelock expires. This is not the desired behavior. We only want to broadcast the refund transaction if
refund_timelock_expired && !attestation_received
. Because the process manager does not build an aggregate it cannot check that these conditions are met and makes the incorrect decision to broadcast the refund transaction when a decrypted cet is present.We can solve this problem my blindly forwarding events to interested actors and in this case, leave the decision to broadcast the refund transaction to the
monitor::Actor
. The monitor actor can build an aggregate and make the correct decision to broadcast the refund transaction whenrefund_timelock_expired && !attestation_received
.tldr;
Make the process manager dumb. It just forwards events to interested actors instead of trying to make decisions like broadcasting a specific tx. A single event itself does not provide enough information to make the right decision, we need an aggregate.
Issue which triggered this discussion: #1230
Beta Was this translation helpful? Give feedback.
All reactions