View Issue Details

IDProjectCategoryView StatusLast Update
0006009Talerobsolete componentpublic2020-03-31 14:04
ReporterChristian Grothoff Assigned ToFlorian Dold Resolution deadline
ImplementerReviewer 
Release signed byDeployed by 
VerifierCommunicator 
Data protection authority notification requiredNo  
CSIRT notification requiredNo  
Estimated effort (hours)Actual effort (hours)0 
Fast-trackNo
Work packagenone
PriorityurgentSeverityblockReproducibilityalways
Status closedResolutionfixed 
Platformi7OSDebian GNU/LinuxOS Versionsqueeze
Product Versiongit (master) 
Target Version0.6Fixed in Version0.6 
Summary0006009: bank's /admin/add/incoming is not idempotent
DescriptionWhen a wire transfer fails (or seems to have failed), taler-exchange-aggregator will repeat it. In this case, the bank MUST NOT do the wire transfer a second time (idempotent: doing the same thing twice is a no-op!). However, right now, the Python bank simply does the wire transfer again, even if _everything_ (accounts, subject and amount) is identical.

We could consider this an issue of the libtalerbank API, which doesn't first ask for a unique transaction number (2-phase commit). This _would_ be supportable by the wire plugin. Right now, our logic is simplistic and simply repeats the same HTTP request again. However, the exchange DOES guarantee that the subject is unique except for idempotent requests.

This recently was a major issue, because the (Python) bank violated the protocol by returning the data format in a way that was, eh, unexpected by the aggregator / libtalerbank. As a result, the aggregator believed that the request failed, and retried -- repeatedly, until the exchange account was empty. Boo!

Temporary fix: deploy a bank that never fails (har har). This is urgent, ideally to be fixed before 36c3.
TagsNo tags attached.

Required notifications

Address or linkRemarkAdded byNotifiedActions

Activities

Marcello Stanisci

2019-12-24 12:29

reporter   ~0015219

Here it would be VERY useful to know which data (a JSON field supposedly? Which one?) was not liked by the aggregator!

Christian Grothoff

2019-12-24 13:08

manager   ~0015220

The timestamp field of the response for making a wire transfer was encoded in a way the aggregator did not like (see recent format change of date fields!). Anyway, that has been fixed. The high-level issue that remains is that the aggregator expects requests to be idempotent, while the pybank doesn't implement that.

Discussing with Florian, we think a good way would be to add a high-entropy UUID/request ID into the API, and if that value is not unique, the bank MUST reject the transfer if it differs in any dimension, and MUST decide it is a repeated request to be ignored if all fields (sender, receiver, amount, subject AND requestID/UUID) match. That way, we can do it with one request/RTT, and avoid the pitfall of a user manually intentionally doing a transaction twice, where everything including the wire transfer subject matches.

Florian Dold

2020-01-27 20:42

manager   ~0015300

Has been implemented in the python bank (and fakebank) a while ago.

Issue History

Date ModifiedUsernameFieldChange
2019-12-23 22:20Christian GrothoffNew Issue
2019-12-23 22:20Christian GrothoffStatusnew => assigned
2019-12-23 22:20Christian GrothoffAssigned To => Marcello Stanisci
2019-12-24 12:29Marcello StanisciNote Added: 0015219
2019-12-24 13:08Christian GrothoffNote Added: 0015220
2020-01-27 20:42Florian DoldAssigned ToMarcello Stanisci => Florian Dold
2020-01-27 20:42Florian DoldStatusassigned => informing
2020-01-27 20:42Florian DoldResolutionopen => fixed
2020-01-27 20:42Florian DoldNote Added: 0015300
2020-01-27 23:12Christian GrothoffFixed in Version => 0.6
2020-03-31 14:04Christian GrothoffStatusinforming => closed
2022-08-23 18:26Christian GrothoffCategorybank (demonstrator) => py bank (demonstrator, obsolete)
2023-12-03 00:23Christian GrothoffCategorypy bank (demonstrator, obsolete) => obsolete componet
2023-12-11 19:08Florian DoldCategoryobsolete componet => obsolete component