-
Notifications
You must be signed in to change notification settings - Fork 32
Description
Down this file, there are more details of which some may be rather confusing, especially for their abundance, but also the fact that it maybe includes references even to things already taken care of in GH-602. It inspired me to reassess this task and write more concise and accurate outlines.
The main thing that should be addressed under this card is basically the functionality that will belong in the start_scan() method of the PayableScanner, specifically its new retry mode. You will find it in scanners/mod.rs as the trait StartableScanner<ScanForRetryPayable, QualifiedPayablesMsg> where the first argument, spoke of as the "trigger message", differentiates this mode from the other one triggered by the ScanForNewPayable msg.
What should it be able to do? It will read from the failed_payable table through its DAO and collect the records that have newly come in when the PendingPayableScanner recognized them as failures. These should still be without the column "retried" filled in, with 0 respectively. The more aged failures will already have it set to 1 meaning they should not be reattempted.
Once we have the collection, we should gather the current balances for the same accounts whose wallets match the failed transaction expected receivers. That should be done via the PayableDao which probably will need a new method in order to serve that way.
We should merge these two collections, and make sure they are formed by the same structure which is required for the QualifiedPayableMsg. Remember that we do want to use this one as it is a reuse of the same message which we produce from the other mode of this scanner. Once the start_scan() methods ends, we want to continue quite identically, with the same data structures.
We, however, have to visit also the end_scan() method. Interestingly, we have an opportunity to consider completely getting rid of the mark sent payable procedure which took place only to prevent repeated payments for the same address before the first complete. First, now we know it would actually never be possible just by the design of blockchains. Second, the scan scheduling system does not enable this to happen either. The new-payable scan can never start again if the thing with pending payables (and so failed payables) hasn't been resolved yet.
If we run the retry mode and the recent scan ends up with some supposedly successful payments, we in finish_scan() method should make an update to the failed_payables table resulting in a one in the column for retried.
Again, we may not need to keep the logic for marking sent payables into the payable table - that implies that we may want to remove that column from the payable table. You may do it in this card also.
Sub-issues
Metadata
Metadata
Assignees
Labels
Type
Projects
Status