From e2ab079dd8a2e72c4c2b41ac9bf4b0da10c2ac1f Mon Sep 17 00:00:00 2001 From: Fournier Nicolas Date: Wed, 24 Jun 2015 10:55:57 +0200 Subject: [PATCH 1/9] fixed gauger command in the interpreter --- src/mintdb/perf_taler_mintdb.c | 53 +++++++++++++--------- src/mintdb/perf_taler_mintdb_interpreter.c | 2 +- src/mintdb/perf_taler_mintdb_interpreter.h | 42 ++++++++++++----- src/mintdb/perf_taler_mintdb_values.h | 32 ++++++------- 4 files changed, 77 insertions(+), 52 deletions(-) diff --git a/src/mintdb/perf_taler_mintdb.c b/src/mintdb/perf_taler_mintdb.c index 0b1e48075..a39fdd811 100644 --- a/src/mintdb/perf_taler_mintdb.c +++ b/src/mintdb/perf_taler_mintdb.c @@ -33,30 +33,41 @@ main (int argc, char ** argv) struct GNUNET_CONFIGURATION_Handle *config; struct PERF_TALER_MINTDB_Cmd test[] = { - PERF_TALER_MINTDB_INIT_CMD_LOOP ("loop_db_init_deposit",10000), - PERF_TALER_MINTDB_INIT_CMD_START_TRANSACTION ("start_transaction_init"), - PERF_TALER_MINTDB_INIT_CMD_INSERT_DEPOSIT ("init_deposit_insert"), - PERF_TALER_MINTDB_INIT_CMD_COMMIT_TRANSACTION ("commit_transaction_init"), - PERF_TALER_MINTDB_INIT_CMD_SAVE_ARRAY ("array_depo", - "loop_db_init_deposit", - "init_deposit_insert", - 100, - PERF_TALER_MINTDB_DEPOSIT), + PERF_TALER_MINTDB_INIT_CMD_LOOP ("loop_db_init_deposit", + PERF_TALER_MINTDB_NB_DEPOSIT_INIT), + PERF_TALER_MINTDB_INIT_CMD_START_TRANSACTION ("start_transaction_init"), + PERF_TALER_MINTDB_INIT_CMD_INSERT_DEPOSIT ("init_deposit_insert"), + PERF_TALER_MINTDB_INIT_CMD_COMMIT_TRANSACTION ("commit_transaction_init"), + PERF_TALER_MINTDB_INIT_CMD_DEBUG("INIT_LOOP"), + PERF_TALER_MINTDB_INIT_CMD_SAVE_ARRAY ("array_depo", + "loop_db_init_deposit", + "init_deposit_insert", + PERF_TALER_MINTDB_NB_DEPOSIT_GET, + PERF_TALER_MINTDB_DEPOSIT), PERF_TALER_MINTDB_INIT_CMD_END_LOOP ("endloop_init_deposit", "loop_db_init_deposit"), - PERF_TALER_MINTDB_INIT_CMD_DEBUG("Fin loop 1"), - PERF_TALER_MINTDB_INIT_CMD_LOOP ("loop_deposit_get",100), - PERF_TALER_MINTDB_INIT_CMD_START_TRANSACTION ("start_transaction_get"), - PERF_TALER_MINTDB_INIT_CMD_LOAD_ARRAY("load deposit", - "loop_deposit_get", - "array_depo"), - PERF_TALER_MINTDB_INIT_CMD_GET_DEPOSIT("get_deposit", - "load_deposit"), - PERF_TALER_MINTDB_INIT_CMD_COMMIT_TRANSACTION ("commit_transaction_init"), - PERF_TALER_MINTDB_INIT_CMD_END_LOOP("stop2", "loop_deposit_get"), - PERF_TALER_MINTDB_INIT_CMD_END("end") + PERF_TALER_MINTDB_INIT_CMD_DEBUG("INIT_END"), + // End of database initialization + PERF_TALER_MINTDB_INIT_CMD_GET_TIME ("deposit_get_start"), + PERF_TALER_MINTDB_INIT_CMD_LOOP ("loop_deposit_get", + PERF_TALER_MINTDB_NB_DEPOSIT_GET), + PERF_TALER_MINTDB_INIT_CMD_START_TRANSACTION ("start_transaction_get"), + PERF_TALER_MINTDB_INIT_CMD_LOAD_ARRAY ("load deposit", + "loop_deposit_get", + "array_depo"), + PERF_TALER_MINTDB_INIT_CMD_GET_DEPOSIT ("get_deposit", + "load_deposit"), + PERF_TALER_MINTDB_INIT_CMD_COMMIT_TRANSACTION ("commit_transaction_init"), + PERF_TALER_MINTDB_INIT_CMD_END_LOOP ("stop2", "loop_deposit_get"), + PERF_TALER_MINTDB_INIT_CMD_GET_TIME ("deposit_get_end"), + PERF_TALER_MINTDB_INIT_CMD_GAUGER ("deposit_get_commit", + "deposit_get_start", + "deposit_get_end", + "time per deposit check", + PERF_TALER_MINTDB_NB_DEPOSIT_GET), + PERF_TALER_MINTDB_INIT_CMD_END("end"), }; - // Plugin init + // Plugin init config = GNUNET_CONFIGURATION_create(); GNUNET_CONFIGURATION_load(config, "./test-mint-db-postgres.conf"); GNUNET_assert (NULL != diff --git a/src/mintdb/perf_taler_mintdb_interpreter.c b/src/mintdb/perf_taler_mintdb_interpreter.c index d7d3a6d00..4d7a17cbb 100644 --- a/src/mintdb/perf_taler_mintdb_interpreter.c +++ b/src/mintdb/perf_taler_mintdb_interpreter.c @@ -407,7 +407,7 @@ interpret (struct PERF_TALER_MINTDB_interpreter_state *state) GAUGER ("MINTDB", state->cmd[state->i].details.gauger.description, - elapsed_ms, + elapsed_ms / state->cmd[state->i].details.gauger.divide, "milliseconds"); } break; diff --git a/src/mintdb/perf_taler_mintdb_interpreter.h b/src/mintdb/perf_taler_mintdb_interpreter.h index 798660313..164379076 100644 --- a/src/mintdb/perf_taler_mintdb_interpreter.h +++ b/src/mintdb/perf_taler_mintdb_interpreter.h @@ -58,7 +58,7 @@ .exposed_type = PERF_TALER_MINTDB_NONE , \ .details.loop = { \ .max_iterations = _iter , \ - .curr_iteration = 0} \ + .curr_iteration = 0 } \ } /** @@ -86,15 +86,16 @@ * Commits the duration between @a _label_start and @a _label_stop * to Gauger with @a _description explaining */ -#define PERF_TALER_MINTDB_INIT_CMD_GAUGER(_label, _start_time, _stop_time, _description) \ +#define PERF_TALER_MINTDB_INIT_CMD_GAUGER(_label, _label_start, _label_stop, _description, _divide) \ { \ .command = PERF_TALER_MINTDB_CMD_GAUGER, \ .label = _label, \ .exposed_type = PERF_TALER_MINTDB_NONE, \ .details.gauger = { \ .label_start = _label_start, \ - .label_end = _label_end, \ - .description = _description \ + .label_stop = _label_stop, \ + .description = _description, \ + .divide = _divide, \ } \ } @@ -249,9 +250,7 @@ enum PERF_TALER_MINTDB_Type PERF_TALER_MINTDB_TIME, PERF_TALER_MINTDB_DEPOSIT, PERF_TALER_MINTDB_BLINDCOIN, - PERF_TALER_MINTDB_RESERVE_KEY, PERF_TALER_MINTDB_RESERVE, - PERF_TALER_MINTDB_DENOMINATION_KEY, PERF_TALER_MINTDB_DENOMINATION_INFO, PERF_TALER_MINTDB_COIN_INFO, }; @@ -266,7 +265,6 @@ union PERF_TALER_MINTDB_Data struct TALER_MINTDB_Deposit *deposit; struct TALER_MINTDB_CollectableBlindcoin *blindcoin; struct TALER_MINTDB_Reserve *reserve; - struct TALER_DenominationPublicKey *dpk; struct TALER_MINTDB_DenominationKeyIssueInformation *dki; struct TALER_CoinPublicInfo *cpi; }; @@ -334,8 +332,11 @@ enum PERF_TALER_MINTDB_CMD_Name // Insert informations about a denomination key in the database PERF_TALER_MINTDB_CMD_INSERT_DENOMINATION, - // polls the database for informations about a specific denomination key - PERF_TALER_MINTDB_CMD_GET_DENOMINATION + // Polls the database for informations about a specific denomination key + PERF_TALER_MINTDB_CMD_GET_DENOMINATION, + + // Refresh a coin + PERF_TALER_MINTDB_CMD_REFRESH_COIN, }; @@ -381,6 +382,12 @@ struct PERF_TALER_MINTDB_CMD_gauger_details * Description of the metric, used in GAUGER */ const char *description; + + /** + * Constant the result needs to be divided by + * to get the result per unit + */ + float divide; }; @@ -470,6 +477,19 @@ struct PERF_TALER_MINTDB_CMD_get_denomination_details const char *label_source; }; + +/** + * Extra data requiered for refreshing coins + */ +struct PERF_TALER_MINTDB_CMD_refresh_coin_details +{ + /** + * The label of the coin to refresh + */ + const char *label_source; +}; + + /** * Contains extra data required for any command */ @@ -483,6 +503,7 @@ union PERF_TALER_MINTDB_CMD_Details struct PERF_TALER_MINTDB_CMD_get_deposit_details get_deposit; struct PERF_TALER_MINTDB_CMD_get_reserve_details get_reserve; struct PERF_TALER_MINTDB_CMD_get_denomination_details get_denomination; + struct PERF_TALER_MINTDB_CMD_refresh_coin_details refresh; }; @@ -520,7 +541,7 @@ struct PERF_TALER_MINTDB_Cmd * GNUNET_YES if the exposed value hav been saved during last loop iteration * GNUNET_NO if it hasn't */ - int exposed_saved; + unsigned int exposed_saved; }; @@ -533,5 +554,4 @@ PERF_TALER_MINTDB_interpret( struct TALER_MINTDB_Plugin *db_plugin, struct PERF_TALER_MINTDB_Cmd cmd[]); - #endif diff --git a/src/mintdb/perf_taler_mintdb_values.h b/src/mintdb/perf_taler_mintdb_values.h index f180c8d7e..4b982b8bd 100644 --- a/src/mintdb/perf_taler_mintdb_values.h +++ b/src/mintdb/perf_taler_mintdb_values.h @@ -1,18 +1,18 @@ /* - This file is part of TALER - Copyright (C) 2014, 2015 Christian Grothoff (and other contributing authors) + This file is part of TALER + Copyright (C) 2014, 2015 Christian Grothoff (and other contributing authors) - TALER is free software; you can redistribute it and/or modify it under the - terms of the GNU General Public License as published by the Free Software - Foundation; either version 3, or (at your option) any later version. + TALER is free software; you can redistribute it and/or modify it under the + terms of the GNU General Public License as published by the Free Software + Foundation; either version 3, or (at your option) any later version. - TALER is distributed in the hope that it will be useful, but WITHOUT ANY - WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR - A PARTICULAR PURPOSE. See the GNU General Public License for more details. + TALER is distributed in the hope that it will be useful, but WITHOUT ANY + WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR + A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License along with - TALER; see the file COPYING. If not, If not, see -*/ + You should have received a copy of the GNU General Public License along with + TALER; see the file COPYING. If not, If not, see + */ /** * @file mintdb/perf_taler_mintdb_values.h * @brief Values for tweaking the performance analysis @@ -23,15 +23,9 @@ -#define NB_DEPOSIT_INIT 100000 -#define NB_DEPOSIT_GET 1000 -#define NB_DEPOSIT_MARGIN 10000 +#define PERF_TALER_MINTDB_NB_DEPOSIT_INIT 100 +#define PERF_TALER_MINTDB_NB_DEPOSIT_GET 10 -#define NB_BLINDCOIN_INIT 100000 - - -// Temporary macro to compile -#define GAUGER(a,b,c,d) #endif From c3b29bf7e70b3e7f36a4e1c6eb18f5a665baf8fc Mon Sep 17 00:00:00 2001 From: Fournier Nicolas Date: Wed, 24 Jun 2015 14:42:03 +0200 Subject: [PATCH 2/9] Fixed unconsistent signed/unsigned declaration --- src/mintdb/perf_taler_mintdb.c | 1 - src/mintdb/perf_taler_mintdb_interpreter.c | 22 +++++++++++----------- src/mintdb/perf_taler_mintdb_interpreter.h | 2 +- 3 files changed, 12 insertions(+), 13 deletions(-) diff --git a/src/mintdb/perf_taler_mintdb.c b/src/mintdb/perf_taler_mintdb.c index a39fdd811..48a7dd743 100644 --- a/src/mintdb/perf_taler_mintdb.c +++ b/src/mintdb/perf_taler_mintdb.c @@ -38,7 +38,6 @@ main (int argc, char ** argv) PERF_TALER_MINTDB_INIT_CMD_START_TRANSACTION ("start_transaction_init"), PERF_TALER_MINTDB_INIT_CMD_INSERT_DEPOSIT ("init_deposit_insert"), PERF_TALER_MINTDB_INIT_CMD_COMMIT_TRANSACTION ("commit_transaction_init"), - PERF_TALER_MINTDB_INIT_CMD_DEBUG("INIT_LOOP"), PERF_TALER_MINTDB_INIT_CMD_SAVE_ARRAY ("array_depo", "loop_db_init_deposit", "init_deposit_insert", diff --git a/src/mintdb/perf_taler_mintdb_interpreter.c b/src/mintdb/perf_taler_mintdb_interpreter.c index 4d7a17cbb..b54fda1c9 100644 --- a/src/mintdb/perf_taler_mintdb_interpreter.c +++ b/src/mintdb/perf_taler_mintdb_interpreter.c @@ -47,7 +47,7 @@ struct PERF_TALER_MINTDB_interpreter_state /** * The current index of the interpreter */ - int i; + unsigned int i; }; /** @@ -99,7 +99,7 @@ data_free (union PERF_TALER_MINTDB_Data *data, enum PERF_TALER_MINTDB_Type type) static int cmd_find (const struct PERF_TALER_MINTDB_Cmd *cmd, const char *search) { - int i; + unsigned int i; for (i=0; PERF_TALER_MINTDB_CMD_END != cmd[i].command; i++) if (0 == strcmp (cmd[i].label, search)) @@ -114,7 +114,7 @@ cmd_find (const struct PERF_TALER_MINTDB_Cmd *cmd, const char *search) static int cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[]) { - int i = 0; + unsigned int i = 0; for (i=0; PERF_TALER_MINTDB_CMD_END != cmd[i].command; i++) { @@ -158,7 +158,7 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[]) static int cmd_clean (struct PERF_TALER_MINTDB_Cmd cmd[]) { - int i = 0; + unsigned int i = 0; for (i = 0; PERF_TALER_MINTDB_CMD_END != cmd[i].command; i++) { @@ -166,7 +166,7 @@ cmd_clean (struct PERF_TALER_MINTDB_Cmd cmd[]) { case PERF_TALER_MINTDB_CMD_SAVE_ARRAY: { - int j; + unsigned int j; for (j = 0; j < cmd[i].details.save_array.nb_saved; j++) { data_free (&cmd[i].details.save_array.data_saved[j], @@ -198,9 +198,9 @@ cmd_clean (struct PERF_TALER_MINTDB_Cmd cmd[]) static void interpret_end_loop (struct PERF_TALER_MINTDB_interpreter_state *state) { - int i; + unsigned int i; union PERF_TALER_MINTDB_Data zero = {0}; - int jump = cmd_find (state->cmd, + unsigned int jump = cmd_find (state->cmd, state->cmd[state->i].details.end_loop.label_loop); // Cleaning up the memory in the loop for (i = jump; i < state->i; i++) @@ -234,8 +234,8 @@ interpret_end_loop (struct PERF_TALER_MINTDB_interpreter_state *state) static void interpret_save_array (struct PERF_TALER_MINTDB_interpreter_state *state) { - int loop_index; - int selection_chance; + unsigned int loop_index; + unsigned int selection_chance; // Array initialization on first loop iteration // Alows for nested loops @@ -316,7 +316,7 @@ interpret_save_array (struct PERF_TALER_MINTDB_interpreter_state *state) static void interpret_load_array (struct PERF_TALER_MINTDB_interpreter_state *state) { - int loop_index, save_index; + unsigned int loop_index, save_index; union PERF_TALER_MINTDB_Data zero = {0}; union PERF_TALER_MINTDB_Data *loaded_data; @@ -392,7 +392,7 @@ interpret (struct PERF_TALER_MINTDB_interpreter_state *state) case PERF_TALER_MINTDB_CMD_GAUGER: { - int start_index, stop_index; + unsigned int start_index, stop_index; struct timespec start, stop; unsigned long elapsed_ms; diff --git a/src/mintdb/perf_taler_mintdb_interpreter.h b/src/mintdb/perf_taler_mintdb_interpreter.h index 164379076..49f06b6ea 100644 --- a/src/mintdb/perf_taler_mintdb_interpreter.h +++ b/src/mintdb/perf_taler_mintdb_interpreter.h @@ -347,7 +347,7 @@ struct PERF_TALER_MINTDB_CMD_loop_details { // Maximum number of iteration in the loop const unsigned int max_iterations; - int curr_iteration; + unsigned int curr_iteration; }; From 47262f4316874f321ffdcbcdcb1d98c182375730 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Thu, 25 Jun 2015 15:31:15 +0200 Subject: [PATCH 3/9] NPE detection --- src/mintdb/perf_taler_mintdb.c | 26 ++++--- src/mintdb/perf_taler_mintdb_interpreter.c | 88 +++++++++++----------- 2 files changed, 59 insertions(+), 55 deletions(-) diff --git a/src/mintdb/perf_taler_mintdb.c b/src/mintdb/perf_taler_mintdb.c index 48a7dd743..ed7e80b3d 100644 --- a/src/mintdb/perf_taler_mintdb.c +++ b/src/mintdb/perf_taler_mintdb.c @@ -31,17 +31,17 @@ main (int argc, char ** argv) { struct TALER_MINTDB_Plugin *plugin; struct GNUNET_CONFIGURATION_Handle *config; - struct PERF_TALER_MINTDB_Cmd test[] = + struct PERF_TALER_MINTDB_Cmd test[] = { - PERF_TALER_MINTDB_INIT_CMD_LOOP ("loop_db_init_deposit", + PERF_TALER_MINTDB_INIT_CMD_LOOP ("loop_db_init_deposit", PERF_TALER_MINTDB_NB_DEPOSIT_INIT), PERF_TALER_MINTDB_INIT_CMD_START_TRANSACTION ("start_transaction_init"), PERF_TALER_MINTDB_INIT_CMD_INSERT_DEPOSIT ("init_deposit_insert"), PERF_TALER_MINTDB_INIT_CMD_COMMIT_TRANSACTION ("commit_transaction_init"), - PERF_TALER_MINTDB_INIT_CMD_SAVE_ARRAY ("array_depo", - "loop_db_init_deposit", - "init_deposit_insert", - PERF_TALER_MINTDB_NB_DEPOSIT_GET, + PERF_TALER_MINTDB_INIT_CMD_SAVE_ARRAY ("array_depo", + "loop_db_init_deposit", + "init_deposit_insert", + PERF_TALER_MINTDB_NB_DEPOSIT_GET, PERF_TALER_MINTDB_DEPOSIT), PERF_TALER_MINTDB_INIT_CMD_END_LOOP ("endloop_init_deposit", "loop_db_init_deposit"), @@ -51,22 +51,26 @@ main (int argc, char ** argv) PERF_TALER_MINTDB_INIT_CMD_LOOP ("loop_deposit_get", PERF_TALER_MINTDB_NB_DEPOSIT_GET), PERF_TALER_MINTDB_INIT_CMD_START_TRANSACTION ("start_transaction_get"), - PERF_TALER_MINTDB_INIT_CMD_LOAD_ARRAY ("load deposit", - "loop_deposit_get", + PERF_TALER_MINTDB_INIT_CMD_LOAD_ARRAY ("load deposit", + "loop_deposit_get", "array_depo"), - PERF_TALER_MINTDB_INIT_CMD_GET_DEPOSIT ("get_deposit", + PERF_TALER_MINTDB_INIT_CMD_GET_DEPOSIT ("get_deposit", "load_deposit"), PERF_TALER_MINTDB_INIT_CMD_COMMIT_TRANSACTION ("commit_transaction_init"), PERF_TALER_MINTDB_INIT_CMD_END_LOOP ("stop2", "loop_deposit_get"), PERF_TALER_MINTDB_INIT_CMD_GET_TIME ("deposit_get_end"), - PERF_TALER_MINTDB_INIT_CMD_GAUGER ("deposit_get_commit", - "deposit_get_start", + PERF_TALER_MINTDB_INIT_CMD_GAUGER ("deposit_get_commit", + "deposit_get_start", "deposit_get_end", "time per deposit check", PERF_TALER_MINTDB_NB_DEPOSIT_GET), PERF_TALER_MINTDB_INIT_CMD_END("end"), }; // Plugin init + + GNUNET_log_setup ("perf-taler-mintdb", + "WARNING", + NULL); config = GNUNET_CONFIGURATION_create(); GNUNET_CONFIGURATION_load(config, "./test-mint-db-postgres.conf"); GNUNET_assert (NULL != diff --git a/src/mintdb/perf_taler_mintdb_interpreter.c b/src/mintdb/perf_taler_mintdb_interpreter.c index b54fda1c9..dd36ae6d2 100644 --- a/src/mintdb/perf_taler_mintdb_interpreter.c +++ b/src/mintdb/perf_taler_mintdb_interpreter.c @@ -86,7 +86,7 @@ data_free (union PERF_TALER_MINTDB_Data *data, enum PERF_TALER_MINTDB_Type type) default: return; } -} +} @@ -109,7 +109,7 @@ cmd_find (const struct PERF_TALER_MINTDB_Cmd *cmd, const char *search) /** - * Initialization of a command array + * Initialization of a command array */ static int cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[]) @@ -122,8 +122,8 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[]) { case PERF_TALER_MINTDB_CMD_SAVE_ARRAY: // Allocation of memory for saving data - cmd[i].details.save_array.data_saved = - GNUNET_new_array (cmd[i].details.save_array.nb_saved, + cmd[i].details.save_array.data_saved = + GNUNET_new_array (cmd[i].details.save_array.nb_saved, union PERF_TALER_MINTDB_Data); break; @@ -133,13 +133,13 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[]) (cmd[i].details.load_array.permutation = GNUNET_CRYPTO_random_permute ( GNUNET_CRYPTO_QUALITY_WEAK, - cmd[cmd_find (cmd, + cmd[cmd_find (cmd, cmd[i].details .load_array.label_save)] .details.save_array.nb_saved))); // Initializing the type based on the type of the saved array - cmd[i].exposed_type = cmd[cmd_find (cmd, + cmd[i].exposed_type = cmd[cmd_find (cmd, cmd[i].details.load_array.label_save)] .details.save_array.type_saved; break; @@ -200,7 +200,7 @@ interpret_end_loop (struct PERF_TALER_MINTDB_interpreter_state *state) { unsigned int i; union PERF_TALER_MINTDB_Data zero = {0}; - unsigned int jump = cmd_find (state->cmd, + unsigned int jump = cmd_find (state->cmd, state->cmd[state->i].details.end_loop.label_loop); // Cleaning up the memory in the loop for (i = jump; i < state->i; i++) @@ -215,7 +215,7 @@ interpret_end_loop (struct PERF_TALER_MINTDB_interpreter_state *state) state->cmd[jump].details.loop.curr_iteration++; // If the loop is not finished - if (state->cmd[jump].details.loop.max_iterations > + if (state->cmd[jump].details.loop.max_iterations > state->cmd[jump].details.loop.curr_iteration) { // jump back to the start @@ -239,16 +239,16 @@ interpret_save_array (struct PERF_TALER_MINTDB_interpreter_state *state) // Array initialization on first loop iteration // Alows for nested loops - if (0 == state->cmd[cmd_find (state->cmd, + if (0 == state->cmd[cmd_find (state->cmd, state->cmd[state->i] .details.save_array.label_loop)] .details.loop.curr_iteration) { state->cmd[state->i].details.save_array.index = 0; } - loop_index = cmd_find (state->cmd, + loop_index = cmd_find (state->cmd, state->cmd[state->i].details.save_array.label_loop); - // The probobility distribution of the saved items will be a little biased + // The probobility distribution of the saved items will be a little biased // against the few last items but it should not be a big problem. selection_chance = state->cmd[loop_index].details.loop.max_iterations / state->cmd[state->i].details.save_array.nb_saved; @@ -258,13 +258,13 @@ interpret_save_array (struct PERF_TALER_MINTDB_interpreter_state *state) * * Else it is saved only if rdn is 0 */ - if ((0 < (state->cmd[state->i].details.save_array.nb_saved - + if ((0 < (state->cmd[state->i].details.save_array.nb_saved - state->cmd[state->i].details.save_array.index)) && - (((state->cmd[loop_index].details.loop.max_iterations - + (((state->cmd[loop_index].details.loop.max_iterations - state->cmd[loop_index].details.loop.curr_iteration) == - (state->cmd[state->i].details.save_array.nb_saved - + (state->cmd[state->i].details.save_array.nb_saved - state->cmd[state->i].details.save_array.index)) - || (0 == GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, + || (0 == GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, selection_chance)))) { union PERF_TALER_MINTDB_Data *save_location; @@ -272,7 +272,7 @@ interpret_save_array (struct PERF_TALER_MINTDB_interpreter_state *state) save_location = &state->cmd[state->i].details.save_array .data_saved[state->cmd[state->i].details.save_array.index]; - item_saved = &state->cmd[cmd_find (state->cmd, + item_saved = &state->cmd[cmd_find (state->cmd, state->cmd[state->i] .details.save_array.label_save)] .exposed; @@ -320,9 +320,9 @@ interpret_load_array (struct PERF_TALER_MINTDB_interpreter_state *state) union PERF_TALER_MINTDB_Data zero = {0}; union PERF_TALER_MINTDB_Data *loaded_data; - loop_index = cmd_find (state->cmd, + loop_index = cmd_find (state->cmd, state->cmd[state->i].details.load_array.label_loop); - save_index = cmd_find (state->cmd, + save_index = cmd_find (state->cmd, state->cmd[state->i].details.load_array.label_save); /* Extracting the data from the loop_indexth indice in save_index * array. @@ -362,7 +362,7 @@ interpret_load_array (struct PERF_TALER_MINTDB_interpreter_state *state) /** * Main interpreter loop. - * + * */ static int interpret (struct PERF_TALER_MINTDB_interpreter_state *state) @@ -392,22 +392,22 @@ interpret (struct PERF_TALER_MINTDB_interpreter_state *state) case PERF_TALER_MINTDB_CMD_GAUGER: { - unsigned int start_index, stop_index; + unsigned int start_index, stop_index; struct timespec start, stop; unsigned long elapsed_ms; - start_index = cmd_find (state->cmd, + start_index = cmd_find (state->cmd, state->cmd[state->i].details.gauger.label_start); - stop_index = cmd_find (state->cmd, + stop_index = cmd_find (state->cmd, state->cmd[state->i].details.gauger.label_stop); start = state->cmd[start_index].exposed.time; stop = state->cmd[stop_index].exposed.time; - elapsed_ms = (start.tv_sec - stop.tv_sec) * 1000 + + elapsed_ms = (start.tv_sec - stop.tv_sec) * 1000 + (start.tv_nsec - stop.tv_nsec) / 1000000; - GAUGER ("MINTDB", - state->cmd[state->i].details.gauger.description, - elapsed_ms / state->cmd[state->i].details.gauger.divide, + GAUGER ("MINTDB", + state->cmd[state->i].details.gauger.description, + elapsed_ms / state->cmd[state->i].details.gauger.divide, "milliseconds"); } break; @@ -441,8 +441,8 @@ interpret (struct PERF_TALER_MINTDB_interpreter_state *state) PERF_TALER_MINTDB_deposit_init (); GNUNET_assert ( - state->plugin->insert_deposit (state->plugin->cls, - state->session, + state->plugin->insert_deposit (state->plugin->cls, + state->session, deposit)); state->cmd[state->i].exposed.deposit = deposit; } @@ -450,24 +450,24 @@ interpret (struct PERF_TALER_MINTDB_interpreter_state *state) case PERF_TALER_MINTDB_CMD_GET_DEPOSIT: { - struct TALER_MINTDB_Deposit *deposit = - state->cmd[cmd_find (state->cmd, + struct TALER_MINTDB_Deposit *deposit = + state->cmd[cmd_find (state->cmd, state->cmd[state->i] .details.get_deposit.label_source)] .exposed.deposit; // Get the deposit from the source - - state->plugin->have_deposit (state->plugin->cls, - state->session, + GNUNET_assert (NULL != deposit); + state->plugin->have_deposit (state->plugin->cls, + state->session, deposit); } break; - + case PERF_TALER_MINTDB_CMD_INSERT_RESERVE: { struct TALER_MINTDB_Reserve *reserve; json_t *details = json_pack ("si","justification", GNUNET_CRYPTO_random_u32 ( - GNUNET_CRYPTO_QUALITY_WEAK, + GNUNET_CRYPTO_QUALITY_WEAK, UINT32_MAX)); reserve = PERF_TALER_MINTDB_reserve_init (); state->plugin->reserves_in_insert ( @@ -476,7 +476,7 @@ interpret (struct PERF_TALER_MINTDB_interpreter_state *state) &reserve->pub, &reserve->balance, details - ); + ); json_decref (details); state->cmd[state->i].exposed.reserve = reserve; } @@ -485,16 +485,16 @@ interpret (struct PERF_TALER_MINTDB_interpreter_state *state) case PERF_TALER_MINTDB_CMD_GET_RESERVE: { struct TALER_MINTDB_Reserve *reserve = - state->cmd[cmd_find (state->cmd, + state->cmd[cmd_find (state->cmd, state->cmd[state->i] .details.get_reserve.label_source)] .exposed.reserve; // Get the deposit from the source - state->plugin->reserve_get (state->plugin->cls, - state->session, + state->plugin->reserve_get (state->plugin->cls, + state->session, reserve); } - break; + break; case PERF_TALER_MINTDB_CMD_INSERT_DENOMINATION: { @@ -512,7 +512,7 @@ interpret (struct PERF_TALER_MINTDB_interpreter_state *state) case PERF_TALER_MINTDB_CMD_GET_DENOMINATION: { struct TALER_MINTDB_DenominationKeyIssueInformation *dki = - state->cmd[cmd_find (state->cmd, + state->cmd[cmd_find (state->cmd, state->cmd[state->i] .details.get_denomination.label_source)] .exposed.dki; @@ -538,11 +538,11 @@ interpret (struct PERF_TALER_MINTDB_interpreter_state *state) case PERF_TALER_MINTDB_CMD_GET_WITHDRAW: { struct TALER_MINTDB_CollectableBlindcoin *blindcoin = - state->cmd[cmd_find (state->cmd, + state->cmd[cmd_find (state->cmd, state->cmd[state->i] .details.get_denomination.label_source)] .exposed.blindcoin; - + state->plugin->get_withdraw_info (state->plugin->cls, state->session, &blindcoin->h_coin_envelope, @@ -566,7 +566,7 @@ int PERF_TALER_MINTDB_interpret (struct TALER_MINTDB_Plugin *db_plugin, struct PERF_TALER_MINTDB_Cmd cmd[]) { - struct PERF_TALER_MINTDB_interpreter_state state = + struct PERF_TALER_MINTDB_interpreter_state state = {.i = 0, .cmd = cmd, .plugin = db_plugin}; // Initializing commands From d98eabf6c30d589bffaf7a1dba4df51c26d56c74 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 26 Jun 2015 09:03:18 +0200 Subject: [PATCH 4/9] handle response code 0 more nicely --- src/mint-lib/mint_api_deposit.c | 2 ++ src/mint-lib/mint_api_handle.c | 24 ++++++++++++++++++++++++ src/mint-lib/mint_api_withdraw.c | 4 ++++ 3 files changed, 30 insertions(+) diff --git a/src/mint-lib/mint_api_deposit.c b/src/mint-lib/mint_api_deposit.c index f0cacb607..8c823bd01 100644 --- a/src/mint-lib/mint_api_deposit.c +++ b/src/mint-lib/mint_api_deposit.c @@ -343,6 +343,8 @@ handle_deposit_finished (void *cls, } switch (response_code) { + case 0: + break; case MHD_HTTP_OK: if (GNUNET_OK != verify_deposit_signature_ok (dh, diff --git a/src/mint-lib/mint_api_handle.c b/src/mint-lib/mint_api_handle.c index 530cd6062..6bcae9f60 100644 --- a/src/mint-lib/mint_api_handle.c +++ b/src/mint-lib/mint_api_handle.c @@ -574,8 +574,32 @@ keys_completed_cb (void *cls, { struct KeysRequest *kr = cls; struct TALER_MINT_Handle *mint = kr->mint; + long response_code; /* FIXME: might want to check response code? */ + if (CURLE_OK != + curl_easy_getinfo (eh, + CURLINFO_RESPONSE_CODE, + &response_code)) + { + /* unexpected error... */ + GNUNET_break (0); + response_code = 0; + } + switch (response_code) { + case 0: + kr->errno = 1; + break; + case MHD_HTTP_OK: + break; + default: + GNUNET_log (GNUNET_ERROR_TYPE_WARNING, + "Mint returned status code %u for /keys\n", + response_code); + kr->errno = 1; + break; + } + if ( (0 != kr->eno) || (GNUNET_OK != parse_response_keys_get (kr)) ) diff --git a/src/mint-lib/mint_api_withdraw.c b/src/mint-lib/mint_api_withdraw.c index b877cf4d3..c79f57dad 100644 --- a/src/mint-lib/mint_api_withdraw.c +++ b/src/mint-lib/mint_api_withdraw.c @@ -324,6 +324,8 @@ handle_withdraw_status_finished (void *cls, } switch (response_code) { + case 0: + break; case MHD_HTTP_OK: { json_t *history; @@ -818,6 +820,8 @@ handle_withdraw_sign_finished (void *cls, } switch (response_code) { + case 0: + break; case MHD_HTTP_OK: if (GNUNET_OK != withdraw_sign_ok (wsh, From 5963e1136fcc566e9fc3070839ddaee518854d8f Mon Sep 17 00:00:00 2001 From: Fournier Nicolas Date: Fri, 26 Jun 2015 15:32:20 +0200 Subject: [PATCH 5/9] Remade memory management strategy of the interpreter. --- src/mintdb/perf_taler_mintdb.c | 10 +- src/mintdb/perf_taler_mintdb_init.c | 119 ++++++++++-- src/mintdb/perf_taler_mintdb_init.h | 34 +++- src/mintdb/perf_taler_mintdb_interpreter.c | 210 ++++++++++++--------- src/mintdb/perf_taler_mintdb_interpreter.h | 56 ++++-- src/mintdb/perf_taler_mintdb_values.h | 2 +- 6 files changed, 314 insertions(+), 117 deletions(-) diff --git a/src/mintdb/perf_taler_mintdb.c b/src/mintdb/perf_taler_mintdb.c index ed7e80b3d..50d351e2a 100644 --- a/src/mintdb/perf_taler_mintdb.c +++ b/src/mintdb/perf_taler_mintdb.c @@ -33,10 +33,15 @@ main (int argc, char ** argv) struct GNUNET_CONFIGURATION_Handle *config; struct PERF_TALER_MINTDB_Cmd test[] = { + // Denomination used to create coins + PERF_TALER_MINTDB_INIT_CMD_INSERT_DENOMINATION ("denomination"), + + PERF_TALER_MINTDB_INIT_CMD_DEBUG ("denomination inserted"), PERF_TALER_MINTDB_INIT_CMD_LOOP ("loop_db_init_deposit", PERF_TALER_MINTDB_NB_DEPOSIT_INIT), PERF_TALER_MINTDB_INIT_CMD_START_TRANSACTION ("start_transaction_init"), - PERF_TALER_MINTDB_INIT_CMD_INSERT_DEPOSIT ("init_deposit_insert"), + PERF_TALER_MINTDB_INIT_CMD_INSERT_DEPOSIT ("init_deposit_insert", + "denomination"), PERF_TALER_MINTDB_INIT_CMD_COMMIT_TRANSACTION ("commit_transaction_init"), PERF_TALER_MINTDB_INIT_CMD_SAVE_ARRAY ("array_depo", "loop_db_init_deposit", @@ -45,13 +50,12 @@ main (int argc, char ** argv) PERF_TALER_MINTDB_DEPOSIT), PERF_TALER_MINTDB_INIT_CMD_END_LOOP ("endloop_init_deposit", "loop_db_init_deposit"), - PERF_TALER_MINTDB_INIT_CMD_DEBUG("INIT_END"), // End of database initialization PERF_TALER_MINTDB_INIT_CMD_GET_TIME ("deposit_get_start"), PERF_TALER_MINTDB_INIT_CMD_LOOP ("loop_deposit_get", PERF_TALER_MINTDB_NB_DEPOSIT_GET), PERF_TALER_MINTDB_INIT_CMD_START_TRANSACTION ("start_transaction_get"), - PERF_TALER_MINTDB_INIT_CMD_LOAD_ARRAY ("load deposit", + PERF_TALER_MINTDB_INIT_CMD_LOAD_ARRAY ("load_deposit", "loop_deposit_get", "array_depo"), PERF_TALER_MINTDB_INIT_CMD_GET_DEPOSIT ("get_deposit", diff --git a/src/mintdb/perf_taler_mintdb_init.c b/src/mintdb/perf_taler_mintdb_init.c index 4ada307bc..f93bd8284 100644 --- a/src/mintdb/perf_taler_mintdb_init.c +++ b/src/mintdb/perf_taler_mintdb_init.c @@ -33,7 +33,9 @@ * @return a randomly generated CollectableBlindcoin */ struct TALER_MINTDB_CollectableBlindcoin * -PERF_TALER_MINTDB_collectable_blindcoin_init () +PERF_TALER_MINTDB_collectable_blindcoin_init ( + const struct TALER_MINTDB_DenominationKeyIssueInformation *dki, + const struct TALER_MINTDB_Reserve *reserve) { uint32_t random_int; struct GNUNET_CRYPTO_rsa_PrivateKey *denomination_key; @@ -45,12 +47,13 @@ PERF_TALER_MINTDB_collectable_blindcoin_init () struct TALER_MINTDB_CollectableBlindcoin *coin; - coin = GNUNET_new (struct TALER_MINTDB_CollectableBlindcoin); + GNUNET_assert (NULL != + (coin = GNUNET_new (struct TALER_MINTDB_CollectableBlindcoin))); GNUNET_assert (NULL != (reserve_sig_key = GNUNET_CRYPTO_eddsa_key_create ())); GNUNET_assert (NULL != (denomination_key = GNUNET_CRYPTO_rsa_private_key_create (512))); - GNUNET_assert (NULL == + GNUNET_assert (NULL != (coin->denom_pub.rsa_public_key = GNUNET_CRYPTO_rsa_private_key_get_public (denomination_key))); GNUNET_CRYPTO_eddsa_key_get_public (reserve_sig_key, @@ -82,6 +85,35 @@ PERF_TALER_MINTDB_collectable_blindcoin_init () return coin; } + +struct TALER_MINTDB_CollectableBlindcoin * +PERF_TALER_MINTDB_collectable_blindcoin_copy (const struct TALER_MINTDB_CollectableBlindcoin *coin) +{ + struct TALER_MINTDB_CollectableBlindcoin *copy; + + GNUNET_assert (NULL != + (copy = GNUNET_new (struct TALER_MINTDB_CollectableBlindcoin))); + *copy = *coin; + // No signature copy function found, Hacking it in + { + char *buffer = NULL; + int size; + GNUNET_assert (0 < + (size = GNUNET_CRYPTO_rsa_signature_encode ( + coin->sig.rsa_signature, + &buffer))); + GNUNET_assert (NULL != + (copy->sig.rsa_signature = GNUNET_CRYPTO_rsa_signature_decode( + buffer, + size))); + GNUNET_free (buffer); + } + GNUNET_assert (NULL != + (copy->denom_pub.rsa_public_key = + GNUNET_CRYPTO_rsa_public_key_dup (coin->denom_pub.rsa_public_key))); + return copy; +} + /** * Liberate memory of @a coin */ @@ -121,12 +153,24 @@ PERF_TALER_MINTDB_reserve_init () } + +struct TALER_MINTDB_Reserve * +PERF_TALER_MINTDB_reserve_copy (const struct TALER_MINTDB_Reserve *reserve) +{ + struct TALER_MINTDB_Reserve *copy; + GNUNET_assert (NULL != (copy = GNUNET_new (struct TALER_MINTDB_Reserve))); + *copy = *reserve; + return copy; +} + /** * Free memory of a reserve */ int PERF_TALER_MINTDB_reserve_free (struct TALER_MINTDB_Reserve *reserve) { + if (NULL == reserve) + return GNUNET_OK; GNUNET_free (reserve); return GNUNET_OK; } @@ -165,7 +209,7 @@ PERF_TALER_MINTDB_refresh_session_free (struct TALER_MINTDB_RefreshSession *refr * Create a randomly generated deposit */ struct TALER_MINTDB_Deposit * -PERF_TALER_MINTDB_deposit_init () +PERF_TALER_MINTDB_deposit_init (const struct TALER_MINTDB_DenominationKeyIssueInformation *dki) { struct TALER_MINTDB_Deposit *deposit; struct TALER_CoinPublicInfo coin; @@ -189,24 +233,20 @@ PERF_TALER_MINTDB_deposit_init () (deposit = GNUNET_malloc (sizeof (struct TALER_MINTDB_Deposit) + sizeof (wire)))); { // coin struct GNUNET_CRYPTO_EddsaPrivateKey *eddsa_prvt; - struct GNUNET_CRYPTO_rsa_PrivateKey *rsa_prv; GNUNET_assert (NULL != (eddsa_prvt = GNUNET_CRYPTO_eddsa_key_create ())); - GNUNET_assert (NULL != - (rsa_prv = GNUNET_CRYPTO_rsa_private_key_create (PERF_TALER_MINTDB_RSA_SIZE))); GNUNET_CRYPTO_eddsa_key_get_public (eddsa_prvt, &coin.coin_pub.eddsa_pub); - GNUNET_assert (NULL != - (coin.denom_pub.rsa_public_key = - GNUNET_CRYPTO_rsa_private_key_get_public (rsa_prv))); + GNUNET_assert (NULL != + (coin.denom_pub.rsa_public_key = + GNUNET_CRYPTO_rsa_public_key_dup (dki->denom_pub.rsa_public_key))); GNUNET_assert (NULL != (coin.denom_sig.rsa_signature = - GNUNET_CRYPTO_rsa_sign (rsa_prv, + GNUNET_CRYPTO_rsa_sign (dki->denom_priv.rsa_private_key, &coin.coin_pub.eddsa_pub, sizeof (struct GNUNET_CRYPTO_EddsaPublicKey)))); - GNUNET_CRYPTO_rsa_private_key_free (rsa_prv); GNUNET_free (eddsa_prvt); } { //csig @@ -265,6 +305,33 @@ PERF_TALER_MINTDB_deposit_init () } +struct TALER_MINTDB_Deposit * +PERF_TALER_MINTDB_deposit_copy (const struct TALER_MINTDB_Deposit *deposit) +{ + struct TALER_MINTDB_Deposit *copy; + + GNUNET_assert (NULL != (copy = GNUNET_new (struct TALER_MINTDB_Deposit))); + *copy = *deposit; + json_incref (copy->wire); + GNUNET_assert (NULL != + (copy->coin.denom_pub.rsa_public_key = + GNUNET_CRYPTO_rsa_public_key_dup (deposit->coin.denom_pub.rsa_public_key))); + { + char *buffer = NULL; + int size; + GNUNET_assert (0 < + (size = GNUNET_CRYPTO_rsa_signature_encode ( + deposit->coin.denom_sig.rsa_signature, + &buffer))); + GNUNET_assert (NULL != + (copy->coin.denom_sig.rsa_signature = + GNUNET_CRYPTO_rsa_signature_decode(buffer, size))); + GNUNET_free (buffer); + } + return copy; +} + + /** * Free memory of a deposit */ @@ -339,6 +406,34 @@ PERF_TALER_MINTDB_denomination_init () } + +struct TALER_MINTDB_DenominationKeyIssueInformation * +PERF_TALER_MINTDB_denomination_copy (const struct TALER_MINTDB_DenominationKeyIssueInformation *dki) +{ + struct TALER_MINTDB_DenominationKeyIssueInformation *copy; + + GNUNET_assert (NULL != + (copy = GNUNET_new (struct TALER_MINTDB_DenominationKeyIssueInformation))); + *copy = *dki; + { + char *buffer = NULL; + int size; + GNUNET_assert (0 < + (size = GNUNET_CRYPTO_rsa_private_key_encode ( + dki->denom_priv.rsa_private_key, + &buffer))); + GNUNET_assert (NULL != + (copy->denom_priv.rsa_private_key = + GNUNET_CRYPTO_rsa_private_key_decode(buffer, size))); + GNUNET_free (buffer); + } + GNUNET_assert (NULL != + (copy->denom_pub.rsa_public_key = + GNUNET_CRYPTO_rsa_public_key_dup (dki->denom_pub.rsa_public_key))); + return copy; +} + + /** * Free memory for a DenominationKeyIssueInformation */ diff --git a/src/mintdb/perf_taler_mintdb_init.h b/src/mintdb/perf_taler_mintdb_init.h index 5f2e44cd5..3e2eb3cc2 100644 --- a/src/mintdb/perf_taler_mintdb_init.h +++ b/src/mintdb/perf_taler_mintdb_init.h @@ -31,14 +31,21 @@ * @return a randomly generated CollectableBlindcoin */ struct TALER_MINTDB_CollectableBlindcoin * -PERF_TALER_MINTDB_collectable_blindcoin_init (void); +PERF_TALER_MINTDB_collectable_blindcoin_init (const struct TALER_MINTDB_DenominationKeyIssueInformation *dki, + const struct TALER_MINTDB_Reserve *reserve); + +/** + * @returns a copy of @a coin + */ +struct TALER_MINTDB_CollectableBlindcoin * +PERF_TALER_MINTDB_collectable_blindcoin_copy (const struct TALER_MINTDB_CollectableBlindcoin *coin); /** * Liberate memory of @a coin */ int -PERF_TALER_MINTDB_collectable_blindcoin_free (struct TALER_MINTDB_CollectableBlindcoin *NAME); +PERF_TALER_MINTDB_collectable_blindcoin_free (struct TALER_MINTDB_CollectableBlindcoin *coin); /** @@ -49,7 +56,13 @@ PERF_TALER_MINTDB_reserve_init (void); /** - * Free memory of a reserve + * Returns a copy of @reserve + */ +struct TALER_MINTDB_Reserve * +PERF_TALER_MINTDB_reserve_copy (const struct TALER_MINTDB_Reserve *reserve); + +/** + * Frees memory allocated to @a reserve */ int PERF_TALER_MINTDB_reserve_free (struct TALER_MINTDB_Reserve *reserve); @@ -73,7 +86,14 @@ PERF_TALER_MINTDB_refresh_session_free (struct TALER_MINTDB_RefreshSession *refr * Create a randomly generated deposit */ struct TALER_MINTDB_Deposit * -PERF_TALER_MINTDB_deposit_init (void); +PERF_TALER_MINTDB_deposit_init (const struct TALER_MINTDB_DenominationKeyIssueInformation *dki); + + +/** + * @returns a copy of @a deposit + */ +struct TALER_MINTDB_Deposit * +PERF_TALER_MINTDB_deposit_copy (const struct TALER_MINTDB_Deposit *deposit); /** @@ -90,6 +110,12 @@ struct TALER_MINTDB_DenominationKeyIssueInformation * PERF_TALER_MINTDB_denomination_init (void); +/** + * @returns a copy of @a dki + */ +struct TALER_MINTDB_DenominationKeyIssueInformation * +PERF_TALER_MINTDB_denomination_copy (const struct TALER_MINTDB_DenominationKeyIssueInformation *dki); + /** * Free memory for a DenominationKeyIssueInformation */ diff --git a/src/mintdb/perf_taler_mintdb_interpreter.c b/src/mintdb/perf_taler_mintdb_interpreter.c index dd36ae6d2..25999792a 100644 --- a/src/mintdb/perf_taler_mintdb_interpreter.c +++ b/src/mintdb/perf_taler_mintdb_interpreter.c @@ -129,19 +129,21 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[]) case PERF_TALER_MINTDB_CMD_LOAD_ARRAY: // Creating the permutation array to randomize the data order - GNUNET_assert (NULL != - (cmd[i].details.load_array.permutation = - GNUNET_CRYPTO_random_permute ( - GNUNET_CRYPTO_QUALITY_WEAK, - cmd[cmd_find (cmd, - cmd[i].details - .load_array.label_save)] - .details.save_array.nb_saved))); + { + int save_index ; - // Initializing the type based on the type of the saved array - cmd[i].exposed_type = cmd[cmd_find (cmd, - cmd[i].details.load_array.label_save)] - .details.save_array.type_saved; + GNUNET_assert (GNUNET_SYSERR != + (save_index = cmd_find ( + cmd, + cmd[i].details.load_array.label_save))); + GNUNET_assert (NULL != + (cmd[i].details.load_array.permutation = + GNUNET_CRYPTO_random_permute ( + GNUNET_CRYPTO_QUALITY_WEAK, + cmd[save_index].details.save_array.nb_saved))); + // Initializing the type based on the type of the saved array + cmd[i].exposed_type = cmd[save_index].details.save_array.type_saved; + } break; default: @@ -200,16 +202,15 @@ interpret_end_loop (struct PERF_TALER_MINTDB_interpreter_state *state) { unsigned int i; union PERF_TALER_MINTDB_Data zero = {0}; - unsigned int jump = cmd_find (state->cmd, - state->cmd[state->i].details.end_loop.label_loop); + unsigned int jump; + GNUNET_assert (GNUNET_SYSERR != + (jump = cmd_find (state->cmd, + state->cmd[state->i] + .details.end_loop.label_loop))); // Cleaning up the memory in the loop for (i = jump; i < state->i; i++) { - // If the exposed variable has not been copied it is freed - if ( GNUNET_NO == state->cmd[i].exposed_saved) - data_free (&state->cmd[i].exposed, state->cmd[i].exposed_type); - state->cmd[i].exposed_saved = GNUNET_NO; - // Anyway we need to make the data zero. + data_free (&state->cmd[i].exposed, state->cmd[i].exposed_type); state->cmd[i].exposed = zero; } @@ -234,20 +235,23 @@ interpret_end_loop (struct PERF_TALER_MINTDB_interpreter_state *state) static void interpret_save_array (struct PERF_TALER_MINTDB_interpreter_state *state) { - unsigned int loop_index; + unsigned int loop_index, save_index; unsigned int selection_chance; // Array initialization on first loop iteration // Alows for nested loops - if (0 == state->cmd[cmd_find (state->cmd, - state->cmd[state->i] - .details.save_array.label_loop)] - .details.loop.curr_iteration) + GNUNET_assert (GNUNET_SYSERR != + (loop_index = cmd_find (state->cmd, + state->cmd[state->i] + .details.save_array.label_loop))); + GNUNET_assert (GNUNET_SYSERR != + (save_index = cmd_find (state->cmd, + state->cmd[state->i] + .details.save_array.label_save))); + if (0 == state->cmd[loop_index].details.loop.curr_iteration) { state->cmd[state->i].details.save_array.index = 0; } - loop_index = cmd_find (state->cmd, - state->cmd[state->i].details.save_array.label_loop); // The probobility distribution of the saved items will be a little biased // against the few last items but it should not be a big problem. selection_chance = state->cmd[loop_index].details.loop.max_iterations / @@ -272,10 +276,7 @@ interpret_save_array (struct PERF_TALER_MINTDB_interpreter_state *state) save_location = &state->cmd[state->i].details.save_array .data_saved[state->cmd[state->i].details.save_array.index]; - item_saved = &state->cmd[cmd_find (state->cmd, - state->cmd[state->i] - .details.save_array.label_save)] - .exposed; + item_saved = &state->cmd[save_index].exposed; switch (state->cmd[state->i].details.save_array.type_saved) { case PERF_TALER_MINTDB_TIME: @@ -283,19 +284,19 @@ interpret_save_array (struct PERF_TALER_MINTDB_interpreter_state *state) break; case PERF_TALER_MINTDB_DEPOSIT: - save_location->deposit = item_saved->deposit; + save_location->deposit = PERF_TALER_MINTDB_deposit_copy (item_saved->deposit); break; case PERF_TALER_MINTDB_BLINDCOIN: - save_location->blindcoin = item_saved->blindcoin; + save_location->blindcoin = PERF_TALER_MINTDB_collectable_blindcoin_copy (item_saved->blindcoin); break; case PERF_TALER_MINTDB_RESERVE: - save_location->reserve = item_saved->reserve; + save_location->reserve = PERF_TALER_MINTDB_reserve_copy (item_saved->reserve); break; case PERF_TALER_MINTDB_DENOMINATION_INFO: - save_location->dki = item_saved->dki; + save_location->dki = PERF_TALER_MINTDB_denomination_copy (item_saved->dki); break; case PERF_TALER_MINTDB_COIN_INFO: @@ -305,9 +306,6 @@ interpret_save_array (struct PERF_TALER_MINTDB_interpreter_state *state) default: break; } - state->cmd[cmd_find (state->cmd, - state->cmd[state->i].details.save_array.label_save)] - .exposed_saved = GNUNET_YES; state->cmd[state->i].details.save_array.index++; } } @@ -316,21 +314,24 @@ interpret_save_array (struct PERF_TALER_MINTDB_interpreter_state *state) static void interpret_load_array (struct PERF_TALER_MINTDB_interpreter_state *state) { - unsigned int loop_index, save_index; + unsigned int loop_index, save_index, loop_iter, permut_index; union PERF_TALER_MINTDB_Data zero = {0}; union PERF_TALER_MINTDB_Data *loaded_data; - - loop_index = cmd_find (state->cmd, - state->cmd[state->i].details.load_array.label_loop); - save_index = cmd_find (state->cmd, - state->cmd[state->i].details.load_array.label_save); + + GNUNET_assert (GNUNET_SYSERR != + (loop_index = cmd_find (state->cmd, + state->cmd[state->i] + .details.load_array.label_loop))); + GNUNET_assert (GNUNET_SYSERR != + (save_index = cmd_find (state->cmd, + state->cmd[state->i] + .details.load_array.label_save))); + loop_iter = state->cmd[loop_index].details.loop.curr_iteration; + permut_index = state->cmd[state->i].details.load_array.permutation[loop_iter]; /* Extracting the data from the loop_indexth indice in save_index * array. */ - loaded_data = &state->cmd[save_index].details.save_array.data_saved[ - state->cmd[state->i].details.load_array.permutation[ - state->cmd[loop_index].details.loop.curr_iteration]]; - + loaded_data = &state->cmd[save_index].details.save_array.data_saved[permut_index]; switch (state->cmd[state->i].exposed_type) { case PERF_TALER_MINTDB_TIME: @@ -396,10 +397,14 @@ interpret (struct PERF_TALER_MINTDB_interpreter_state *state) struct timespec start, stop; unsigned long elapsed_ms; - start_index = cmd_find (state->cmd, - state->cmd[state->i].details.gauger.label_start); - stop_index = cmd_find (state->cmd, - state->cmd[state->i].details.gauger.label_stop); + GNUNET_assert (GNUNET_SYSERR != + (start_index = cmd_find (state->cmd, + state->cmd[state->i] + .details.gauger.label_start))); + GNUNET_assert (GNUNET_SYSERR != + (stop_index = cmd_find (state->cmd, + state->cmd[state->i] + .details.gauger.label_stop))); start = state->cmd[start_index].exposed.time; stop = state->cmd[stop_index].exposed.time; elapsed_ms = (start.tv_sec - stop.tv_sec) * 1000 + @@ -437,8 +442,15 @@ interpret (struct PERF_TALER_MINTDB_interpreter_state *state) case PERF_TALER_MINTDB_CMD_INSERT_DEPOSIT: { - struct TALER_MINTDB_Deposit *deposit = - PERF_TALER_MINTDB_deposit_init (); + int dki_index; + struct TALER_MINTDB_Deposit *deposit; + GNUNET_assert (GNUNET_SYSERR != + (dki_index = cmd_find(state->cmd, + state->cmd[state->i] + .details.insert_deposit.label_dki))); + GNUNET_assert (NULL != + (deposit = PERF_TALER_MINTDB_deposit_init ( + state->cmd[dki_index].exposed.dki))); GNUNET_assert ( state->plugin->insert_deposit (state->plugin->cls, @@ -450,12 +462,15 @@ interpret (struct PERF_TALER_MINTDB_interpreter_state *state) case PERF_TALER_MINTDB_CMD_GET_DEPOSIT: { - struct TALER_MINTDB_Deposit *deposit = - state->cmd[cmd_find (state->cmd, - state->cmd[state->i] - .details.get_deposit.label_source)] - .exposed.deposit; // Get the deposit from the source - GNUNET_assert (NULL != deposit); + int source_index; + struct TALER_MINTDB_Deposit *deposit; + + GNUNET_assert (GNUNET_SYSERR != + (source_index = cmd_find (state->cmd, + state->cmd[state->i] + .details.get_deposit.label_source))); + GNUNET_assert (NULL != + (deposit = state->cmd[source_index].exposed.deposit)); state->plugin->have_deposit (state->plugin->cls, state->session, deposit); @@ -465,10 +480,12 @@ interpret (struct PERF_TALER_MINTDB_interpreter_state *state) case PERF_TALER_MINTDB_CMD_INSERT_RESERVE: { struct TALER_MINTDB_Reserve *reserve; - json_t *details = json_pack ("si","justification", - GNUNET_CRYPTO_random_u32 ( - GNUNET_CRYPTO_QUALITY_WEAK, - UINT32_MAX)); + json_t *details = NULL; + GNUNET_assert (NULL != + (details = json_pack ("{s:i}","justification", + GNUNET_CRYPTO_random_u32 ( + GNUNET_CRYPTO_QUALITY_WEAK, + UINT32_MAX)))); reserve = PERF_TALER_MINTDB_reserve_init (); state->plugin->reserves_in_insert ( state->plugin->cls, @@ -484,15 +501,19 @@ interpret (struct PERF_TALER_MINTDB_interpreter_state *state) case PERF_TALER_MINTDB_CMD_GET_RESERVE: { - struct TALER_MINTDB_Reserve *reserve = - state->cmd[cmd_find (state->cmd, - state->cmd[state->i] - .details.get_reserve.label_source)] - .exposed.reserve; // Get the deposit from the source - - state->plugin->reserve_get (state->plugin->cls, - state->session, - reserve); + int source_index; + struct TALER_MINTDB_Reserve *reserve; + + GNUNET_assert (GNUNET_SYSERR != + (source_index = cmd_find (state->cmd, + state->cmd[state->i] + .details.get_reserve.label_source))); + GNUNET_assert (NULL != + (reserve = state->cmd[source_index].exposed.reserve)); + GNUNET_assert (GNUNET_OK == + (state->plugin->reserve_get (state->plugin->cls, + state->session, + reserve))); } break; @@ -511,11 +532,15 @@ interpret (struct PERF_TALER_MINTDB_interpreter_state *state) case PERF_TALER_MINTDB_CMD_GET_DENOMINATION: { - struct TALER_MINTDB_DenominationKeyIssueInformation *dki = - state->cmd[cmd_find (state->cmd, - state->cmd[state->i] - .details.get_denomination.label_source)] - .exposed.dki; + int source_index; + struct TALER_MINTDB_DenominationKeyIssueInformation *dki; + + GNUNET_assert (GNUNET_SYSERR != + (source_index = cmd_find (state->cmd, + state->cmd[state->i] + .details.get_denomination.label_source))); + GNUNET_assert (NULL != + (dki = state->cmd[source_index].exposed.dki)); state->plugin->get_denomination_info (state->plugin->cls, state->session, &dki->denom_pub, @@ -525,8 +550,22 @@ interpret (struct PERF_TALER_MINTDB_interpreter_state *state) case PERF_TALER_MINTDB_CMD_INSERT_WITHDRAW: { - struct TALER_MINTDB_CollectableBlindcoin *blindcoin = - PERF_TALER_MINTDB_collectable_blindcoin_init (); + int dki_index, reserve_index; + struct TALER_MINTDB_CollectableBlindcoin *blindcoin ; + + GNUNET_assert (GNUNET_SYSERR != + (dki_index = cmd_find ( + state->cmd, + state->cmd[state->i].details.insert_withdraw.label_dki))); + GNUNET_assert (GNUNET_SYSERR != + (reserve_index = cmd_find ( + state->cmd, + state->cmd[state->i].details.insert_withdraw.label_reserve))); + GNUNET_assert (NULL != + (blindcoin = + PERF_TALER_MINTDB_collectable_blindcoin_init ( + state->cmd[dki_index].exposed.dki, + state->cmd[reserve_index].exposed.reserve))); state->plugin->insert_withdraw_info (state->plugin->cls, state->session, @@ -537,12 +576,15 @@ interpret (struct PERF_TALER_MINTDB_interpreter_state *state) case PERF_TALER_MINTDB_CMD_GET_WITHDRAW: { - struct TALER_MINTDB_CollectableBlindcoin *blindcoin = - state->cmd[cmd_find (state->cmd, - state->cmd[state->i] - .details.get_denomination.label_source)] - .exposed.blindcoin; + int source_index; + struct TALER_MINTDB_CollectableBlindcoin *blindcoin ; + GNUNET_assert (GNUNET_SYSERR != + (source_index = cmd_find (state->cmd, + state->cmd[state->i] + .details.get_denomination.label_source))); + GNUNET_assert (NULL != + (blindcoin = state->cmd[source_index].exposed.blindcoin)); state->plugin->get_withdraw_info (state->plugin->cls, state->session, &blindcoin->h_coin_envelope, diff --git a/src/mintdb/perf_taler_mintdb_interpreter.h b/src/mintdb/perf_taler_mintdb_interpreter.h index 49f06b6ea..9f7ee4207 100644 --- a/src/mintdb/perf_taler_mintdb_interpreter.h +++ b/src/mintdb/perf_taler_mintdb_interpreter.h @@ -46,6 +46,7 @@ .label = _label, \ .exposed_type = PERF_TALER_MINTDB_NONE \ } + /** * The begining of a loop * @param _label the name of the loop @@ -153,11 +154,12 @@ /** * Insert a deposit into the database */ -#define PERF_TALER_MINTDB_INIT_CMD_INSERT_DEPOSIT(_label) \ +#define PERF_TALER_MINTDB_INIT_CMD_INSERT_DEPOSIT(_label, _label_dki) \ { \ .command = PERF_TALER_MINTDB_CMD_INSERT_DEPOSIT,\ .label = _label, \ .exposed_type = PERF_TALER_MINTDB_DEPOSIT, \ + .details.insert_deposit.label_dki = _label_dki, \ } /** @@ -177,8 +179,8 @@ */ #define PERF_TALER_MINTDB_INIT_CMD_INSERT_RESERVE(_label) \ { \ - .command = PERF_TALER_MINTDB_CMD_INSERT_RESERVE \ - .label = _label \ + .command = PERF_TALER_MINTDB_CMD_INSERT_RESERVE, \ + .label = _label, \ .exposed_type = PERF_TALER_MINTDB_RESERVE \ } @@ -189,7 +191,7 @@ */ #define PERF_TALER_MINTDB_INIT_CMD_GET_RESERVE(_label, _label_source) \ { \ - .command = PERF_TALER_MINTDB_CMD_GET_RESERVE \ + .command = PERF_TALER_MINTDB_CMD_GET_RESERVE, \ .label = _label, \ .exposed_type = PERF_TALER_MINTDB_NONE, \ .details.get_reserve.label_source = _label_source \ @@ -199,11 +201,15 @@ /** * Inserts informations about a withdrawal in the database */ -#define PERF_TALER_MINTDB_INIT_CMD_INSERT_WITHDRAW(_label) \ +#define PERF_TALER_MINTDB_INIT_CMD_INSERT_WITHDRAW(_label, _label_dki, _label_reserve) \ { \ .command = PERF_TALER_MINTDB_CMD_INSERT_WITHDRAW, \ .label = _label, \ .exposed_type = PERF_TALER_MINTDB_BLINDCOIN, \ + .details.insert_withdraw = {\ + .label_dki = _label_dki, \ + .label.reserve = _label_reserve, \ + } \ }\ @@ -223,9 +229,9 @@ */ #define PERF_TALER_MINTDB_INIT_CMD_INSERT_DENOMINATION(_label) \ { \ - .command = PERF_TALER_MINTDB_CMD_INSERT_WITHDRAW, \ + .command = PERF_TALER_MINTDB_CMD_INSERT_DENOMINATION, \ .label = _label, \ - .exposed_type = PERF_TALER_MINTDB_DENOMINATION_KEY, \ + .exposed_type = PERF_TALER_MINTDB_DENOMINATION_INFO, \ } /** @@ -445,6 +451,18 @@ struct PERF_TALER_MINTDB_CMD_load_array_details }; +/** + * Data used by the command insert_deposit + */ +struct PERF_TALER_MINTDB_CMD_insert_deposit_details +{ + /** + * Label of the source where the reserve used to create the coin is + */ + const char *label_dki; +}; + + /** * Extra data requiered for the GET_DEPOSIT command */ @@ -478,6 +496,22 @@ struct PERF_TALER_MINTDB_CMD_get_denomination_details }; +/** + * Extra data related to the get withdraw command + */ +struct PERF_TALER_MINTDB_CMD_insert_withdraw_details +{ + /** + * label of the denomination key used to sign the coin + */ + const char *label_dki; + + /** + * label of the reserve the money to mint the coin comes from + */ + const char *label_reserve; +}; + /** * Extra data requiered for refreshing coins */ @@ -500,10 +534,12 @@ union PERF_TALER_MINTDB_CMD_Details struct PERF_TALER_MINTDB_CMD_gauger_details gauger; struct PERF_TALER_MINTDB_CMD_save_array_details save_array; struct PERF_TALER_MINTDB_CMD_load_array_details load_array; + struct PERF_TALER_MINTDB_CMD_insert_deposit_details insert_deposit; struct PERF_TALER_MINTDB_CMD_get_deposit_details get_deposit; struct PERF_TALER_MINTDB_CMD_get_reserve_details get_reserve; struct PERF_TALER_MINTDB_CMD_get_denomination_details get_denomination; struct PERF_TALER_MINTDB_CMD_refresh_coin_details refresh; + struct PERF_TALER_MINTDB_CMD_insert_withdraw_details insert_withdraw; }; @@ -536,12 +572,6 @@ struct PERF_TALER_MINTDB_Cmd * Data easily accessible */ union PERF_TALER_MINTDB_Data exposed; - - /** - * GNUNET_YES if the exposed value hav been saved during last loop iteration - * GNUNET_NO if it hasn't - */ - unsigned int exposed_saved; }; diff --git a/src/mintdb/perf_taler_mintdb_values.h b/src/mintdb/perf_taler_mintdb_values.h index 4b982b8bd..f0cdd4f10 100644 --- a/src/mintdb/perf_taler_mintdb_values.h +++ b/src/mintdb/perf_taler_mintdb_values.h @@ -24,7 +24,7 @@ #define PERF_TALER_MINTDB_NB_DEPOSIT_INIT 100 -#define PERF_TALER_MINTDB_NB_DEPOSIT_GET 10 +#define PERF_TALER_MINTDB_NB_DEPOSIT_GET 1 From 582e623b13457f372f22edd8d8c1c99d26e07626 Mon Sep 17 00:00:00 2001 From: Fournier Nicolas Date: Tue, 30 Jun 2015 09:23:04 +0200 Subject: [PATCH 6/9] initialization of the database --- src/mintdb/perf_taler_mintdb.c | 99 ++++-- src/mintdb/perf_taler_mintdb_init.c | 388 +++++++++++---------- src/mintdb/perf_taler_mintdb_init.h | 103 ++++-- src/mintdb/perf_taler_mintdb_interpreter.c | 20 +- src/mintdb/perf_taler_mintdb_interpreter.h | 78 +++-- src/mintdb/perf_taler_mintdb_values.h | 11 +- 6 files changed, 411 insertions(+), 288 deletions(-) diff --git a/src/mintdb/perf_taler_mintdb.c b/src/mintdb/perf_taler_mintdb.c index 50d351e2a..58cf6d88c 100644 --- a/src/mintdb/perf_taler_mintdb.c +++ b/src/mintdb/perf_taler_mintdb.c @@ -34,43 +34,74 @@ main (int argc, char ** argv) struct PERF_TALER_MINTDB_Cmd test[] = { // Denomination used to create coins - PERF_TALER_MINTDB_INIT_CMD_INSERT_DENOMINATION ("denomination"), - - PERF_TALER_MINTDB_INIT_CMD_DEBUG ("denomination inserted"), - PERF_TALER_MINTDB_INIT_CMD_LOOP ("loop_db_init_deposit", + PERF_TALER_MINTDB_INIT_CMD_LOOP ("01 - denomination loop", + PERF_TALER_MINTDB_NB_DENOMINATION_INIT), + PERF_TALER_MINTDB_INIT_CMD_START_TRANSACTION ("01 - start transaction"), + PERF_TALER_MINTDB_INIT_CMD_INSERT_DENOMINATION ("01 - denomination"), + PERF_TALER_MINTDB_INIT_CMD_COMMIT_TRANSACTION ("01 - commit transaction"), + PERF_TALER_MINTDB_INIT_CMD_SAVE_ARRAY ("01 - save denomination", + "01 - denomination loop", + "01 - denomination", + PERF_TALER_MINTDB_NB_DENOMINATION_SAVE, + PERF_TALER_MINTDB_BLINDCOIN), + PERF_TALER_MINTDB_INIT_CMD_END_LOOP ("01 - denomination loop end", + "01 - denomination loop"), + PERF_TALER_MINTDB_INIT_CMD_DEBUG ("01 - init denomination complete"), + // End of initialization + // Reserve initialization + PERF_TALER_MINTDB_INIT_CMD_LOOP ("02 - init reserve loop", + PERF_TALER_MINTDB_NB_RESERVE_INIT), + PERF_TALER_MINTDB_INIT_CMD_INSERT_RESERVE ("02 - reserve"), + PERF_TALER_MINTDB_INIT_CMD_SAVE_ARRAY ("02 - save reserve", + "02 - init reserve loop", + "02 - reserve", + PERF_TALER_MINTDB_NB_RESERVE_SAVE, + PERF_TALER_MINTDB_RESERVE), + PERF_TALER_MINTDB_INIT_CMD_END_LOOP ("02 - init reserve end loop", + "02 - init reserve loop"), + PERF_TALER_MINTDB_INIT_CMD_DEBUG ("02 - reserve init complete"), + // End reserve init + // Withdrawal initialization + PERF_TALER_MINTDB_INIT_CMD_LOOP ("03 - init withdraw loop", + PERF_TALER_MINTDB_NB_WITHDRAW_INIT), + // PERF_TALER_MINTDB_INIT_CMD_START_TRANSACTION ("03 - start transaction"), + PERF_TALER_MINTDB_INIT_CMD_LOAD_ARRAY ("03 - denomination load", + "03 - init withdraw loop", + "01 - save denomination"), + PERF_TALER_MINTDB_INIT_CMD_LOAD_ARRAY ("03 - reserve load", + "03 - init withdraw loop", + "02 - save reserve"), + PERF_TALER_MINTDB_INIT_CMD_INSERT_WITHDRAW ("03 - withdraw", + "03 - denomination load", + "03 - reserve load"), + // PERF_TALER_MINTDB_INIT_CMD_COMMIT_TRANSACTION ("03 - commit transaction"), + PERF_TALER_MINTDB_INIT_CMD_SAVE_ARRAY ("03 - blindcoin array", + "03 - init withdraw loop", + "03 - withdraw", + PERF_TALER_MINTDB_NB_WITHDRAW_SAVE, + PERF_TALER_MINTDB_BLINDCOIN), + PERF_TALER_MINTDB_INIT_CMD_END_LOOP ("03 - withdraw init end loop", + "03 - init withdraw loop"), + PERF_TALER_MINTDB_INIT_CMD_DEBUG ("03 - withdraw init complete"), + //End of withdrawal initialization + //Deposit initialization + PERF_TALER_MINTDB_INIT_CMD_LOOP ("04 - deposit init loop", PERF_TALER_MINTDB_NB_DEPOSIT_INIT), - PERF_TALER_MINTDB_INIT_CMD_START_TRANSACTION ("start_transaction_init"), - PERF_TALER_MINTDB_INIT_CMD_INSERT_DEPOSIT ("init_deposit_insert", - "denomination"), - PERF_TALER_MINTDB_INIT_CMD_COMMIT_TRANSACTION ("commit_transaction_init"), - PERF_TALER_MINTDB_INIT_CMD_SAVE_ARRAY ("array_depo", - "loop_db_init_deposit", - "init_deposit_insert", - PERF_TALER_MINTDB_NB_DEPOSIT_GET, + PERF_TALER_MINTDB_INIT_CMD_START_TRANSACTION ("04 - start transaction"), + PERF_TALER_MINTDB_INIT_CMD_INSERT_DEPOSIT ("04 - deposit", + "01 - denomination"), + PERF_TALER_MINTDB_INIT_CMD_COMMIT_TRANSACTION ("04 - commit transaction"), + PERF_TALER_MINTDB_INIT_CMD_SAVE_ARRAY ("04 - deposit array", + "04 - deposit init loop", + "04 - deposit", + PERF_TALER_MINTDB_NB_DEPOSIT_SAVE, PERF_TALER_MINTDB_DEPOSIT), - PERF_TALER_MINTDB_INIT_CMD_END_LOOP ("endloop_init_deposit", - "loop_db_init_deposit"), - // End of database initialization - PERF_TALER_MINTDB_INIT_CMD_GET_TIME ("deposit_get_start"), - PERF_TALER_MINTDB_INIT_CMD_LOOP ("loop_deposit_get", - PERF_TALER_MINTDB_NB_DEPOSIT_GET), - PERF_TALER_MINTDB_INIT_CMD_START_TRANSACTION ("start_transaction_get"), - PERF_TALER_MINTDB_INIT_CMD_LOAD_ARRAY ("load_deposit", - "loop_deposit_get", - "array_depo"), - PERF_TALER_MINTDB_INIT_CMD_GET_DEPOSIT ("get_deposit", - "load_deposit"), - PERF_TALER_MINTDB_INIT_CMD_COMMIT_TRANSACTION ("commit_transaction_init"), - PERF_TALER_MINTDB_INIT_CMD_END_LOOP ("stop2", "loop_deposit_get"), - PERF_TALER_MINTDB_INIT_CMD_GET_TIME ("deposit_get_end"), - PERF_TALER_MINTDB_INIT_CMD_GAUGER ("deposit_get_commit", - "deposit_get_start", - "deposit_get_end", - "time per deposit check", - PERF_TALER_MINTDB_NB_DEPOSIT_GET), - PERF_TALER_MINTDB_INIT_CMD_END("end"), + PERF_TALER_MINTDB_INIT_CMD_END_LOOP ("04 - deposit init loop end", + "04 - deposit init loop"), + PERF_TALER_MINTDB_INIT_CMD_DEBUG ("04 - deposit init complete"), + // End of deposit initialization + PERF_TALER_MINTDB_INIT_CMD_END ("end"), }; - // Plugin init GNUNET_log_setup ("perf-taler-mintdb", "WARNING", diff --git a/src/mintdb/perf_taler_mintdb_init.c b/src/mintdb/perf_taler_mintdb_init.c index f93bd8284..a0019f84c 100644 --- a/src/mintdb/perf_taler_mintdb_init.c +++ b/src/mintdb/perf_taler_mintdb_init.c @@ -30,108 +30,115 @@ /** - * @return a randomly generated CollectableBlindcoin + * Generate a dummy DenominationKeyInformation for testing purposes + * @return a dummy denomination key */ -struct TALER_MINTDB_CollectableBlindcoin * -PERF_TALER_MINTDB_collectable_blindcoin_init ( - const struct TALER_MINTDB_DenominationKeyIssueInformation *dki, - const struct TALER_MINTDB_Reserve *reserve) +struct TALER_MINTDB_DenominationKeyIssueInformation * +PERF_TALER_MINTDB_denomination_init () { - uint32_t random_int; - struct GNUNET_CRYPTO_rsa_PrivateKey *denomination_key; - struct GNUNET_CRYPTO_EddsaPrivateKey *reserve_sig_key; - struct { - struct GNUNET_CRYPTO_EccSignaturePurpose purpose; - uint32_t data; - } unsigned_data; - struct TALER_MINTDB_CollectableBlindcoin *coin; + struct TALER_MINTDB_DenominationKeyIssueInformation *dki; + struct GNUNET_CRYPTO_EddsaPrivateKey *master_prvt; + struct GNUNET_TIME_Absolute anchor; + struct TALER_Amount amount; + GNUNET_assert (NULL != + (dki = GNUNET_new (struct TALER_MINTDB_DenominationKeyIssueInformation))); + GNUNET_assert (NULL != + (dki->denom_priv.rsa_private_key + = GNUNET_CRYPTO_rsa_private_key_create (PERF_TALER_MINTDB_RSA_SIZE))); + GNUNET_assert (NULL != + (dki->denom_pub.rsa_public_key = + GNUNET_CRYPTO_rsa_private_key_get_public (dki->denom_priv.rsa_private_key))); + GNUNET_CRYPTO_rsa_public_key_hash (dki->denom_pub.rsa_public_key, + &dki->issue.denom_hash); + GNUNET_assert (NULL != + (master_prvt = GNUNET_CRYPTO_eddsa_key_create ())); + GNUNET_CRYPTO_eddsa_key_get_public (master_prvt, + &dki->issue.master.eddsa_pub); + anchor = GNUNET_TIME_absolute_get (); + dki->issue.start = GNUNET_TIME_absolute_hton (anchor); + dki->issue.expire_withdraw = + GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_add (anchor, + GNUNET_TIME_relative_get_hour_ ())); + dki->issue.expire_spend = + GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_add (anchor, + GNUNET_TIME_relative_get_hour_ ())); + dki->issue.expire_legal = + GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_add (anchor, + GNUNET_TIME_relative_get_hour_ ())); + GNUNET_assert (GNUNET_OK == + TALER_string_to_amount (CURRENCY ":1.1", &amount)); + TALER_amount_hton (&dki->issue.value, &amount); + TALER_amount_hton (&dki->issue.fee_withdraw, &amount); + TALER_amount_hton (&dki->issue.fee_deposit, &amount); + TALER_amount_hton (&dki->issue.fee_refresh, &amount); + dki->issue.purpose.purpose = htonl (TALER_SIGNATURE_MASTER_DENOMINATION_KEY_VALIDITY); + dki->issue.purpose.size = + htonl (sizeof (struct TALER_MINTDB_DenominationKeyIssueInformation) - + offsetof (struct TALER_MINTDB_DenominationKeyIssueInformation, + issue.purpose)); + GNUNET_assert (GNUNET_OK == + GNUNET_CRYPTO_eddsa_sign (master_prvt, + &dki->issue.purpose, + &dki->issue.signature.eddsa_signature)); + GNUNET_free (master_prvt); - GNUNET_assert (NULL != - (coin = GNUNET_new (struct TALER_MINTDB_CollectableBlindcoin))); - GNUNET_assert (NULL != - (reserve_sig_key = GNUNET_CRYPTO_eddsa_key_create ())); - GNUNET_assert (NULL != - (denomination_key = GNUNET_CRYPTO_rsa_private_key_create (512))); - GNUNET_assert (NULL != - (coin->denom_pub.rsa_public_key = - GNUNET_CRYPTO_rsa_private_key_get_public (denomination_key))); - GNUNET_CRYPTO_eddsa_key_get_public (reserve_sig_key, - &coin->reserve_pub.eddsa_pub); - GNUNET_assert (GNUNET_OK == - TALER_string_to_amount (CURRENCY ":1.1", - &coin->amount_with_fee)); - GNUNET_assert (GNUNET_OK == - TALER_string_to_amount (CURRENCY ":1.1", - &coin->withdraw_fee)); - random_int = - GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, UINT32_MAX); - GNUNET_assert (NULL != - (coin->sig.rsa_signature = - GNUNET_CRYPTO_rsa_sign (denomination_key, - &random_int, - sizeof (random_int)))); - GNUNET_CRYPTO_hash_create_random (GNUNET_CRYPTO_QUALITY_WEAK, - &coin->h_coin_envelope); - unsigned_data.purpose.size = htonl (sizeof (unsigned_data)); - unsigned_data.purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_TEST); - unsigned_data.data = htonl (random_int); - GNUNET_assert (GNUNET_OK == - GNUNET_CRYPTO_eddsa_sign (reserve_sig_key, - (struct GNUNET_CRYPTO_EccSignaturePurpose *) &unsigned_data, - &coin->reserve_sig.eddsa_signature)); - GNUNET_free (reserve_sig_key); - GNUNET_CRYPTO_rsa_private_key_free (denomination_key); - return coin; + return dki; } -struct TALER_MINTDB_CollectableBlindcoin * -PERF_TALER_MINTDB_collectable_blindcoin_copy (const struct TALER_MINTDB_CollectableBlindcoin *coin) +/** + * Copies the given denomination + * @param reserve the deposit copy + * @return a copy of @a deposit; NULL if error + */ +struct TALER_MINTDB_DenominationKeyIssueInformation * +PERF_TALER_MINTDB_denomination_copy (const struct TALER_MINTDB_DenominationKeyIssueInformation *dki) { - struct TALER_MINTDB_CollectableBlindcoin *copy; + struct TALER_MINTDB_DenominationKeyIssueInformation *copy; - GNUNET_assert (NULL != - (copy = GNUNET_new (struct TALER_MINTDB_CollectableBlindcoin))); - *copy = *coin; - // No signature copy function found, Hacking it in + GNUNET_assert (NULL != + (copy = GNUNET_new (struct TALER_MINTDB_DenominationKeyIssueInformation))); + *copy = *dki; { char *buffer = NULL; int size; GNUNET_assert (0 < - (size = GNUNET_CRYPTO_rsa_signature_encode ( - coin->sig.rsa_signature, + (size = GNUNET_CRYPTO_rsa_private_key_encode ( + dki->denom_priv.rsa_private_key, &buffer))); GNUNET_assert (NULL != - (copy->sig.rsa_signature = GNUNET_CRYPTO_rsa_signature_decode( - buffer, - size))); + (copy->denom_priv.rsa_private_key = + GNUNET_CRYPTO_rsa_private_key_decode(buffer, size))); GNUNET_free (buffer); } GNUNET_assert (NULL != (copy->denom_pub.rsa_public_key = - GNUNET_CRYPTO_rsa_public_key_dup (coin->denom_pub.rsa_public_key))); + GNUNET_CRYPTO_rsa_public_key_dup (dki->denom_pub.rsa_public_key))); return copy; } + /** - * Liberate memory of @a coin + * Free memory of a DenominationKeyIssueInformation + * @param dki pointer to the struct to free */ int -PERF_TALER_MINTDB_collectable_blindcoin_free (struct TALER_MINTDB_CollectableBlindcoin *coin) +PERF_TALER_MINTDB_denomination_free (struct TALER_MINTDB_DenominationKeyIssueInformation *dki) { - if (NULL == coin) + if (NULL ==dki) return GNUNET_OK; + GNUNET_CRYPTO_rsa_private_key_free (dki->denom_priv.rsa_private_key); + GNUNET_CRYPTO_rsa_public_key_free (dki->denom_pub.rsa_public_key); + GNUNET_free (dki); - GNUNET_CRYPTO_rsa_signature_free (coin->sig.rsa_signature); - GNUNET_CRYPTO_rsa_public_key_free (coin->denom_pub.rsa_public_key); - GNUNET_free (coin); return GNUNET_OK; } /** - * @return a randomly generated reserve + * Generate a dummy reserve for testing + * @return a reserve with 1000 EUR in it */ struct TALER_MINTDB_Reserve * PERF_TALER_MINTDB_reserve_init () @@ -146,14 +153,18 @@ PERF_TALER_MINTDB_reserve_init () GNUNET_CRYPTO_eddsa_key_get_public (reserve_priv , &reserve->pub.eddsa_pub); GNUNET_assert (GNUNET_OK == - TALER_string_to_amount (CURRENCY ":1.1", &reserve->balance)); + TALER_string_to_amount (CURRENCY ":1000", &reserve->balance)); reserve->expiry = GNUNET_TIME_absolute_get_forever_ (); GNUNET_free (reserve_priv); return reserve; } - +/** + * Copies the given reserve + * @param reserve the reserve to copy + * @return a copy of @a reserve; NULL if error + */ struct TALER_MINTDB_Reserve * PERF_TALER_MINTDB_reserve_copy (const struct TALER_MINTDB_Reserve *reserve) { @@ -165,6 +176,7 @@ PERF_TALER_MINTDB_reserve_copy (const struct TALER_MINTDB_Reserve *reserve) /** * Free memory of a reserve + * @param reserve pointer to the structure to be freed */ int PERF_TALER_MINTDB_reserve_free (struct TALER_MINTDB_Reserve *reserve) @@ -177,36 +189,8 @@ PERF_TALER_MINTDB_reserve_free (struct TALER_MINTDB_Reserve *reserve) /** - * @return a randomly generated refresh session - */ -struct TALER_MINTDB_RefreshSession * -PERF_TALER_MINTDB_refresh_session_init () -{ - struct TALER_MINTDB_RefreshSession *refresh_session; - - GNUNET_assert (NULL != - (refresh_session = GNUNET_new (struct TALER_MINTDB_RefreshSession))); - refresh_session->noreveal_index = 1; - refresh_session->num_oldcoins = 1; - refresh_session->num_newcoins = 1; - - return refresh_session; -} - - -/** - * Free a refresh session - */ -int -PERF_TALER_MINTDB_refresh_session_free (struct TALER_MINTDB_RefreshSession *refresh_session) -{ - GNUNET_free (refresh_session); - return GNUNET_OK; -} - - -/** - * Create a randomly generated deposit + * Generate a dummy deposit for testing purposes + * @param dki the denomination key used to sign the key */ struct TALER_MINTDB_Deposit * PERF_TALER_MINTDB_deposit_init (const struct TALER_MINTDB_DenominationKeyIssueInformation *dki) @@ -275,8 +259,8 @@ PERF_TALER_MINTDB_deposit_init (const struct TALER_MINTDB_DenominationKeyIssueIn GNUNET_assert(NULL != (eddsa_prv = GNUNET_CRYPTO_eddsa_key_create ())); GNUNET_CRYPTO_eddsa_key_get_public ( - eddsa_prv, - &merchant_pub.eddsa_pub); + eddsa_prv, + &merchant_pub.eddsa_pub); GNUNET_free (eddsa_prv); } GNUNET_CRYPTO_hash_create_random (GNUNET_CRYPTO_QUALITY_WEAK, @@ -305,6 +289,11 @@ PERF_TALER_MINTDB_deposit_init (const struct TALER_MINTDB_DenominationKeyIssueIn } +/** + * Copies the given deposit + * @param reserve the deposit copy + * @return a copy of @a deposit; NULL if error + */ struct TALER_MINTDB_Deposit * PERF_TALER_MINTDB_deposit_copy (const struct TALER_MINTDB_Deposit *deposit) { @@ -334,6 +323,7 @@ PERF_TALER_MINTDB_deposit_copy (const struct TALER_MINTDB_Deposit *deposit) /** * Free memory of a deposit + * @param deposit pointer to the structure to free */ int PERF_TALER_MINTDB_deposit_free (struct TALER_MINTDB_Deposit *deposit) @@ -350,71 +340,30 @@ PERF_TALER_MINTDB_deposit_free (struct TALER_MINTDB_Deposit *deposit) /** - * Generate a randomly generate DenominationKeyInformation + * Generate a CollectableBlindcoin for testing purpuses + * @param dki denomination key used to sign the coin + * @param reserve reserve providing the money for the coin + * @return a randomly generated CollectableBlindcoin */ -struct TALER_MINTDB_DenominationKeyIssueInformation * -PERF_TALER_MINTDB_denomination_init () +struct TALER_MINTDB_CollectableBlindcoin * +PERF_TALER_MINTDB_collectable_blindcoin_init ( + const struct TALER_MINTDB_DenominationKeyIssueInformation *dki, + const struct TALER_MINTDB_Reserve *reserve) { - struct TALER_MINTDB_DenominationKeyIssueInformation *dki; - struct GNUNET_CRYPTO_EddsaPrivateKey *master_prvt; - struct GNUNET_TIME_Absolute anchor; - struct TALER_Amount amount; + uint32_t random_int; + struct GNUNET_CRYPTO_rsa_PrivateKey *denomination_key; + struct GNUNET_CRYPTO_EddsaPrivateKey *reserve_sig_key; + struct { + struct GNUNET_CRYPTO_EccSignaturePurpose purpose; + uint32_t data; + } unsigned_data; + struct TALER_MINTDB_CollectableBlindcoin *coin; + + GNUNET_assert (NULL != + (coin = GNUNET_new (struct TALER_MINTDB_CollectableBlindcoin))); GNUNET_assert (NULL != - (dki = GNUNET_new (struct TALER_MINTDB_DenominationKeyIssueInformation))); - GNUNET_assert (NULL != - (dki->denom_priv.rsa_private_key - = GNUNET_CRYPTO_rsa_private_key_create (PERF_TALER_MINTDB_RSA_SIZE))); - GNUNET_assert (NULL != - (dki->denom_pub.rsa_public_key = - GNUNET_CRYPTO_rsa_private_key_get_public (dki->denom_priv.rsa_private_key))); - GNUNET_CRYPTO_rsa_public_key_hash (dki->denom_pub.rsa_public_key, - &dki->issue.denom_hash); - GNUNET_assert (NULL != - (master_prvt = GNUNET_CRYPTO_eddsa_key_create ())); - GNUNET_CRYPTO_eddsa_key_get_public (master_prvt, - &dki->issue.master.eddsa_pub); - anchor = GNUNET_TIME_absolute_get (); - dki->issue.start = GNUNET_TIME_absolute_hton (anchor); - dki->issue.expire_withdraw = - GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_add (anchor, - GNUNET_TIME_relative_get_hour_ ())); - dki->issue.expire_spend = - GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_add (anchor, - GNUNET_TIME_relative_get_hour_ ())); - dki->issue.expire_legal = - GNUNET_TIME_absolute_hton (GNUNET_TIME_absolute_add (anchor, - GNUNET_TIME_relative_get_hour_ ())); - GNUNET_assert (GNUNET_OK == - TALER_string_to_amount (CURRENCY ":1.1", &amount)); - TALER_amount_hton (&dki->issue.value, &amount); - TALER_amount_hton (&dki->issue.fee_withdraw, &amount); - TALER_amount_hton (&dki->issue.fee_deposit, &amount); - TALER_amount_hton (&dki->issue.fee_refresh, &amount); - dki->issue.purpose.purpose = htonl (TALER_SIGNATURE_MASTER_DENOMINATION_KEY_VALIDITY); - dki->issue.purpose.size = - htonl (sizeof (struct TALER_MINTDB_DenominationKeyIssueInformation) - - offsetof (struct TALER_MINTDB_DenominationKeyIssueInformation, - issue.purpose)); - GNUNET_assert (GNUNET_OK == - GNUNET_CRYPTO_eddsa_sign (master_prvt, - &dki->issue.purpose, - &dki->issue.signature.eddsa_signature)); - GNUNET_free (master_prvt); - - return dki; -} - - - -struct TALER_MINTDB_DenominationKeyIssueInformation * -PERF_TALER_MINTDB_denomination_copy (const struct TALER_MINTDB_DenominationKeyIssueInformation *dki) -{ - struct TALER_MINTDB_DenominationKeyIssueInformation *copy; - - GNUNET_assert (NULL != - (copy = GNUNET_new (struct TALER_MINTDB_DenominationKeyIssueInformation))); - *copy = *dki; + (reserve_sig_key = GNUNET_CRYPTO_eddsa_key_create ())); { char *buffer = NULL; int size; @@ -423,29 +372,118 @@ PERF_TALER_MINTDB_denomination_copy (const struct TALER_MINTDB_DenominationKeyIs dki->denom_priv.rsa_private_key, &buffer))); GNUNET_assert (NULL != - (copy->denom_priv.rsa_private_key = - GNUNET_CRYPTO_rsa_private_key_decode(buffer, size))); + (denomination_key = + GNUNET_CRYPTO_rsa_private_key_decode (buffer, size))); GNUNET_free (buffer); } + GNUNET_assert (NULL != - (copy->denom_pub.rsa_public_key = - GNUNET_CRYPTO_rsa_public_key_dup (dki->denom_pub.rsa_public_key))); - return copy; + (coin->denom_pub.rsa_public_key = + GNUNET_CRYPTO_rsa_private_key_get_public (denomination_key))); + coin->reserve_pub.eddsa_pub = reserve->pub.eddsa_pub; + GNUNET_assert (GNUNET_OK == + TALER_string_to_amount (CURRENCY ":1.1", + &coin->amount_with_fee)); + GNUNET_assert (GNUNET_OK == + TALER_string_to_amount (CURRENCY ":1.1", + &coin->withdraw_fee)); + random_int = + GNUNET_CRYPTO_random_u32 (GNUNET_CRYPTO_QUALITY_WEAK, UINT32_MAX); + GNUNET_assert (NULL != + (coin->sig.rsa_signature = + GNUNET_CRYPTO_rsa_sign (denomination_key, + &random_int, + sizeof (random_int)))); + GNUNET_CRYPTO_hash_create_random (GNUNET_CRYPTO_QUALITY_WEAK, + &coin->h_coin_envelope); + unsigned_data.purpose.size = htonl (sizeof (unsigned_data)); + unsigned_data.purpose.purpose = htonl (GNUNET_SIGNATURE_PURPOSE_TEST); + unsigned_data.data = htonl (random_int); + GNUNET_assert (GNUNET_OK == + GNUNET_CRYPTO_eddsa_sign (reserve_sig_key, + (struct GNUNET_CRYPTO_EccSignaturePurpose *) &unsigned_data, + &coin->reserve_sig.eddsa_signature)); + GNUNET_free (reserve_sig_key); + GNUNET_CRYPTO_rsa_private_key_free (denomination_key); + return coin; } /** - * Free memory for a DenominationKeyIssueInformation + * Copies the given coin + * @param coin the coin to copy + * @return a copy of coin; NULL if error + */ +struct TALER_MINTDB_CollectableBlindcoin * +PERF_TALER_MINTDB_collectable_blindcoin_copy (const struct TALER_MINTDB_CollectableBlindcoin *coin) +{ + struct TALER_MINTDB_CollectableBlindcoin *copy; + + GNUNET_assert (NULL != + (copy = GNUNET_new (struct TALER_MINTDB_CollectableBlindcoin))); + *copy = *coin; + // No signature copy function found, Hacking it in + { + char *buffer = NULL; + int size; + GNUNET_assert (0 < + (size = GNUNET_CRYPTO_rsa_signature_encode ( + coin->sig.rsa_signature, + &buffer))); + GNUNET_assert (NULL != + (copy->sig.rsa_signature = GNUNET_CRYPTO_rsa_signature_decode( + buffer, + size))); + GNUNET_free (buffer); + } + GNUNET_assert (NULL != + (copy->denom_pub.rsa_public_key = + GNUNET_CRYPTO_rsa_public_key_dup (coin->denom_pub.rsa_public_key))); + return copy; +} + +/** + * Liberate memory of @a coin + * @param coin pointer to the structure to free */ int -PERF_TALER_MINTDB_denomination_free (struct TALER_MINTDB_DenominationKeyIssueInformation *dki) +PERF_TALER_MINTDB_collectable_blindcoin_free (struct TALER_MINTDB_CollectableBlindcoin *coin) { - if (NULL ==dki) + if (NULL == coin) return GNUNET_OK; - GNUNET_CRYPTO_rsa_private_key_free (dki->denom_priv.rsa_private_key); - GNUNET_CRYPTO_rsa_public_key_free (dki->denom_pub.rsa_public_key); - GNUNET_free (dki); + GNUNET_CRYPTO_rsa_signature_free (coin->sig.rsa_signature); + GNUNET_CRYPTO_rsa_public_key_free (coin->denom_pub.rsa_public_key); + GNUNET_free (coin); + return GNUNET_OK; +} + + +/** + * @return a randomly generated refresh session + */ +struct TALER_MINTDB_RefreshSession * +PERF_TALER_MINTDB_refresh_session_init () +{ + struct TALER_MINTDB_RefreshSession *refresh_session; + + GNUNET_assert (NULL != + (refresh_session = GNUNET_new (struct TALER_MINTDB_RefreshSession))); + refresh_session->noreveal_index = 1; + refresh_session->num_oldcoins = 1; + refresh_session->num_newcoins = 1; + + return refresh_session; +} + + +/** + * Free a refresh session + */ +int +PERF_TALER_MINTDB_refresh_session_free (struct TALER_MINTDB_RefreshSession *refresh_session) +{ + GNUNET_free (refresh_session); return GNUNET_OK; } diff --git a/src/mintdb/perf_taler_mintdb_init.h b/src/mintdb/perf_taler_mintdb_init.h index 3e2eb3cc2..4682f800f 100644 --- a/src/mintdb/perf_taler_mintdb_init.h +++ b/src/mintdb/perf_taler_mintdb_init.h @@ -27,70 +27,72 @@ #define CURRENCY "EUR" + /** - * @return a randomly generated CollectableBlindcoin + * Generate a dummy DenominationKeyInformation for testing purposes + * @return a dummy denomination key */ -struct TALER_MINTDB_CollectableBlindcoin * -PERF_TALER_MINTDB_collectable_blindcoin_init (const struct TALER_MINTDB_DenominationKeyIssueInformation *dki, - const struct TALER_MINTDB_Reserve *reserve); +struct TALER_MINTDB_DenominationKeyIssueInformation * +PERF_TALER_MINTDB_denomination_init (void); + /** - * @returns a copy of @a coin + * Copies the given denomination + * @param reserve the deposit copy + * @return a copy of @a deposit; NULL if error */ -struct TALER_MINTDB_CollectableBlindcoin * -PERF_TALER_MINTDB_collectable_blindcoin_copy (const struct TALER_MINTDB_CollectableBlindcoin *coin); +struct TALER_MINTDB_DenominationKeyIssueInformation * +PERF_TALER_MINTDB_denomination_copy ( + const struct TALER_MINTDB_DenominationKeyIssueInformation *dki); /** - * Liberate memory of @a coin + * Free memory of a DenominationKeyIssueInformation + * @param dki pointer to the struct to free */ int -PERF_TALER_MINTDB_collectable_blindcoin_free (struct TALER_MINTDB_CollectableBlindcoin *coin); +PERF_TALER_MINTDB_denomination_free ( + struct TALER_MINTDB_DenominationKeyIssueInformation *dki); /** - * @return a randomly generated reserve + * Generate a dummy reserve for testing + * @return a reserve with 1000 EUR in it */ struct TALER_MINTDB_Reserve * PERF_TALER_MINTDB_reserve_init (void); /** - * Returns a copy of @reserve + * Copies the given reserve + * @param reserve the reserve to copy + * @return a copy of @a reserve; NULL if error */ struct TALER_MINTDB_Reserve * PERF_TALER_MINTDB_reserve_copy (const struct TALER_MINTDB_Reserve *reserve); + /** - * Frees memory allocated to @a reserve + * Free memory of a reserve + * @param reserve pointer to the structure to be freed */ int PERF_TALER_MINTDB_reserve_free (struct TALER_MINTDB_Reserve *reserve); /** - * @return a randomly generated refresh session - */ -struct TALER_MINTDB_RefreshSession * -PERF_TALER_MINTDB_refresh_session_init (void); - - -/** - * Frees memory of a refresh_session - */ -int -PERF_TALER_MINTDB_refresh_session_free (struct TALER_MINTDB_RefreshSession *refresh_session); - - -/** - * Create a randomly generated deposit + * Generate a dummy deposit for testing purposes + * @param dki the denomination key used to sign the key */ struct TALER_MINTDB_Deposit * -PERF_TALER_MINTDB_deposit_init (const struct TALER_MINTDB_DenominationKeyIssueInformation *dki); +PERF_TALER_MINTDB_deposit_init ( + const struct TALER_MINTDB_DenominationKeyIssueInformation *dki); /** - * @returns a copy of @a deposit + * Copies the given deposit + * @param reserve the deposit copy + * @return a copy of @a deposit; NULL if error */ struct TALER_MINTDB_Deposit * PERF_TALER_MINTDB_deposit_copy (const struct TALER_MINTDB_Deposit *deposit); @@ -98,29 +100,41 @@ PERF_TALER_MINTDB_deposit_copy (const struct TALER_MINTDB_Deposit *deposit); /** * Free memory of a deposit + * @param deposit pointer to the structure to free */ int PERF_TALER_MINTDB_deposit_free (struct TALER_MINTDB_Deposit *deposit); /** - * Generate a randomly generate DenominationKeyInformation + * Generate a CollectableBlindcoin for testing purpuses + * @param dki denomination key used to sign the coin + * @param reserve reserve providing the money for the coin + * @return a randomly generated CollectableBlindcoin */ -struct TALER_MINTDB_DenominationKeyIssueInformation * -PERF_TALER_MINTDB_denomination_init (void); +struct TALER_MINTDB_CollectableBlindcoin * +PERF_TALER_MINTDB_collectable_blindcoin_init ( + const struct TALER_MINTDB_DenominationKeyIssueInformation *dki, + const struct TALER_MINTDB_Reserve *reserve); /** - * @returns a copy of @a dki + * Copies the given coin + * @param coin the coin to copy + * @return a copy of coin; NULL if error */ -struct TALER_MINTDB_DenominationKeyIssueInformation * -PERF_TALER_MINTDB_denomination_copy (const struct TALER_MINTDB_DenominationKeyIssueInformation *dki); +struct TALER_MINTDB_CollectableBlindcoin * +PERF_TALER_MINTDB_collectable_blindcoin_copy ( + const struct TALER_MINTDB_CollectableBlindcoin *coin); + /** - * Free memory for a DenominationKeyIssueInformation + * Liberate memory of @a coin + * @param coin pointer to the structure to free */ int -PERF_TALER_MINTDB_denomination_free (struct TALER_MINTDB_DenominationKeyIssueInformation *dki); +PERF_TALER_MINTDB_collectable_blindcoin_free ( + struct TALER_MINTDB_CollectableBlindcoin *coin); /** @@ -135,4 +149,19 @@ PERF_TALER_MINTDB_coin_public_info_init (void); */ int PERF_TALER_MINTDB_coin_public_info_free (struct TALER_CoinPublicInfo *cpi); + +/** + * @return a randomly generated refresh session + */ +struct TALER_MINTDB_RefreshSession * +PERF_TALER_MINTDB_refresh_session_init (void); + + +/** + * Frees memory of a refresh_session + */ +int +PERF_TALER_MINTDB_refresh_session_free ( + struct TALER_MINTDB_RefreshSession *refresh_session); + #endif diff --git a/src/mintdb/perf_taler_mintdb_interpreter.c b/src/mintdb/perf_taler_mintdb_interpreter.c index 25999792a..c377c8149 100644 --- a/src/mintdb/perf_taler_mintdb_interpreter.c +++ b/src/mintdb/perf_taler_mintdb_interpreter.c @@ -202,7 +202,7 @@ interpret_end_loop (struct PERF_TALER_MINTDB_interpreter_state *state) { unsigned int i; union PERF_TALER_MINTDB_Data zero = {0}; - unsigned int jump; + int jump; GNUNET_assert (GNUNET_SYSERR != (jump = cmd_find (state->cmd, state->cmd[state->i] @@ -235,7 +235,7 @@ interpret_end_loop (struct PERF_TALER_MINTDB_interpreter_state *state) static void interpret_save_array (struct PERF_TALER_MINTDB_interpreter_state *state) { - unsigned int loop_index, save_index; + int loop_index, save_index; unsigned int selection_chance; // Array initialization on first loop iteration @@ -314,7 +314,8 @@ interpret_save_array (struct PERF_TALER_MINTDB_interpreter_state *state) static void interpret_load_array (struct PERF_TALER_MINTDB_interpreter_state *state) { - unsigned int loop_index, save_index, loop_iter, permut_index; + unsigned int loop_iter; + int loop_index, save_index; union PERF_TALER_MINTDB_Data zero = {0}; union PERF_TALER_MINTDB_Data *loaded_data; @@ -327,11 +328,18 @@ interpret_load_array (struct PERF_TALER_MINTDB_interpreter_state *state) state->cmd[state->i] .details.load_array.label_save))); loop_iter = state->cmd[loop_index].details.loop.curr_iteration; - permut_index = state->cmd[state->i].details.load_array.permutation[loop_iter]; + { + int i, quotient; + quotient = loop_iter / state->cmd[save_index].details.save_array.nb_saved; + loop_iter = loop_iter % state->cmd[save_index].details.save_array.nb_saved; + for (i=0; i<=quotient; i++){ + loop_iter = state->cmd[state->i].details.load_array.permutation[loop_iter]; + } + } /* Extracting the data from the loop_indexth indice in save_index * array. */ - loaded_data = &state->cmd[save_index].details.save_array.data_saved[permut_index]; + loaded_data = &state->cmd[save_index].details.save_array.data_saved[loop_index]; switch (state->cmd[state->i].exposed_type) { case PERF_TALER_MINTDB_TIME: @@ -393,7 +401,7 @@ interpret (struct PERF_TALER_MINTDB_interpreter_state *state) case PERF_TALER_MINTDB_CMD_GAUGER: { - unsigned int start_index, stop_index; + int start_index, stop_index; struct timespec start, stop; unsigned long elapsed_ms; diff --git a/src/mintdb/perf_taler_mintdb_interpreter.h b/src/mintdb/perf_taler_mintdb_interpreter.h index 9f7ee4207..b69e39ebe 100644 --- a/src/mintdb/perf_taler_mintdb_interpreter.h +++ b/src/mintdb/perf_taler_mintdb_interpreter.h @@ -38,7 +38,7 @@ /** - * + * Prints @ _label to stdout */ #define PERF_TALER_MINTDB_INIT_CMD_DEBUG(_label) \ { \ @@ -86,6 +86,10 @@ /** * Commits the duration between @a _label_start and @a _label_stop * to Gauger with @a _description explaining + * @param _label_start label of the start of the measurment + * @param _label_stop label of the end of the measurment + * @param _description description of the measure displayed in gauger + * @param _divide number of measurments in the interval */ #define PERF_TALER_MINTDB_INIT_CMD_GAUGER(_label, _label_start, _label_stop, _description, _divide) \ { \ @@ -151,27 +155,26 @@ .label_save = _label_save \ } \ } + /** - * Insert a deposit into the database + * Inserts informations about a denomination key in the database */ -#define PERF_TALER_MINTDB_INIT_CMD_INSERT_DEPOSIT(_label, _label_dki) \ +#define PERF_TALER_MINTDB_INIT_CMD_INSERT_DENOMINATION(_label) \ { \ - .command = PERF_TALER_MINTDB_CMD_INSERT_DEPOSIT,\ + .command = PERF_TALER_MINTDB_CMD_INSERT_DENOMINATION, \ .label = _label, \ - .exposed_type = PERF_TALER_MINTDB_DEPOSIT, \ - .details.insert_deposit.label_dki = _label_dki, \ + .exposed_type = PERF_TALER_MINTDB_DENOMINATION_INFO, \ } /** - * Check if a deposit is in the database - * @param _label_deposit Label of the deposit to use + * Polls the database about informations regarding a specific denomination key */ -#define PERF_TALER_MINTDB_INIT_CMD_GET_DEPOSIT(_label, _label_deposit) \ +#define PERF_TALER_MINTDB_INIT_CMD_GET_DENOMINATION(_label, _label_source) \ { \ - .command = PERF_TALER_MINTDB_CMD_GET_DEPOSIT, \ + .command = PERF_TALER_MINTDB_CMD_GET_DENOMINATION, \ .label = _label, \ .exposed_type = PERF_TALER_MINTDB_NONE, \ - .details.get_deposit.label_source = _label_deposit \ + .details.get_denomination.label_source = _label_source, \ } /** @@ -198,8 +201,36 @@ } +/** + * Insert a deposit into the database + * @param _label_dki source to use for the denomination key + */ +#define PERF_TALER_MINTDB_INIT_CMD_INSERT_DEPOSIT(_label, _label_dki) \ +{ \ + .command = PERF_TALER_MINTDB_CMD_INSERT_DEPOSIT,\ + .label = _label, \ + .exposed_type = PERF_TALER_MINTDB_DEPOSIT, \ + .details.insert_deposit.label_dki = _label_dki, \ +} + + +/** + * Check if a deposit is in the database + * @param _label_deposit Label of the deposit to use + */ +#define PERF_TALER_MINTDB_INIT_CMD_GET_DEPOSIT(_label, _label_deposit) \ +{ \ + .command = PERF_TALER_MINTDB_CMD_GET_DEPOSIT, \ + .label = _label, \ + .exposed_type = PERF_TALER_MINTDB_NONE, \ + .details.get_deposit.label_source = _label_deposit \ +} + + /** * Inserts informations about a withdrawal in the database + * @param _label_dki denomination key used to sign the coin + * @param _label_reserve reserve used to emmit the coin */ #define PERF_TALER_MINTDB_INIT_CMD_INSERT_WITHDRAW(_label, _label_dki, _label_reserve) \ { \ @@ -208,9 +239,9 @@ .exposed_type = PERF_TALER_MINTDB_BLINDCOIN, \ .details.insert_withdraw = {\ .label_dki = _label_dki, \ - .label.reserve = _label_reserve, \ + .label_reserve = _label_reserve, \ } \ -}\ +} /** @@ -224,27 +255,6 @@ .details.get_withdraw.label_source = _label_source, \ } -/** - * Inserts informations about a denomination key in the database - */ -#define PERF_TALER_MINTDB_INIT_CMD_INSERT_DENOMINATION(_label) \ -{ \ - .command = PERF_TALER_MINTDB_CMD_INSERT_DENOMINATION, \ - .label = _label, \ - .exposed_type = PERF_TALER_MINTDB_DENOMINATION_INFO, \ -} - -/** - * Polls the database about informations regarding a specific denomination key - */ -#define PERF_TALER_MINTDB_INIT_CMD_GET_DENOMINATION(_label, _label_source) \ -{ \ - .command = PERF_TALER_MINTDB_CMD_GET_DENOMINATION, \ - .label = _label, \ - .exposed_type = PERF_TALER_MINTDB_NONE, \ - .details.get_denomination.label_source = _label_source, \ -} - /** * The type of data stored diff --git a/src/mintdb/perf_taler_mintdb_values.h b/src/mintdb/perf_taler_mintdb_values.h index f0cdd4f10..f8a8fde0b 100644 --- a/src/mintdb/perf_taler_mintdb_values.h +++ b/src/mintdb/perf_taler_mintdb_values.h @@ -22,10 +22,17 @@ #define __PERF_TALER_MINTDB__VALUES_H__ +#define PERF_TALER_MINTDB_NB_DENOMINATION_INIT 100 +#define PERF_TALER_MINTDB_NB_DENOMINATION_SAVE 100 -#define PERF_TALER_MINTDB_NB_DEPOSIT_INIT 100 -#define PERF_TALER_MINTDB_NB_DEPOSIT_GET 1 +#define PERF_TALER_MINTDB_NB_RESERVE_INIT 10000 +#define PERF_TALER_MINTDB_NB_RESERVE_SAVE 1000 +#define PERF_TALER_MINTDB_NB_DEPOSIT_INIT 100000 +#define PERF_TALER_MINTDB_NB_DEPOSIT_SAVE 1000 + +#define PERF_TALER_MINTDB_NB_WITHDRAW_INIT 100000 +#define PERF_TALER_MINTDB_NB_WITHDRAW_SAVE 1000 #endif From 585287dc8d779deef7052a5455c2eded09f4d965 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Tue, 30 Jun 2015 13:55:39 +0200 Subject: [PATCH 7/9] fix #3869: outdated FSF address --- .../{Perpetua Bold.ttf => Perpetua_Bold.ttf} | Bin ...Bold Italic.ttf => Perpetua_Bold_Italic.ttf} | Bin ...{Perpetua Italic.ttf => Perpetua_Italic.ttf} | Bin ...nte - Version en Espa§ol.txt => ELUA-es.txt} | 0 ...{End User Licence Agreement.txt => ELUA.txt} | 0 .../Smoth-Bight Italic - Por Kustren.otf | Bin 50820 -> 0 bytes ...-Bight - Por Kustren.otf => Smoth-Bight.otf} | Bin src/util/os_installation.c | 4 ++-- 8 files changed, 2 insertions(+), 2 deletions(-) rename doc/logos/fonts/perpetue/{Perpetua Bold.ttf => Perpetua_Bold.ttf} (100%) rename doc/logos/fonts/perpetue/{Perpetua Bold Italic.ttf => Perpetua_Bold_Italic.ttf} (100%) rename doc/logos/fonts/perpetue/{Perpetua Italic.ttf => Perpetua_Italic.ttf} (100%) rename doc/logos/fonts/smoth_bight/{Licencia de la fuente - Version en Espa§ol.txt => ELUA-es.txt} (100%) rename doc/logos/fonts/smoth_bight/{End User Licence Agreement.txt => ELUA.txt} (100%) delete mode 100755 doc/logos/fonts/smoth_bight/Smoth-Bight Italic - Por Kustren.otf rename doc/logos/fonts/smoth_bight/{Smoth-Bight - Por Kustren.otf => Smoth-Bight.otf} (100%) diff --git a/doc/logos/fonts/perpetue/Perpetua Bold.ttf b/doc/logos/fonts/perpetue/Perpetua_Bold.ttf similarity index 100% rename from doc/logos/fonts/perpetue/Perpetua Bold.ttf rename to doc/logos/fonts/perpetue/Perpetua_Bold.ttf diff --git a/doc/logos/fonts/perpetue/Perpetua Bold Italic.ttf b/doc/logos/fonts/perpetue/Perpetua_Bold_Italic.ttf similarity index 100% rename from doc/logos/fonts/perpetue/Perpetua Bold Italic.ttf rename to doc/logos/fonts/perpetue/Perpetua_Bold_Italic.ttf diff --git a/doc/logos/fonts/perpetue/Perpetua Italic.ttf b/doc/logos/fonts/perpetue/Perpetua_Italic.ttf similarity index 100% rename from doc/logos/fonts/perpetue/Perpetua Italic.ttf rename to doc/logos/fonts/perpetue/Perpetua_Italic.ttf diff --git a/doc/logos/fonts/smoth_bight/Licencia de la fuente - Version en Espa§ol.txt b/doc/logos/fonts/smoth_bight/ELUA-es.txt similarity index 100% rename from doc/logos/fonts/smoth_bight/Licencia de la fuente - Version en Espa§ol.txt rename to doc/logos/fonts/smoth_bight/ELUA-es.txt diff --git a/doc/logos/fonts/smoth_bight/End User Licence Agreement.txt b/doc/logos/fonts/smoth_bight/ELUA.txt similarity index 100% rename from doc/logos/fonts/smoth_bight/End User Licence Agreement.txt rename to doc/logos/fonts/smoth_bight/ELUA.txt diff --git a/doc/logos/fonts/smoth_bight/Smoth-Bight Italic - Por Kustren.otf b/doc/logos/fonts/smoth_bight/Smoth-Bight Italic - Por Kustren.otf deleted file mode 100755 index 5fb25e646c38e2c25b8710509093b63439872148..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 50820 zcmbrm2YgdU);By?fK0S z?H7EO;@R}$y zjg^gy2;L-++DOa;J>xWi<`8El(i}9I_-G={MQez!C(=CR!+CNd%}392f+o`BBl!Zz z&z{JqkUOVkB0UMxhbPi*D1&o;A}vHKxxe$A{7BmUk@QqFle;G8lT`Bim4!Y&Ycn!@*gNuka#QnCa|=^b7RF>| z=coCsWBG*VCuXE4yXgPSU*WSgH8(FkJIlv!p|9_wX`lHMwJ%`rVwt(P{2^mbcCODs zmy8R+vSOn{A|p44M8w2yj!jF?^Vyf3mG4uOnCFw6o0^ypg71U!QBYrYR$_)vVpfVz zPiC=0&(BVXi)7Ndob4u-ru_MR+Ar9e&+aQXLpa7iDu z7G=Pn&m(o@vEMLZ|F`?FhW@*57W_v&=0JV9Q2)XIrpJYFZyeMei=t5oiiE$- z5J#{%n;|z1%JP{!tU{!>z-5@&TH~_6hFYO!&iE zP6ocNtGHKFK?k_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YVN0nz>tU;5L% zhCr)i@2sL%%racJ4O=k};Ps9agD@Z}ZMQDe7;~e&@d@$M+@ma<-bS&kShq$In|L`JPOqN(LG&B--14{U{gsqbB0UZS^m%6`tEU zdAV79`)c>+nVWcLZig+fN8e+uCM9hqd7Bjx5A;xr=)u_G5_)hXHBuc(#!@6Pm^;${6DvtOGnLg4wWNmN`FL9Yj9YaG66)h;wP3!O| zQukQt|CP7bz!g57Pe5U6iSf*dK5a(K^rd3aB!UdswjV%l__Mvdf!;KWbm{2mTv`O5 zJXuLj4KOf5B8f*fA+&*$0!~D>P~ME3bw)Rw&+FOgF*EKekE=&}^1T=1C(>g%M6h?? zr#vP+#>IvEY<+TsBcMIj1`}#f&LUg%8eXEHe?hoKa14_g3aUiw+Ks?on-x0fss5?_y+5o z-VVGx`jhd&onG|Cht3xPU_coWjs~c5OOwY2>w2W$IKxuu7&bk_?F-H5Uv6JWm8@HF zxPaR7E}EEC+&~ecg7xi={f)E&IX)^5x)ZU%vehuYa&5XQG!8 zRgf$xSo9a}s%)rP&mXMejdlFVUA175k_(`Kb5zly*KVijJbHx|9U6|Z0@VROaIXNF z`r*-zQEQrLGreghebKzqM{1i>LDYY_bTol^gBSIwXO))(lFOs&yu#LE^ko0zGG8Yw zzGlQ{SHNTswlucz9Nr{EIZBQ9=H1a z@vL7AX^KXMT4U2oin>vBc6r(e5+4wOLwAB2weTdVH_bF>#yF4~#x7$S>`#sKzDJOd zHLPr>i6Zrf0KM#`l5JeKZW~AaUik2AhP+oeLLJB6IkFp3FW-zGubL&D!tibT5`8L7 z>z4xBq)63dV*vQm6RHdZ?{I9!Lfp?*E;syxty)4s@30sT#kyl2`kypTJ9#kE%F6x= D&Pe<4 diff --git a/doc/logos/fonts/smoth_bight/Smoth-Bight - Por Kustren.otf b/doc/logos/fonts/smoth_bight/Smoth-Bight.otf similarity index 100% rename from doc/logos/fonts/smoth_bight/Smoth-Bight - Por Kustren.otf rename to doc/logos/fonts/smoth_bight/Smoth-Bight.otf diff --git a/src/util/os_installation.c b/src/util/os_installation.c index 1308fa3f3..ec1868a84 100644 --- a/src/util/os_installation.c +++ b/src/util/os_installation.c @@ -14,8 +14,8 @@ You should have received a copy of the GNU General Public License along with GNUnet; see the file COPYING. If not, write to the - Free Software Foundation, Inc., 59 Temple Place - Suite 330, - Boston, MA 02111-1307, USA. + Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, + Boston, MA 02110-1301, USA. */ /** From 245adcaab2cd866a476d0f3e48aa29f26c8fbc7f Mon Sep 17 00:00:00 2001 From: Fournier Nicolas Date: Tue, 30 Jun 2015 14:01:06 +0200 Subject: [PATCH 8/9] Using GNUNET logging rather than printf --- src/mintdb/perf_taler_mintdb.c | 4 +++- src/mintdb/perf_taler_mintdb_interpreter.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mintdb/perf_taler_mintdb.c b/src/mintdb/perf_taler_mintdb.c index 58cf6d88c..49fe073aa 100644 --- a/src/mintdb/perf_taler_mintdb.c +++ b/src/mintdb/perf_taler_mintdb.c @@ -34,6 +34,8 @@ main (int argc, char ** argv) struct PERF_TALER_MINTDB_Cmd test[] = { // Denomination used to create coins + PERF_TALER_MINTDB_INIT_CMD_DEBUG ("00 - Start of interpretor"), + PERF_TALER_MINTDB_INIT_CMD_LOOP ("01 - denomination loop", PERF_TALER_MINTDB_NB_DENOMINATION_INIT), PERF_TALER_MINTDB_INIT_CMD_START_TRANSACTION ("01 - start transaction"), @@ -104,7 +106,7 @@ main (int argc, char ** argv) }; GNUNET_log_setup ("perf-taler-mintdb", - "WARNING", + "INFO", NULL); config = GNUNET_CONFIGURATION_create(); GNUNET_CONFIGURATION_load(config, "./test-mint-db-postgres.conf"); diff --git a/src/mintdb/perf_taler_mintdb_interpreter.c b/src/mintdb/perf_taler_mintdb_interpreter.c index c377c8149..059070303 100644 --- a/src/mintdb/perf_taler_mintdb_interpreter.c +++ b/src/mintdb/perf_taler_mintdb_interpreter.c @@ -385,7 +385,7 @@ interpret (struct PERF_TALER_MINTDB_interpreter_state *state) return GNUNET_YES; case PERF_TALER_MINTDB_CMD_DEBUG: - printf ("%s\n", state->cmd[state->i].label); + GNUNET_log (GNUNET_ERROR_TYPE_INFO, "%s\n", state->cmd[state->i].label); break; case PERF_TALER_MINTDB_CMD_LOOP: From d0a6b47099384e39e820687fe7b83628514a6382 Mon Sep 17 00:00:00 2001 From: Fournier Nicolas Date: Tue, 30 Jun 2015 18:18:31 +0200 Subject: [PATCH 9/9] Finished work on database initialization --- src/mintdb/perf_taler_mintdb.c | 18 ++--- src/mintdb/perf_taler_mintdb_init.c | 7 +- src/mintdb/perf_taler_mintdb_interpreter.c | 76 ++++++++++++++-------- src/mintdb/perf_taler_mintdb_interpreter.h | 3 +- src/mintdb/perf_taler_mintdb_values.h | 16 ++--- 5 files changed, 70 insertions(+), 50 deletions(-) diff --git a/src/mintdb/perf_taler_mintdb.c b/src/mintdb/perf_taler_mintdb.c index 49fe073aa..53c9a1c24 100644 --- a/src/mintdb/perf_taler_mintdb.c +++ b/src/mintdb/perf_taler_mintdb.c @@ -44,8 +44,7 @@ main (int argc, char ** argv) PERF_TALER_MINTDB_INIT_CMD_SAVE_ARRAY ("01 - save denomination", "01 - denomination loop", "01 - denomination", - PERF_TALER_MINTDB_NB_DENOMINATION_SAVE, - PERF_TALER_MINTDB_BLINDCOIN), + PERF_TALER_MINTDB_NB_DENOMINATION_SAVE), PERF_TALER_MINTDB_INIT_CMD_END_LOOP ("01 - denomination loop end", "01 - denomination loop"), PERF_TALER_MINTDB_INIT_CMD_DEBUG ("01 - init denomination complete"), @@ -57,8 +56,7 @@ main (int argc, char ** argv) PERF_TALER_MINTDB_INIT_CMD_SAVE_ARRAY ("02 - save reserve", "02 - init reserve loop", "02 - reserve", - PERF_TALER_MINTDB_NB_RESERVE_SAVE, - PERF_TALER_MINTDB_RESERVE), + PERF_TALER_MINTDB_NB_RESERVE_SAVE), PERF_TALER_MINTDB_INIT_CMD_END_LOOP ("02 - init reserve end loop", "02 - init reserve loop"), PERF_TALER_MINTDB_INIT_CMD_DEBUG ("02 - reserve init complete"), @@ -80,8 +78,7 @@ main (int argc, char ** argv) PERF_TALER_MINTDB_INIT_CMD_SAVE_ARRAY ("03 - blindcoin array", "03 - init withdraw loop", "03 - withdraw", - PERF_TALER_MINTDB_NB_WITHDRAW_SAVE, - PERF_TALER_MINTDB_BLINDCOIN), + PERF_TALER_MINTDB_NB_WITHDRAW_SAVE), PERF_TALER_MINTDB_INIT_CMD_END_LOOP ("03 - withdraw init end loop", "03 - init withdraw loop"), PERF_TALER_MINTDB_INIT_CMD_DEBUG ("03 - withdraw init complete"), @@ -90,14 +87,17 @@ main (int argc, char ** argv) PERF_TALER_MINTDB_INIT_CMD_LOOP ("04 - deposit init loop", PERF_TALER_MINTDB_NB_DEPOSIT_INIT), PERF_TALER_MINTDB_INIT_CMD_START_TRANSACTION ("04 - start transaction"), + PERF_TALER_MINTDB_INIT_CMD_LOAD_ARRAY ("04 - denomination load", + "04 - deposit init loop", + "01 - save denomination"), + PERF_TALER_MINTDB_INIT_CMD_INSERT_DEPOSIT ("04 - deposit", - "01 - denomination"), + "04 - denomination load"), PERF_TALER_MINTDB_INIT_CMD_COMMIT_TRANSACTION ("04 - commit transaction"), PERF_TALER_MINTDB_INIT_CMD_SAVE_ARRAY ("04 - deposit array", "04 - deposit init loop", "04 - deposit", - PERF_TALER_MINTDB_NB_DEPOSIT_SAVE, - PERF_TALER_MINTDB_DEPOSIT), + PERF_TALER_MINTDB_NB_DEPOSIT_SAVE), PERF_TALER_MINTDB_INIT_CMD_END_LOOP ("04 - deposit init loop end", "04 - deposit init loop"), PERF_TALER_MINTDB_INIT_CMD_DEBUG ("04 - deposit init complete"), diff --git a/src/mintdb/perf_taler_mintdb_init.c b/src/mintdb/perf_taler_mintdb_init.c index a0019f84c..ab55248ce 100644 --- a/src/mintdb/perf_taler_mintdb_init.c +++ b/src/mintdb/perf_taler_mintdb_init.c @@ -230,8 +230,6 @@ PERF_TALER_MINTDB_deposit_init (const struct TALER_MINTDB_DenominationKeyIssueIn GNUNET_CRYPTO_rsa_sign (dki->denom_priv.rsa_private_key, &coin.coin_pub.eddsa_pub, sizeof (struct GNUNET_CRYPTO_EddsaPublicKey)))); - - GNUNET_free (eddsa_prvt); } { //csig struct u32_presign @@ -359,7 +357,6 @@ PERF_TALER_MINTDB_collectable_blindcoin_init ( } unsigned_data; struct TALER_MINTDB_CollectableBlindcoin *coin; - GNUNET_assert (NULL != (coin = GNUNET_new (struct TALER_MINTDB_CollectableBlindcoin))); GNUNET_assert (NULL != @@ -376,7 +373,6 @@ PERF_TALER_MINTDB_collectable_blindcoin_init ( GNUNET_CRYPTO_rsa_private_key_decode (buffer, size))); GNUNET_free (buffer); } - GNUNET_assert (NULL != (coin->denom_pub.rsa_public_key = GNUNET_CRYPTO_rsa_private_key_get_public (denomination_key))); @@ -394,6 +390,9 @@ PERF_TALER_MINTDB_collectable_blindcoin_init ( GNUNET_CRYPTO_rsa_sign (denomination_key, &random_int, sizeof (random_int)))); + char *buffer; + GNUNET_CRYPTO_rsa_signature_encode (coin->sig.rsa_signature, &buffer); + free (buffer); GNUNET_CRYPTO_hash_create_random (GNUNET_CRYPTO_QUALITY_WEAK, &coin->h_coin_envelope); unsigned_data.purpose.size = htonl (sizeof (unsigned_data)); diff --git a/src/mintdb/perf_taler_mintdb_interpreter.c b/src/mintdb/perf_taler_mintdb_interpreter.c index 059070303..5a1ec2921 100644 --- a/src/mintdb/perf_taler_mintdb_interpreter.c +++ b/src/mintdb/perf_taler_mintdb_interpreter.c @@ -50,6 +50,7 @@ struct PERF_TALER_MINTDB_interpreter_state unsigned int i; }; + /** * Free the memory of @a data, with data of type @a type */ @@ -89,7 +90,6 @@ data_free (union PERF_TALER_MINTDB_Data *data, enum PERF_TALER_MINTDB_Type type) } - /** * Finds the first command in cmd with the name search * @@ -121,14 +121,25 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[]) switch (cmd[i].command) { case PERF_TALER_MINTDB_CMD_SAVE_ARRAY: - // Allocation of memory for saving data + { + int save_label; + + GNUNET_assert (GNUNET_SYSERR != + (save_label = cmd_find (cmd, + cmd[i].details.save_array.label_save))); + /* Allocation of memory for saving data */ cmd[i].details.save_array.data_saved = GNUNET_new_array (cmd[i].details.save_array.nb_saved, union PERF_TALER_MINTDB_Data); + /* Getting the type saved from the given label */ + cmd[i].details.save_array.type_saved = + cmd[save_label].exposed_type; + } + break; case PERF_TALER_MINTDB_CMD_LOAD_ARRAY: - // Creating the permutation array to randomize the data order + /* Creating the permutation array to randomize the data order */ { int save_index ; @@ -141,7 +152,7 @@ cmd_init (struct PERF_TALER_MINTDB_Cmd cmd[]) GNUNET_CRYPTO_random_permute ( GNUNET_CRYPTO_QUALITY_WEAK, cmd[save_index].details.save_array.nb_saved))); - // Initializing the type based on the type of the saved array + /* Initializing the type based on the type of the saved array */ cmd[i].exposed_type = cmd[save_index].details.save_array.type_saved; } break; @@ -215,14 +226,14 @@ interpret_end_loop (struct PERF_TALER_MINTDB_interpreter_state *state) } state->cmd[jump].details.loop.curr_iteration++; - // If the loop is not finished + /* If the loop is not finished */ if (state->cmd[jump].details.loop.max_iterations > state->cmd[jump].details.loop.curr_iteration) { - // jump back to the start + /* jump back to the start */ state->i = jump; }else{ - // Reset the loop counter and continue running + /* Reset the loop counter and continue running */ state->cmd[jump].details.loop.curr_iteration = 0; } } @@ -238,8 +249,6 @@ interpret_save_array (struct PERF_TALER_MINTDB_interpreter_state *state) int loop_index, save_index; unsigned int selection_chance; - // Array initialization on first loop iteration - // Alows for nested loops GNUNET_assert (GNUNET_SYSERR != (loop_index = cmd_find (state->cmd, state->cmd[state->i] @@ -248,19 +257,21 @@ interpret_save_array (struct PERF_TALER_MINTDB_interpreter_state *state) (save_index = cmd_find (state->cmd, state->cmd[state->i] .details.save_array.label_save))); - if (0 == state->cmd[loop_index].details.loop.curr_iteration) + /* Array initialization on first loop iteration + Alows for nested loops */ + if (0 == state->cmd[loop_index].details.loop.curr_iteration) { state->cmd[state->i].details.save_array.index = 0; } - // The probobility distribution of the saved items will be a little biased - // against the few last items but it should not be a big problem. + /* The probobility distribution of the saved items will be a little biased + against the few last items but it should not be a big problem. */ selection_chance = state->cmd[loop_index].details.loop.max_iterations / state->cmd[state->i].details.save_array.nb_saved; /* - * If the remaining sapce is equal to the remaining number of + * If the remaining space is equal to the remaining number of * iterations, the item is automaticly saved. * - * Else it is saved only if rdn is 0 + * Else it is saved only if the random numbre generated is 0 */ if ((0 < (state->cmd[state->i].details.save_array.nb_saved - state->cmd[state->i].details.save_array.index)) && @@ -311,14 +322,17 @@ interpret_save_array (struct PERF_TALER_MINTDB_interpreter_state *state) } +/** + * Run when the current command is LOAD_ARRAY + * Get data from a SAVE_ARRAY and exposes a copy + */ static void interpret_load_array (struct PERF_TALER_MINTDB_interpreter_state *state) { unsigned int loop_iter; int loop_index, save_index; - union PERF_TALER_MINTDB_Data zero = {0}; union PERF_TALER_MINTDB_Data *loaded_data; - + GNUNET_assert (GNUNET_SYSERR != (loop_index = cmd_find (state->cmd, state->cmd[state->i] @@ -330,16 +344,18 @@ interpret_load_array (struct PERF_TALER_MINTDB_interpreter_state *state) loop_iter = state->cmd[loop_index].details.loop.curr_iteration; { int i, quotient; + + /* in case the iteration number is higher than the amount saved, + * the number is run several times in the permutation array */ quotient = loop_iter / state->cmd[save_index].details.save_array.nb_saved; loop_iter = loop_iter % state->cmd[save_index].details.save_array.nb_saved; - for (i=0; i<=quotient; i++){ + for (i=0; i<=quotient; i++) loop_iter = state->cmd[state->i].details.load_array.permutation[loop_iter]; - } } /* Extracting the data from the loop_indexth indice in save_index * array. */ - loaded_data = &state->cmd[save_index].details.save_array.data_saved[loop_index]; + loaded_data = &state->cmd[save_index].details.save_array.data_saved[loop_iter]; switch (state->cmd[state->i].exposed_type) { case PERF_TALER_MINTDB_TIME: @@ -347,26 +363,32 @@ interpret_load_array (struct PERF_TALER_MINTDB_interpreter_state *state) break; case PERF_TALER_MINTDB_DEPOSIT: - state->cmd[state->i].exposed.deposit = loaded_data->deposit; + state->cmd[state->i].exposed.deposit = + PERF_TALER_MINTDB_deposit_copy (loaded_data->deposit); break; case PERF_TALER_MINTDB_BLINDCOIN: - state->cmd[state->i].exposed.blindcoin = loaded_data->blindcoin; + state->cmd[state->i].exposed.blindcoin = + PERF_TALER_MINTDB_collectable_blindcoin_copy (loaded_data->blindcoin); break; case PERF_TALER_MINTDB_RESERVE: - state->cmd[state->i].exposed.reserve = loaded_data->reserve; + state->cmd[state->i].exposed.reserve = + PERF_TALER_MINTDB_reserve_copy (loaded_data->reserve); break; case PERF_TALER_MINTDB_DENOMINATION_INFO: - state->cmd[state->i].exposed.dki = loaded_data->dki; + state->cmd[state->i].exposed.dki = + PERF_TALER_MINTDB_denomination_copy (loaded_data->dki); + break; case PERF_TALER_MINTDB_COIN_INFO: state->cmd[state->i].exposed.cpi = loaded_data->cpi; + break; + default: break; } - *loaded_data = zero; } /** @@ -472,7 +494,7 @@ interpret (struct PERF_TALER_MINTDB_interpreter_state *state) { int source_index; struct TALER_MINTDB_Deposit *deposit; - + GNUNET_assert (GNUNET_SYSERR != (source_index = cmd_find (state->cmd, state->cmd[state->i] @@ -511,7 +533,7 @@ interpret (struct PERF_TALER_MINTDB_interpreter_state *state) { int source_index; struct TALER_MINTDB_Reserve *reserve; - + GNUNET_assert (GNUNET_SYSERR != (source_index = cmd_find (state->cmd, state->cmd[state->i] @@ -560,7 +582,7 @@ interpret (struct PERF_TALER_MINTDB_interpreter_state *state) { int dki_index, reserve_index; struct TALER_MINTDB_CollectableBlindcoin *blindcoin ; - + GNUNET_assert (GNUNET_SYSERR != (dki_index = cmd_find ( state->cmd, diff --git a/src/mintdb/perf_taler_mintdb_interpreter.h b/src/mintdb/perf_taler_mintdb_interpreter.h index b69e39ebe..1d64c3938 100644 --- a/src/mintdb/perf_taler_mintdb_interpreter.h +++ b/src/mintdb/perf_taler_mintdb_interpreter.h @@ -128,7 +128,7 @@ * Extracts @a _nb_saved items of type @a _save_type * from the command @a _label_save during the loop @a _label_loop */ -#define PERF_TALER_MINTDB_INIT_CMD_SAVE_ARRAY(_label, _label_loop, _label_save, _nb_saved, _save_type) \ +#define PERF_TALER_MINTDB_INIT_CMD_SAVE_ARRAY(_label, _label_loop, _label_save, _nb_saved) \ { \ .command = PERF_TALER_MINTDB_CMD_SAVE_ARRAY, \ .label = _label, \ @@ -137,7 +137,6 @@ .label_loop = _label_loop, \ .label_save = _label_save, \ .nb_saved = _nb_saved, \ - .type_saved = _save_type \ } \ } diff --git a/src/mintdb/perf_taler_mintdb_values.h b/src/mintdb/perf_taler_mintdb_values.h index f8a8fde0b..b3527224d 100644 --- a/src/mintdb/perf_taler_mintdb_values.h +++ b/src/mintdb/perf_taler_mintdb_values.h @@ -22,17 +22,17 @@ #define __PERF_TALER_MINTDB__VALUES_H__ -#define PERF_TALER_MINTDB_NB_DENOMINATION_INIT 100 -#define PERF_TALER_MINTDB_NB_DENOMINATION_SAVE 100 +#define PERF_TALER_MINTDB_NB_DENOMINATION_INIT 10 +#define PERF_TALER_MINTDB_NB_DENOMINATION_SAVE 10 -#define PERF_TALER_MINTDB_NB_RESERVE_INIT 10000 -#define PERF_TALER_MINTDB_NB_RESERVE_SAVE 1000 +#define PERF_TALER_MINTDB_NB_RESERVE_INIT 100 +#define PERF_TALER_MINTDB_NB_RESERVE_SAVE 10 -#define PERF_TALER_MINTDB_NB_DEPOSIT_INIT 100000 -#define PERF_TALER_MINTDB_NB_DEPOSIT_SAVE 1000 +#define PERF_TALER_MINTDB_NB_DEPOSIT_INIT 1000 +#define PERF_TALER_MINTDB_NB_DEPOSIT_SAVE 10 -#define PERF_TALER_MINTDB_NB_WITHDRAW_INIT 100000 -#define PERF_TALER_MINTDB_NB_WITHDRAW_SAVE 1000 +#define PERF_TALER_MINTDB_NB_WITHDRAW_INIT 100 +#define PERF_TALER_MINTDB_NB_WITHDRAW_SAVE 10 #endif