diff --git a/src/carrot_core/config.h b/src/carrot_core/config.h index 6ac6cc452..84aa2afa3 100644 --- a/src/carrot_core/config.h +++ b/src/carrot_core/config.h @@ -70,7 +70,7 @@ static constexpr const unsigned char CARROT_DOMAIN_SEP_SUBADDRESS_SCALAR[] = "Ca static constexpr const unsigned int CARROT_MIN_TX_OUTPUTS = 2; static constexpr const unsigned int CARROT_MAX_TX_OUTPUTS = 8; static constexpr const unsigned int CARROT_MIN_TX_INPUTS = 1; -static constexpr const unsigned int CARROT_MAX_TX_INPUTS = 128; +static constexpr const unsigned int CARROT_MAX_TX_INPUTS = 64; // SPARC addressing protocol domain separators static constexpr const unsigned char SPARC_DOMAIN_SEP_RETURN_PUBKEY_ENCRYPTION_MASK[] = "SPARC return pubkey encryption mask"; diff --git a/src/carrot_impl/input_selection.cpp b/src/carrot_impl/input_selection.cpp index 25f65f465..3f29917ed 100644 --- a/src/carrot_impl/input_selection.cpp +++ b/src/carrot_impl/input_selection.cpp @@ -318,33 +318,27 @@ std::vector get_input_counts_in_preferred_order() // 1 or 2 randomly, then // other ascending powers of 2, then // other ascending positive numbers - + //! @TODO: MRL discussion about 2 vs 1 default input count when 1 input can pay. If we default // to 1, then that may reveal more information about the amount, and reveals that one can't pay // with 1 output when using 2. Vice versa, if we default to 2, then that means that one only // owns 1 output when using 1. It may be the most advantageous to randomly switch between - // preferring 1 vs 2. See: https://lavalle.pl/planning/node437.html. Con to this approach: if we - // default to 1 over 2 always then there's scenarios where we net save tx fees and proving time. - - //static_assert(CARROT_MAX_TX_INPUTS == FCMP_PLUS_PLUS_MAX_INPUTS, "inconsistent input count max limit"); - static_assert(CARROT_MIN_TX_INPUTS == 1 && CARROT_MAX_TX_INPUTS == 128, + // preferring 1 vs 2. See: https://lavalle.pl/planning/node437.html. Con to this approach: if we + // default to 1 over 2 always then there's scenarios where we net save tx fees and proving time. + + //static_assert(CARROT_MAX_TX_INPUTS == FCMP_PLUS_PLUS_MAX_INPUTS, "inconsistent input count max limit"); + static_assert(CARROT_MIN_TX_INPUTS == 1 && CARROT_MAX_TX_INPUTS == 64, "refactor this function for different input count limits"); const bool random_bit = 0 == (crypto::rand() & 0x01); if (random_bit) - return {2, 1, 4, 8, 16, 32, 64, 128, 3, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127}; + return {2, 1, 4, 8, 16, 32, 64, 3, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63}; else - return {1, 2, 4, 8, 16, 32, 64, 128, 3, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, - 24, 25, 26, 27, 28, 29, 30, 31, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, - 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 65, 66, 67, 68, 69, 70, 71, 72, 73, - 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, - 98, 99, 100, 101, 102, 103, 104, 105, 106, 107, 108, 109, 110, 111, 112, 113, 114, 115, 116, - 117, 118, 119, 120, 121, 122, 123, 124, 125, 126, 127}; + return {1, 2, 4, 8, 16, 32, 64, 3, 5, 6, 7, 9, 10, 11, 12, 13, 14, 15, 17, 18, 19, 20, 21, 22, 23, + 24, 25, 26, 27, 28, 29, 30, 31, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, + 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63}; } //------------------------------------------------------------------------------------------------------------------- select_inputs_func_t make_single_transfer_input_selector( diff --git a/src/simplewallet/simplewallet.cpp b/src/simplewallet/simplewallet.cpp index 5522f5cc0..c5ff378bd 100644 --- a/src/simplewallet/simplewallet.cpp +++ b/src/simplewallet/simplewallet.cpp @@ -7929,8 +7929,8 @@ bool simple_wallet::sweep_main(uint32_t account, uint64_t below, bool locked, co prompt << tr("WARNING: Outputs of multiple addresses are being used together, which might potentially compromise your privacy.\n"); } - if (!process_ring_members(ptx_vector, prompt, m_wallet->print_ring_members())) - return true; + // if (!process_ring_members(ptx_vector, prompt, m_wallet->print_ring_members())) + // return true; if (ptx_vector.size() > 1) { prompt << boost::format(tr("Sweeping %s in %llu transactions for a total fee of %s. Is this okay?")) % diff --git a/src/wallet/tx_builder.cpp b/src/wallet/tx_builder.cpp index ec2c884b8..8e42b5949 100644 --- a/src/wallet/tx_builder.cpp +++ b/src/wallet/tx_builder.cpp @@ -742,7 +742,7 @@ std::vector make_carrot_transaction_proposa subaddr_account, subaddr_indices, only_below ? only_below : MONEY_SUPPLY, - 0, + 1, // ignore_below top_block_index)) continue; diff --git a/src/wallet/wallet2.cpp b/src/wallet/wallet2.cpp index a7ca42f92..1fac786dc 100644 --- a/src/wallet/wallet2.cpp +++ b/src/wallet/wallet2.cpp @@ -11610,9 +11610,8 @@ std::vector wallet2::create_transactions_all(uint64_t below const auto tx_proposals = tools::wallet::make_carrot_transaction_proposals_wallet2_sweep_all(*this, below, address, is_subaddress, outputs, priority, extra, tx_type, subaddr_account, subaddr_indices); std::vector ptx_vector; ptx_vector.reserve(tx_proposals.size()); - // TODO: use CLSAGS here.. - // for (const auto &tx_proposal : tx_proposals) - // ptx_vector.push_back(tools::wallet::finalize_all_proofs_from_transfer_details_as_pending_tx(tx_proposal, *this)); + for (const auto &tx_proposal : tx_proposals) + ptx_vector.push_back(tools::wallet::finalize_all_proofs_from_transfer_details_as_pending_tx(tx_proposal, *this)); return ptx_vector; }