pull down to refresh
100 sats \ 1 reply \ @SimpleStacker 5h \ parent \ on: Lots Of Riders Without Their Weapons meta
Not to be pedantic but is this really considered "atomic" or does it just try to simulate atomicity from the perspective of the user?
Not a critique of the method but rather a nerdy computer question
Then again, thinking about it more carefully, what is truly atomic anyway?
It depends on what you mean by atomic, but fwiw I don't mean to use the term lightly.
The lightning forward is what I'd call game theoretically atomic. We cannot claim the sender's money without paying the receiver, and once we've paid the receiver we certainly want to claim the sender's money. If we are unable to (or simply don't) claim the sender's money, the incoming payment becomes "delinquent" and the channel the payment is on will be force closed.
As for atomic refunds, we settle the incoming invoice within the database transaction that mutates SN. If the mutation fails before we settle the invoice, we cancel the payment without claiming it and the upstream channel balances revert. Even if there's some kind of mistake after the invoice is settled, SN's state machine can flow in only one direction: toward successfully completing the mutation. Even if errors/mistakes continue SN will try to complete the mutation indefinitely until it succeeds.
Perhaps one should claim that all of this is relatively atomic, but as far as computers are concerned, anything but a bit flip is relatively atomic.
reply