View Issue Details

IDProjectCategoryView StatusLast Update
0006214Talerexchangepublic2021-08-24 14:23
Reporteroec Assigned ToChristian Grothoff 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
PrioritylowSeveritytweakReproducibilityhave not tried
Status closedResolutionfixed 
Product Versiongit (master) 
Target Version0.7.1Fixed in Version0.7.1 
Summary0006214: Suggestion: Introduce invariants check when dealing with TALER_EXCHANGEDB_TransactionList
DescriptionTEH_plugin->get_coin_transactions creates a linked list of TALER_EXCHANGEDB_TransactionList and TALER_EXCHANGEDB_calculate_transaction_list_totals iterates of such a list.

AFAIK, if there is no element of type TALER_EXCHANGEDB_TT_DEPOSIT in the linked list, it must be the empty list, correct?

I suggest to have additional GNUNET_assert statements in get_coin_transactions and maybe also in TALER_EXCHANGEDB_calculate_transaction_list_totals that check for those types of invariants. This would allow to catch inconsistencies in the database or bugs in the code early.
TagsNo tags attached.

Required notifications

Address or linkRemarkAdded byNotifiedActions

Activities

Christian Grothoff

2020-04-23 09:38

manager   ~0015752

IMO we should not assert on information we get from our database, databases can be corrupt and we should ideally survive that. At least if the (SQL) constraints / schema of the DB hold, and we cannot formulate a sane constraint that says that there has to be a deposit.

We could possibly "GNUNET_break()" on this.

oec

2020-04-23 09:44

developer   ~0015753

Yes, GNUNET_break() would already be helpful. It would at least communicate to a developer or code auditor the presence of such an invariant.

Christian Grothoff

2020-04-23 10:00

manager   ~0015755

Added in a039bf4d..727eccbe (in both functions).

Issue History

Date ModifiedUsernameFieldChange
2020-04-23 09:34oecNew Issue
2020-04-23 09:34oecStatusnew => assigned
2020-04-23 09:34oecAssigned To => Christian Grothoff
2020-04-23 09:38Christian GrothoffNote Added: 0015752
2020-04-23 09:44oecNote Added: 0015753
2020-04-23 10:00Christian GrothoffNote Added: 0015755
2020-04-23 10:00Christian GrothoffStatusassigned => informing
2020-04-23 10:00Christian GrothoffResolutionopen => fixed
2020-04-23 10:00Christian GrothoffFixed in Version => 0.7.1
2020-04-23 10:00Christian GrothoffProduct Version => git (master)
2020-04-23 10:00Christian GrothoffTarget Version => 0.7.1
2021-08-24 14:23Christian GrothoffStatusinforming => closed