This repository has been archived by the owner on Aug 2, 2021. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
swap: prevent debt cheques #1983
swap: prevent debt cheques #1983
Changes from 54 commits
671a30d
2723804
75cfe23
4b85c4d
01b42ab
8df2245
d69ced8
6bc0fe5
6044ec6
d0e8146
619129f
8ee2e2c
5f2b9f5
0aa47da
b271f2d
ab755d9
4a6c3a3
f02a9f2
03484ad
daa620a
eb7d34a
068b58c
9ba613d
b1a0cfc
ba65ef7
d558c16
1ceb4f2
ba551bc
03d601b
c7ceba3
f044532
1f386ae
e17b503
22b4dd3
7706df9
4d33e9e
de01e2d
5869533
78561f2
b449607
1e815e8
f34200a
585e77d
5e53773
fd99c9c
9102171
1ff452c
f4757e2
5010458
39f3aae
5b6f493
6ca077b
8e8df8a
3faf60a
63229eb
7d1ce9c
1d885fc
77a153b
7fa9e47
f1a46a0
d2402bb
594d900
415e7f6
8888cfc
3117c81
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we be sure at this point that the actual balance has been updated from the previous iteration run? I think it does, but give it another thought please.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thank you for raising this point, it's something i hadn't considered.
my instinct was that the code (from this side of the exchange) would not be able to send a message in a following iteration until it was done with the current one, and this would include updating the balance.
i added some prints to the
updateBalance
calls and the testfor
loop iterations, and wrote an execution ofTestMultiChequeSimulation
test to disk.here are the initial results. you can see that sometimes there are multiple balance updates within a single iteration. however, these seem to be from the creditor side, so it does not matter that they occur one time per iteration—at least for the point you've raised.
this is the result obtained by filtering out the other peer's balance updates prints. it seems to confirm that every iteration does 1 balance update before moving on to the next one.
curiously, this might give us insight into the cause of #2078. it's very possible that by the time the creditor is allowed to receive the messages and account for them, the debitor is way ahead and the cheque it has sent is perceived as debt from the other side, for being too early. but i think it would have to process the cheque before doing the balance updates for this to explain the situation.