From 40d29ae9e9b2071057cbf89a87270aa3bc6804ea Mon Sep 17 00:00:00 2001 From: cryptokatz Date: Mon, 31 Dec 2018 09:08:24 +0530 Subject: [PATCH 1/3] fee revision --- src/CryptoNoteConfig.h | 2 ++ src/CryptoNoteCore/Currency.cpp | 4 +++- src/CryptoNoteCore/Currency.h | 14 +++++++++++--- src/PaymentGate/PaymentServiceJsonRpcMessages.h | 4 ++-- src/PaymentGate/WalletService.cpp | 4 ++-- src/PoolWallet/PoolWallet.cpp | 9 +++++++-- src/SimpleWallet/SimpleWallet.cpp | 12 ++++++------ src/Wallet/PoolRpcServer.cpp | 8 ++++---- src/Wallet/WalletRpcServer.cpp | 8 ++++---- src/WalletLegacy/WalletLegacy.cpp | 12 ++++++------ tests/CoreTests/Deposit.h | 2 +- 11 files changed, 48 insertions(+), 31 deletions(-) diff --git a/src/CryptoNoteConfig.h b/src/CryptoNoteConfig.h index cb77c8ee..a5df972b 100644 --- a/src/CryptoNoteConfig.h +++ b/src/CryptoNoteConfig.h @@ -39,6 +39,8 @@ const size_t CRYPTONOTE_DISPLAY_DECIMAL_POINT = 6; const uint64_t POINT = UINT64_C(1000); // pow(10, 3) const uint64_t COIN = UINT64_C(1000000); // pow(10, 6) const uint64_t MINIMUM_FEE = UINT64_C(10); // pow(10, 1) +const uint64_t MINIMUM_FEE_V1 = UINT64_C(100); // fee increase +const uint64_t MINIMUM_FEE_BANKING = UINT64_C(100); // fee increase const uint64_t DEFAULT_DUST_THRESHOLD = UINT64_C(10); // pow(10, 1) const uint64_t DIFFICULTY_TARGET = 120; // seconds = 2m diff --git a/src/CryptoNoteCore/Currency.cpp b/src/CryptoNoteCore/Currency.cpp index b9df6110..9276d598 100644 --- a/src/CryptoNoteCore/Currency.cpp +++ b/src/CryptoNoteCore/Currency.cpp @@ -1004,7 +1004,9 @@ CurrencyBuilder::CurrencyBuilder(Logging::ILogger& log) : m_currency(log) { numberOfDecimalPlaces(parameters::CRYPTONOTE_DISPLAY_DECIMAL_POINT); - mininumFee(parameters::MINIMUM_FEE); + minimumFee(parameters::MINIMUM_FEE); + minimumFeeV1(parameters::MINIMUM_FEE_V1); + minimumFeeBanking(parameters::MINIMUM_FEE_BANKING); defaultDustThreshold(parameters::DEFAULT_DUST_THRESHOLD); difficultyTarget(parameters::DIFFICULTY_TARGET); diff --git a/src/CryptoNoteCore/Currency.h b/src/CryptoNoteCore/Currency.h index 4bc7090b..33078ed0 100644 --- a/src/CryptoNoteCore/Currency.h +++ b/src/CryptoNoteCore/Currency.h @@ -64,7 +64,10 @@ class Currency { size_t numberOfDecimalPlaces() const { return m_numberOfDecimalPlaces; } uint64_t coin() const { return m_coin; } - uint64_t minimumFee() const { return m_mininumFee; } + uint64_t minimumFee() const { return m_minimumFee; } + uint64_t minimumFeeV1() const { return m_minimumFeeV1; } + uint64_t minimumFeeBanking() const { return m_minimumFeeBanking; } + uint64_t defaultDustThreshold() const { return m_defaultDustThreshold; } uint64_t difficultyTarget() const { return m_difficultyTarget; } @@ -201,7 +204,9 @@ class Currency { size_t m_numberOfDecimalPlaces; uint64_t m_coin; - uint64_t m_mininumFee; + uint64_t m_minimumFee; + uint64_t m_minimumFeeV1; + uint64_t m_minimumFeeBanking; uint64_t m_defaultDustThreshold; uint64_t m_difficultyTarget; @@ -299,7 +304,10 @@ class CurrencyBuilder : boost::noncopyable { CurrencyBuilder& numberOfDecimalPlaces(size_t val); - CurrencyBuilder& mininumFee(uint64_t val) { m_currency.m_mininumFee = val; return *this; } + CurrencyBuilder& minimumFee(uint64_t val) { m_currency.m_minimumFee = val; return *this; } + CurrencyBuilder& minimumFeeV1(uint64_t val) { m_currency.m_minimumFeeV1 = val; return *this; } + CurrencyBuilder& minimumFeeBanking(uint64_t val) { m_currency.m_minimumFeeBanking = val; return *this; } + CurrencyBuilder& defaultDustThreshold(uint64_t val) { m_currency.m_defaultDustThreshold = val; return *this; } CurrencyBuilder& difficultyTarget(uint64_t val) { m_currency.m_difficultyTarget = val; return *this; } diff --git a/src/PaymentGate/PaymentServiceJsonRpcMessages.h b/src/PaymentGate/PaymentServiceJsonRpcMessages.h index 399a0f84..6651395f 100644 --- a/src/PaymentGate/PaymentServiceJsonRpcMessages.h +++ b/src/PaymentGate/PaymentServiceJsonRpcMessages.h @@ -280,7 +280,7 @@ struct SendTransaction { std::vector sourceAddresses; std::vector transfers; std::string changeAddress; - uint64_t fee = 10; + uint64_t fee = 100; uint32_t anonymity = DEFAULT_ANONYMITY_LEVEL; std::string extra; std::string paymentId; @@ -302,7 +302,7 @@ struct CreateDelayedTransaction { std::vector addresses; std::vector transfers; std::string changeAddress; - uint64_t fee = 10; + uint64_t fee = 100; uint32_t anonymity = DEFAULT_ANONYMITY_LEVEL; std::string extra; std::string paymentId; diff --git a/src/PaymentGate/WalletService.cpp b/src/PaymentGate/WalletService.cpp index 90968fbe..ca7c4e65 100644 --- a/src/PaymentGate/WalletService.cpp +++ b/src/PaymentGate/WalletService.cpp @@ -873,8 +873,8 @@ std::error_code WalletService::sendTransaction(const SendTransaction::Request& r sendParams.extra = Common::asString(Common::fromHex(request.extra)); } - if (sendParams.fee < 10) { - sendParams.fee = 10; + if (sendParams.fee < 100) { + sendParams.fee = 100; } sendParams.sourceAddresses = request.sourceAddresses; diff --git a/src/PoolWallet/PoolWallet.cpp b/src/PoolWallet/PoolWallet.cpp index 65731fd1..b9b16da3 100644 --- a/src/PoolWallet/PoolWallet.cpp +++ b/src/PoolWallet/PoolWallet.cpp @@ -1489,8 +1489,8 @@ bool pool_wallet::optimize_outputs(const std::vector& args) { std::vector transfers; std::vector messages; std::string extraString; - uint64_t fee = CryptoNote::parameters::MINIMUM_FEE; - uint64_t mixIn = 2; + uint64_t fee = CryptoNote::parameters::MINIMUM_FEE_V1; + uint64_t mixIn = 0; uint64_t unlockTimestamp = 0; uint64_t ttl = 0; Crypto::SecretKey transactionSK; @@ -1619,6 +1619,11 @@ bool pool_wallet::transfer(const std::vector &args) { return true; } + /* force minimum fee */ + if (cmd.fee < CryptoNote::parameters::MINIMUM_FEE_V1) { + cmd.fee = CryptoNote::parameters::MINIMUM_FEE_V1; + } + Crypto::SecretKey transactionSK; CryptoNote::TransactionId tx = m_wallet->sendTransaction(transactionSK, cmd.dsts, cmd.fee, extraString, cmd.fake_outs_count, 0, messages, ttl); if (tx == WALLET_LEGACY_INVALID_TRANSACTION_ID) { diff --git a/src/SimpleWallet/SimpleWallet.cpp b/src/SimpleWallet/SimpleWallet.cpp index 7e09304b..f49dcad5 100644 --- a/src/SimpleWallet/SimpleWallet.cpp +++ b/src/SimpleWallet/SimpleWallet.cpp @@ -208,10 +208,10 @@ bool parseArguments(LoggerRef& logger, const std::vector &args) return false; } - if (fee < m_currency.minimumFee()) + if (fee < CryptoNote::parameters::MINIMUM_FEE_V1) { - logger(ERROR, BRIGHT_RED) << "Fee value is less than minimum: " << m_currency.minimumFee(); + logger(ERROR, BRIGHT_RED) << "Fee value is less than minimum: " << CryptoNote::parameters::MINIMUM_FEE_V1; return false; } } else if (arg == "-m") @@ -1491,7 +1491,7 @@ bool simple_wallet::optimize_outputs(const std::vector& args) { std::vector transfers; std::vector messages; std::string extraString; - uint64_t fee = CryptoNote::parameters::MINIMUM_FEE; + uint64_t fee = CryptoNote::parameters::MINIMUM_FEE_V1; uint64_t mixIn = 0; uint64_t unlockTimestamp = 0; uint64_t ttl = 0; @@ -1559,7 +1559,7 @@ bool simple_wallet::optimize_all_outputs(const std::vector& args) { std::vector transfers; std::vector messages; std::string extraString; - uint64_t fee = CryptoNote::parameters::MINIMUM_FEE; + uint64_t fee = CryptoNote::parameters::MINIMUM_FEE_V1; uint64_t mixIn = 0; uint64_t unlockTimestamp = 0; uint64_t ttl = 0; @@ -1691,8 +1691,8 @@ bool simple_wallet::transfer(const std::vector &args) { cmd.fake_outs_count = 4; /* force minimum fee */ - if (cmd.fee < 10) { - cmd.fee = 10; + if (cmd.fee < CryptoNote::parameters::MINIMUM_FEE_V1) { + cmd.fee = CryptoNote::parameters::MINIMUM_FEE_V1; } Crypto::SecretKey transactionSK; diff --git a/src/Wallet/PoolRpcServer.cpp b/src/Wallet/PoolRpcServer.cpp index b431c5f6..e06b7e4e 100644 --- a/src/Wallet/PoolRpcServer.cpp +++ b/src/Wallet/PoolRpcServer.cpp @@ -181,8 +181,8 @@ bool pool_rpc_server::on_transfer(const wallet_rpc::COMMAND_RPC_TRANSFER::reques ttl = static_cast(time(nullptr)) + req.ttl; } - uint64_t actualFee = 10; - if (req.fee >= 10) { + uint64_t actualFee = 100; + if (req.fee >= 100) { actualFee = req.fee; } @@ -220,8 +220,8 @@ bool pool_rpc_server::on_optimize(const wallet_rpc::COMMAND_RPC_OPTIMIZE::reques std::vector transfers; std::vector messages; std::string extraString; - uint64_t fee = CryptoNote::parameters::MINIMUM_FEE; - uint64_t mixIn = 2; + uint64_t fee = CryptoNote::parameters::MINIMUM_FEE_V1; + uint64_t mixIn = 0; uint64_t unlockTimestamp = 0; uint64_t ttl = 0; diff --git a/src/Wallet/WalletRpcServer.cpp b/src/Wallet/WalletRpcServer.cpp index 95861ca7..3ef136a5 100644 --- a/src/Wallet/WalletRpcServer.cpp +++ b/src/Wallet/WalletRpcServer.cpp @@ -191,8 +191,8 @@ bool wallet_rpc_server::on_transfer(const wallet_rpc::COMMAND_RPC_TRANSFER::requ ttl = static_cast(time(nullptr)) + req.ttl; } - uint64_t actualFee = 10; - if (req.fee >= 10) { + uint64_t actualFee = 100; + if (req.fee >= 100) { actualFee = req.fee; } @@ -230,8 +230,8 @@ bool wallet_rpc_server::on_optimize(const wallet_rpc::COMMAND_RPC_OPTIMIZE::requ std::vector transfers; std::vector messages; std::string extraString; - uint64_t fee = CryptoNote::parameters::MINIMUM_FEE; - uint64_t mixIn = 2; + uint64_t fee = CryptoNote::parameters::MINIMUM_FEE_V1; + uint64_t mixIn = 0; uint64_t unlockTimestamp = 0; uint64_t ttl = 0; diff --git a/src/WalletLegacy/WalletLegacy.cpp b/src/WalletLegacy/WalletLegacy.cpp index c49962dd..67404b41 100644 --- a/src/WalletLegacy/WalletLegacy.cpp +++ b/src/WalletLegacy/WalletLegacy.cpp @@ -543,8 +543,8 @@ TransactionId WalletLegacy::sendTransaction(Crypto::SecretKey& transactionSK, std::deque> events; throwIfNotInitialised(); - if (fee < 10) { - fee = 10; + if (fee < 100) { + fee = 100; } { @@ -569,8 +569,8 @@ TransactionId WalletLegacy::deposit(uint32_t term, uint64_t amount, uint64_t fee std::unique_ptr request; std::deque> events; - if (fee < 10) { - fee = 10; + if (fee < 100) { + fee = 100; } { @@ -599,8 +599,8 @@ TransactionId WalletLegacy::withdrawDeposits(const std::vector& depos std::unique_ptr request; std::deque> events; - if (fee < 10) { - fee = 10; + if (fee < 100) { + fee = 100; } { diff --git a/tests/CoreTests/Deposit.h b/tests/CoreTests/Deposit.h index 5a1d6893..caa0aa2d 100644 --- a/tests/CoreTests/Deposit.h +++ b/tests/CoreTests/Deposit.h @@ -64,7 +64,7 @@ struct DepositIndexTest : public DepositTestsBase { using Core = CryptoNote::core; using Events = std::vector; DepositIndexTest() { - m_currency = CryptoNote::CurrencyBuilder(m_logger).upgradeHeightV2(0).depositMinTerm(10).depositMinTotalRateFactor(100).mininumFee(1000).currency(); + m_currency = CryptoNote::CurrencyBuilder(m_logger).upgradeHeightV2(0).depositMinTerm(10).depositMinTotalRateFactor(100).minimumFee(1000).currency(); REGISTER_CALLBACK_METHOD(DepositIndexTest, interestZero); REGISTER_CALLBACK_METHOD(DepositIndexTest, interestOneMinimal); REGISTER_CALLBACK_METHOD(DepositIndexTest, interestTwoMininmal); From 0c02b46b03dc779f59ae87c4b2a817dc9103041d Mon Sep 17 00:00:00 2001 From: cryptokatz Date: Mon, 31 Dec 2018 11:02:37 +0530 Subject: [PATCH 2/3] increase banking fees --- src/CryptoNoteConfig.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CryptoNoteConfig.h b/src/CryptoNoteConfig.h index a5df972b..cadfe80b 100644 --- a/src/CryptoNoteConfig.h +++ b/src/CryptoNoteConfig.h @@ -40,7 +40,7 @@ const uint64_t POINT = UINT64_C(1000); // pow(10, 3) const uint64_t COIN = UINT64_C(1000000); // pow(10, 6) const uint64_t MINIMUM_FEE = UINT64_C(10); // pow(10, 1) const uint64_t MINIMUM_FEE_V1 = UINT64_C(100); // fee increase -const uint64_t MINIMUM_FEE_BANKING = UINT64_C(100); // fee increase +const uint64_t MINIMUM_FEE_BANKING = UINT64_C(1000); // fee increase const uint64_t DEFAULT_DUST_THRESHOLD = UINT64_C(10); // pow(10, 1) const uint64_t DIFFICULTY_TARGET = 120; // seconds = 2m From d8fba1ac666ab54fa603d9827bdce54d72ccc20c Mon Sep 17 00:00:00 2001 From: cryptokatz Date: Mon, 31 Dec 2018 11:05:23 +0530 Subject: [PATCH 3/3] version 5.1.7 --- README.md | 2 +- src/version.h.in | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index c55b0fec..f79bab2a 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,7 @@ ![image](https://github.com/ConcealNetwork/conceal-assets/blob/master/splash.png) # Conceal Core (CLI) -Latest Release: v5.1.6 +Latest Release: v5.1.7 Maintained by The Circle Team. ## Information diff --git a/src/version.h.in b/src/version.h.in index 98767931..e2e375f7 100644 --- a/src/version.h.in +++ b/src/version.h.in @@ -1,4 +1,4 @@ #define BUILD_COMMIT_ID "@VERSION@" -#define PROJECT_VERSION "5.1.6" -#define PROJECT_VERSION_BUILD_NO "Steganos 14" +#define PROJECT_VERSION "5.1.7" +#define PROJECT_VERSION_BUILD_NO "Steganos 15" #define PROJECT_VERSION_LONG PROJECT_VERSION "." PROJECT_VERSION_BUILD_NO "(" BUILD_COMMIT_ID ")"