From b48013bd561e5f10bef55091f320356fd5fa6f6f Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Tue, 3 Apr 2018 23:31:18 +0200 Subject: [PATCH 1/8] fix compiler warning --- src/exchange-lib/testing_api_cmd_track.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/exchange-lib/testing_api_cmd_track.c b/src/exchange-lib/testing_api_cmd_track.c index 3f14c5110..bbad7b784 100644 --- a/src/exchange-lib/testing_api_cmd_track.c +++ b/src/exchange-lib/testing_api_cmd_track.c @@ -519,16 +519,15 @@ track_transfer_cb return; } - switch (http_status) - { - - if ( - (NULL == tts->expected_total_amount) || - (NULL == tts->expected_wire_fee)) + if ( (NULL == tts->expected_total_amount) || + (NULL == tts->expected_wire_fee) ) GNUNET_log (GNUNET_ERROR_TYPE_WARNING, "Expected amount and fee not specified, " "likely to segfault...\n"); + + switch (http_status) + { case MHD_HTTP_OK: if (GNUNET_OK != TALER_string_to_amount (tts->expected_total_amount, From df8ff68ed8ed2026b1f353f7a8dbd3ced4ab30c1 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Wed, 4 Apr 2018 00:13:17 +0200 Subject: [PATCH 2/8] fix compiler warnings --- src/bank-lib/testing_api_cmd_history.c | 3 ++- src/bank-lib/testing_api_cmd_reject.c | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/bank-lib/testing_api_cmd_history.c b/src/bank-lib/testing_api_cmd_history.c index 30090bf8c..d033e677c 100644 --- a/src/bank-lib/testing_api_cmd_history.c +++ b/src/bank-lib/testing_api_cmd_history.c @@ -121,7 +121,8 @@ test_cancelled (struct TALER_TESTING_Interpreter *is, const struct TALER_TESTING_Command *c = &is->commands[i]; - #warning "Errors reported here are NOT fatal" + /* XXX: Errors reported here are NOT fatal */ + /* Rejected wire transfers have hold a reference to a * reject command to mark them as rejected. So errors * about "reject traits" not found are NOT fatal here */ diff --git a/src/bank-lib/testing_api_cmd_reject.c b/src/bank-lib/testing_api_cmd_reject.c index c01c27d87..24d741478 100644 --- a/src/bank-lib/testing_api_cmd_reject.c +++ b/src/bank-lib/testing_api_cmd_reject.c @@ -127,7 +127,7 @@ reject_run (void *cls, (GNUNET_OK == TALER_TESTING_GET_TRAIT_ROW_ID (deposit_cmd, &row_id)); TALER_LOG_INFO ("Account %llu rejects deposit\n", - *credit_account); + (unsigned long long) *credit_account); rs->rh = TALER_BANK_reject (is->ctx, rs->bank_url, &AUTHS[*credit_account -1], From 1731f5dc77422e3b87294616c3f94b055803a622 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Wed, 4 Apr 2018 00:13:36 +0200 Subject: [PATCH 3/8] change version number to 0.5 --- ChangeLog | 3 +++ configure.ac | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index e5d3eaf16..506ad357f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +Tue Apr 3 23:29:06 CEST 2018 + Releasing Taler v0.5.0 + Thu Jan 4 11:55:41 CET 2018 Fix issue #5234 (aggregator ignoring refunds). Misc. minor fixes to the auditor. -CG diff --git a/configure.ac b/configure.ac index 0f760e2e8..d2254b3a1 100644 --- a/configure.ac +++ b/configure.ac @@ -17,7 +17,7 @@ # # AC_PREREQ([2.69]) -AC_INIT([taler-exchange], [0.4.0], [taler-bug@gnunet.org]) +AC_INIT([taler-exchange], [0.5.0], [taler-bug@gnunet.org]) AC_CONFIG_SRCDIR([src/util/util.c]) AC_CONFIG_HEADERS([taler_config.h]) # support for non-recursive builds From 081ffe994a6d39cbd332eefe6f58f8015154e4cb Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 4 Apr 2018 17:01:59 +0200 Subject: [PATCH 4/8] expand logging of HARD errors in DB reserve inserts --- src/exchange/taler-exchange-wirewatch.c | 5 +++-- src/exchangedb/plugin_exchangedb_postgres.c | 8 +++++++- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/exchange/taler-exchange-wirewatch.c b/src/exchange/taler-exchange-wirewatch.c index e0985366d..f650690de 100644 --- a/src/exchange/taler-exchange-wirewatch.c +++ b/src/exchange/taler-exchange-wirewatch.c @@ -292,8 +292,8 @@ history_cb (void *cls, struct TALER_ReservePublicKeyP reserve_pub; GNUNET_log (GNUNET_ERROR_TYPE_DEBUG, - "Got history callback, direction %u!\n", (unsigned int) dir); - + "Got history callback, direction %u!\n", + (unsigned int) dir); if (TALER_BANK_DIRECTION_NONE == dir) { hh = NULL; @@ -308,6 +308,7 @@ history_cb (void *cls, "End of list. Committing progress!\n"); qs = db_plugin->commit (db_plugin->cls, session); + GNUNET_break (0 <= qs); if ( (GNUNET_YES == delay) && (test_mode) ) { diff --git a/src/exchangedb/plugin_exchangedb_postgres.c b/src/exchangedb/plugin_exchangedb_postgres.c index 6c6330556..63ed8874e 100644 --- a/src/exchangedb/plugin_exchangedb_postgres.c +++ b/src/exchangedb/plugin_exchangedb_postgres.c @@ -1912,7 +1912,10 @@ postgres_reserves_in_insert (void *cls, "reserve_create", params); if (0 > qs) + { + GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR != qs); return qs; + } if (GNUNET_DB_STATUS_SUCCESS_NO_RESULTS == qs) { /* Maybe DB did not detect serializiability error already, @@ -1938,7 +1941,10 @@ postgres_reserves_in_insert (void *cls, "reserves_in_add_transaction", params); if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT != qs) + { + GNUNET_break (GNUNET_DB_STATUS_HARD_ERROR != qs); return qs; + } } if (GNUNET_DB_STATUS_SUCCESS_ONE_RESULT == reserve_exists) @@ -1957,7 +1963,7 @@ postgres_reserves_in_insert (void *cls, balance)) { /* currency overflow or incompatible currency */ - GNUNET_log (GNUNET_ERROR_TYPE_WARNING, + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, "Attempt to deposit incompatible amount into reserve\n"); return GNUNET_DB_STATUS_HARD_ERROR; } From f9a86ba5dc017036cf927b40431073473c9c4245 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 4 Apr 2018 17:04:51 +0200 Subject: [PATCH 5/8] expand logging of wirewatch shutdown --- src/exchange/taler-exchange-wirewatch.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/exchange/taler-exchange-wirewatch.c b/src/exchange/taler-exchange-wirewatch.c index f650690de..508f8c32b 100644 --- a/src/exchange/taler-exchange-wirewatch.c +++ b/src/exchange/taler-exchange-wirewatch.c @@ -246,10 +246,10 @@ reject_cb (void *cls, rt = NULL; if (TALER_EC_NONE != ec) { - fprintf (stderr, - "Failed to wire back transfer `%s': %d\n", - rtc->wtid_s, - ec); + GNUNET_log (GNUNET_ERROR_TYPE_ERROR, + "Failed to wire back transfer `%s': %d\n", + rtc->wtid_s, + ec); GNUNET_free (rtc->wtid_s); db_plugin->rollback (db_plugin->cls, rtc->session); @@ -312,6 +312,8 @@ history_cb (void *cls, if ( (GNUNET_YES == delay) && (test_mode) ) { + GNUNET_log (GNUNET_ERROR_TYPE_INFO, + "Shutdown due to test mode!\n"); GNUNET_SCHEDULER_shutdown (); return GNUNET_OK; } From 2e65fa836689bf343ec71e44be8eee77e21ee442 Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Fri, 6 Apr 2018 00:36:30 +0200 Subject: [PATCH 6/8] fix comment --- src/bank-lib/bank_api_history.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/bank-lib/bank_api_history.c b/src/bank-lib/bank_api_history.c index d2035e881..14a206a42 100644 --- a/src/bank-lib/bank_api_history.c +++ b/src/bank-lib/bank_api_history.c @@ -156,7 +156,7 @@ parse_account_history (struct TALER_BANK_HistoryHandle *hh, /** * Function called when we're done processing the - * HTTP /admin/add/incoming request. + * HTTP /history request. * * @param cls the `struct TALER_BANK_HistoryHandle` * @param response_code HTTP response code, 0 on error From cb1548d1a080e8d05624482534205318796a802f Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Fri, 6 Apr 2018 00:36:45 +0200 Subject: [PATCH 7/8] avoid dangling pointer --- src/wire/plugin_wire_test.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/wire/plugin_wire_test.c b/src/wire/plugin_wire_test.c index 11feaea7e..a81ccdad9 100644 --- a/src/wire/plugin_wire_test.c +++ b/src/wire/plugin_wire_test.c @@ -869,6 +869,12 @@ bhist_cb (void *cls, GNUNET_free (subject); wd.account_details = details->account_details; + GNUNET_break (NULL != whh->hh); + + /* Once we get the sentinel element, the handle becomes invalid. */ + if (TALER_BANK_DIRECTION_NONE == dir) + whh->hh = NULL; + if ( (NULL != whh->hres_cb) && (GNUNET_OK != whh->hres_cb (whh->hres_cb_cls, @@ -1007,7 +1013,11 @@ static void test_get_history_cancel (void *cls, struct TALER_WIRE_HistoryHandle *whh) { - TALER_BANK_history_cancel (whh->hh); + if (NULL != whh->hh) + { + TALER_BANK_history_cancel (whh->hh); + whh->hh = NULL; + } GNUNET_free (whh); } From 1b3bf1a00126baffd016676ad1d668637b8b2efe Mon Sep 17 00:00:00 2001 From: Florian Dold Date: Fri, 6 Apr 2018 00:58:15 +0200 Subject: [PATCH 8/8] disable /keys cherrypicking until #5315 is addressed --- src/exchange-lib/exchange_api_handle.c | 4 ++-- src/exchange-lib/test_exchange_api_keys_cherry_picking.c | 4 ++++ .../test_exchange_api_keys_cherry_picking_new.c | 7 ++++++- src/include/taler_exchange_service.h | 7 +++++++ 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/src/exchange-lib/exchange_api_handle.c b/src/exchange-lib/exchange_api_handle.c index e3f8314f4..026fa87aa 100644 --- a/src/exchange-lib/exchange_api_handle.c +++ b/src/exchange-lib/exchange_api_handle.c @@ -867,7 +867,7 @@ keys_completed_cb (void *cls, { /* offsets will map 1:1 */ unsigned int off = aold->denom_keys[j] - kd_old.denom_keys; - + /* FIXME(#5315): this should not be an assert! */ GNUNET_assert (off < kd_old.num_denom_keys); anew->denom_keys[j] = &kd.denom_keys[off]; } @@ -1127,7 +1127,7 @@ request_keys (struct TALER_EXCHANGE_Handle *exchange) GNUNET_assert (NULL == exchange->kr); kr = GNUNET_new (struct KeysRequest); kr->exchange = exchange; - if (GNUNET_YES == MAH_handle_is_ready (exchange)) + if (GNUNET_YES == MAH_handle_is_ready (exchange) && !TALER_EXCHANGE_API_DISABLE_CHERRYPICKING) { char *arg; diff --git a/src/exchange-lib/test_exchange_api_keys_cherry_picking.c b/src/exchange-lib/test_exchange_api_keys_cherry_picking.c index 0fbf1729a..e5fd22a1a 100644 --- a/src/exchange-lib/test_exchange_api_keys_cherry_picking.c +++ b/src/exchange-lib/test_exchange_api_keys_cherry_picking.c @@ -579,7 +579,11 @@ run (void *cls) /* Re-download and check /keys */ { .oc = OC_CHECK_KEYS, .details.check_keys.generation = 2, +#if TALER_EXCHANGE_API_DISABLE_CHERRYPICKING + .details.check_keys.num_denom_keys = 12 +#else .details.check_keys.num_denom_keys = 8 +#endif }, { .oc = OC_END } }; diff --git a/src/exchange-lib/test_exchange_api_keys_cherry_picking_new.c b/src/exchange-lib/test_exchange_api_keys_cherry_picking_new.c index 41d5dac84..aa711436a 100644 --- a/src/exchange-lib/test_exchange_api_keys_cherry_picking_new.c +++ b/src/exchange-lib/test_exchange_api_keys_cherry_picking_new.c @@ -84,7 +84,12 @@ run (void *cls, SIGUSR1), TALER_TESTING_cmd_check_keys ("check-keys-2", - 2, 8, + 2, +#if TALER_EXCHANGE_API_DISABLE_CHERRYPICKING + 12, +#else + 8, +#endif is->exchange), diff --git a/src/include/taler_exchange_service.h b/src/include/taler_exchange_service.h index 30ea4ce66..54188e36b 100644 --- a/src/include/taler_exchange_service.h +++ b/src/include/taler_exchange_service.h @@ -31,6 +31,13 @@ /* ********************* /keys *********************** */ +/** + * Temporarily disable cherrypicking until it's fixed. + * See #5315. + */ +#define TALER_EXCHANGE_API_DISABLE_CHERRYPICKING 1 + + /** * List of possible options to be passed to * #TALER_EXCHANGE_connect().