From b2c9179100328ee700695c9eb7bbf2593c88821c Mon Sep 17 00:00:00 2001 From: Nik Bougalis Date: Sat, 27 Sep 2014 13:04:50 -0700 Subject: [PATCH 01/12] Increase minimum local fee --- src/ripple/app/ledger/impl/LedgerConsensusImp.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/ripple/app/ledger/impl/LedgerConsensusImp.cpp b/src/ripple/app/ledger/impl/LedgerConsensusImp.cpp index 3fddac2a55..5a12a68b13 100644 --- a/src/ripple/app/ledger/impl/LedgerConsensusImp.cpp +++ b/src/ripple/app/ledger/impl/LedgerConsensusImp.cpp @@ -1858,8 +1858,15 @@ void LedgerConsensusImp::addLoad(STValidation::ref val) std::uint32_t fee = std::max( app_.getFeeTrack().getLocalFee(), app_.getFeeTrack().getClusterFee()); - std::uint32_t ref = app_.getFeeTrack().getLoadBase(); - if (fee > ref) + + std::uint32_t loadBase = app_.getFeeTrack().getLoadBase(); + + // Hard code the minimum fee for now: + std::uint32_t const minFee = 10000; + std::uint32_t const refFee = 10; + fee = std::max(fee, (minFee * loadBase + refFee - 1) / refFee); + + if (fee > loadBase) val->setFieldU32(sfLoadFee, fee); } From bdfb5fa2bcfaa22562c588902798e2b2ad41b781 Mon Sep 17 00:00:00 2001 From: Nik Bougalis Date: Thu, 14 Jan 2016 10:59:12 -0800 Subject: [PATCH 02/12] Set version to 0.30.1-rc2 --- src/ripple/protocol/impl/BuildInfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ripple/protocol/impl/BuildInfo.cpp b/src/ripple/protocol/impl/BuildInfo.cpp index ad659832b4..3f074ff61a 100644 --- a/src/ripple/protocol/impl/BuildInfo.cpp +++ b/src/ripple/protocol/impl/BuildInfo.cpp @@ -35,7 +35,7 @@ char const* getRawVersionString () // // The build version number (edit this for each release) // - "0.30.1-rc1" + "0.30.1-rc2" // // Must follow the format described here: // From db9885e1fcde5cc1a549e8ad5549e61a916d6736 Mon Sep 17 00:00:00 2001 From: Nik Bougalis Date: Tue, 19 Jan 2016 16:45:20 -0800 Subject: [PATCH 03/12] Delete unfunded offers in predictable order --- src/ripple/app/paths/RippleCalc.cpp | 4 ++-- src/ripple/app/paths/RippleCalc.h | 4 ++-- src/ripple/app/paths/Types.h | 2 -- 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/ripple/app/paths/RippleCalc.cpp b/src/ripple/app/paths/RippleCalc.cpp index a6dc2ce89e..a74527891d 100644 --- a/src/ripple/app/paths/RippleCalc.cpp +++ b/src/ripple/app/paths/RippleCalc.cpp @@ -32,7 +32,7 @@ namespace { static TER deleteOffers (ApplyView& view, - OfferSet const& offers, beast::Journal j) + std::set const& offers, beast::Journal j) { for (auto& e: offers) if (TER r = offerDelete (view, @@ -201,7 +201,7 @@ TER RippleCalc::rippleCalculate () getRate (saDstAmountReq_, saMaxAmountReq_) : 0; // Offers that became unfunded. - OfferSet unfundedOffersFromBestPaths; + std::set unfundedOffersFromBestPaths; int iPass = 0; diff --git a/src/ripple/app/paths/RippleCalc.h b/src/ripple/app/paths/RippleCalc.h index b1fc42211c..1fba4525c9 100644 --- a/src/ripple/app/paths/RippleCalc.h +++ b/src/ripple/app/paths/RippleCalc.h @@ -106,10 +106,10 @@ public: PaymentSandbox& view; // If the transaction fails to meet some constraint, still need to delete - // unfunded offers. + // unfunded offers in a deterministic order (hence the ordered container). // // Offers that were found unfunded. - path::OfferSet permanentlyUnfundedOffers_; + std::set permanentlyUnfundedOffers_; // First time working in reverse a funding source was mentioned. Source may // only be used there. diff --git a/src/ripple/app/paths/Types.h b/src/ripple/app/paths/Types.h index f03aa8c9d4..f0ad869d86 100644 --- a/src/ripple/app/paths/Types.h +++ b/src/ripple/app/paths/Types.h @@ -30,8 +30,6 @@ namespace path { using NodeIndex = unsigned int; -using OfferSet = hash_set ; - } using AccountIssueToNodeIndex = hash_map ; From 5f4fe9fccb5e51afa254ced74457e9ddc51f652f Mon Sep 17 00:00:00 2001 From: Nik Bougalis Date: Wed, 20 Jan 2016 15:45:55 -0800 Subject: [PATCH 04/12] Set version to 0.30.1-rc3 --- src/ripple/protocol/impl/BuildInfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ripple/protocol/impl/BuildInfo.cpp b/src/ripple/protocol/impl/BuildInfo.cpp index 3f074ff61a..5c6cc997d5 100644 --- a/src/ripple/protocol/impl/BuildInfo.cpp +++ b/src/ripple/protocol/impl/BuildInfo.cpp @@ -35,7 +35,7 @@ char const* getRawVersionString () // // The build version number (edit this for each release) // - "0.30.1-rc2" + "0.30.1-rc3" // // Must follow the format described here: // From c17f7e8b372b1d675aaf7cff37ed77cd018a8b48 Mon Sep 17 00:00:00 2001 From: seelabs Date: Tue, 26 Jan 2016 16:22:58 -0500 Subject: [PATCH 05/12] Enforce no-ripple constraints --- src/ripple/app/paths/PathState.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/ripple/app/paths/PathState.cpp b/src/ripple/app/paths/PathState.cpp index b9142ea8a5..b9fb425e1c 100644 --- a/src/ripple/app/paths/PathState.cpp +++ b/src/ripple/app/paths/PathState.cpp @@ -799,6 +799,19 @@ TER PathState::checkNoRipple ( if (terStatus != tesSUCCESS) return terStatus; } + + if (!nodes_[i - 1].isAccount() && + nodes_[i].isAccount() && + nodes_[i + 1].isAccount() && + nodes_[i -1].issue_.account != nodes_[i].account_) + { // offer -> account -> account + auto const& currencyID = nodes_[i].issue_.currency; + terStatus = checkNoRipple ( + nodes_[i-1].issue_.account, nodes_[i].account_, nodes_[i+1].account_, + currencyID); + if (terStatus != tesSUCCESS) + return terStatus; + } } return tesSUCCESS; From 5b5a01989ca25ee4c9daaf559be15c8ca6ac5780 Mon Sep 17 00:00:00 2001 From: Nik Bougalis Date: Wed, 27 Jan 2016 12:26:58 -0800 Subject: [PATCH 06/12] Improve compile-time OpenSSL version check --- SConstruct | 37 +++++++++++++++++++++++++------------ 1 file changed, 25 insertions(+), 12 deletions(-) diff --git a/SConstruct b/SConstruct index 31a8856234..9f3317f026 100644 --- a/SConstruct +++ b/SConstruct @@ -114,7 +114,13 @@ AddOption('--ninja', dest='ninja', action='store_true', help='generate ninja build file build.ninja') def parse_time(t): - return time.strptime(t, '%a %b %d %H:%M:%S %Z %Y') + l = len(t.split()) + if l==5: + return time.strptime(t, '%a %b %d %H:%M:%S %Y') + elif l==3: + return time.strptime(t, '%d %b %Y') + else: + return time.strptime(t, '%a %b %d %H:%M:%S %Z %Y') CHECK_PLATFORMS = 'Debian', 'Ubuntu' CHECK_COMMAND = 'openssl version -a' @@ -126,17 +132,24 @@ UNITY_BUILD_DIRECTORY = 'src/ripple/unity/' USE_CPP_14 = os.getenv('RIPPLED_USE_CPP_14') def check_openssl(): - if Beast.system.platform in CHECK_PLATFORMS: - for line in subprocess.check_output(CHECK_COMMAND.split()).splitlines(): - if line.startswith(CHECK_LINE): - line = line[len(CHECK_LINE):] - if parse_time(line) < parse_time(BUILD_TIME): - raise Exception(OPENSSL_ERROR % (line, BUILD_TIME)) - else: - break - else: - raise Exception("Didn't find any '%s' line in '$ %s'" % - (CHECK_LINE, CHECK_COMMAND)) + if Beast.system.platform not in ['Debian', 'Ubuntu']: + return + line = subprocess.check_output('openssl version -b'.split()).strip() + check_line = 'built on: ' + if not line.startswith(check_line): + raise Exception("Didn't find any '%s' line in '$ %s'" % + (check_line, 'openssl version -b')) + d = line[len(check_line):] + if 'date unspecified' in d: + words = subprocess.check_output('openssl version'.split()).split() + if len(words)!=5: + raise Exception("Didn't find version date in '$ openssl version'") + d = ' '.join(words[-3:]) + build_time = 'Mon Apr 7 20:33:19 UTC 2014' + if parse_time(d) < parse_time(build_time): + raise Exception('Your openSSL was built on %s; ' + 'rippled needs a version built on or after %s.' + % (line, build_time)) def set_implicit_cache(): From ad2383bd4bd2f1c24ffd4f5125abd11a3cfc9328 Mon Sep 17 00:00:00 2001 From: Nik Bougalis Date: Tue, 26 Jan 2016 13:53:11 -0800 Subject: [PATCH 07/12] Set version to 0.30.0-hf2 --- src/ripple/protocol/impl/BuildInfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ripple/protocol/impl/BuildInfo.cpp b/src/ripple/protocol/impl/BuildInfo.cpp index 37aabeccd8..87efa31e90 100644 --- a/src/ripple/protocol/impl/BuildInfo.cpp +++ b/src/ripple/protocol/impl/BuildInfo.cpp @@ -35,7 +35,7 @@ char const* getRawVersionString () // // The build version number (edit this for each release) // - "0.30.0-hf1" + "0.30.0-hf2" // // Must follow the format described here: // From bd44880d5a550409bcf3f5700ac788c47f4c8405 Mon Sep 17 00:00:00 2001 From: seelabs Date: Tue, 26 Jan 2016 16:22:58 -0500 Subject: [PATCH 08/12] Enforce no-ripple constraints --- src/ripple/app/paths/PathState.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/ripple/app/paths/PathState.cpp b/src/ripple/app/paths/PathState.cpp index b9142ea8a5..b9fb425e1c 100644 --- a/src/ripple/app/paths/PathState.cpp +++ b/src/ripple/app/paths/PathState.cpp @@ -799,6 +799,19 @@ TER PathState::checkNoRipple ( if (terStatus != tesSUCCESS) return terStatus; } + + if (!nodes_[i - 1].isAccount() && + nodes_[i].isAccount() && + nodes_[i + 1].isAccount() && + nodes_[i -1].issue_.account != nodes_[i].account_) + { // offer -> account -> account + auto const& currencyID = nodes_[i].issue_.currency; + terStatus = checkNoRipple ( + nodes_[i-1].issue_.account, nodes_[i].account_, nodes_[i+1].account_, + currencyID); + if (terStatus != tesSUCCESS) + return terStatus; + } } return tesSUCCESS; From 5062e65277bd36222e798f0c832d130794a7da22 Mon Sep 17 00:00:00 2001 From: Nik Bougalis Date: Wed, 27 Jan 2016 13:33:07 -0800 Subject: [PATCH 09/12] Set version to 0.30.1-rc4 --- src/ripple/protocol/impl/BuildInfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ripple/protocol/impl/BuildInfo.cpp b/src/ripple/protocol/impl/BuildInfo.cpp index 5c6cc997d5..f926b7768a 100644 --- a/src/ripple/protocol/impl/BuildInfo.cpp +++ b/src/ripple/protocol/impl/BuildInfo.cpp @@ -35,7 +35,7 @@ char const* getRawVersionString () // // The build version number (edit this for each release) // - "0.30.1-rc3" + "0.30.1-rc4" // // Must follow the format described here: // From 5a4e900a217481597b8e6252042fb361db0a5094 Mon Sep 17 00:00:00 2001 From: Nik Bougalis Date: Wed, 3 Feb 2016 14:49:07 -0800 Subject: [PATCH 10/12] Set version to 0.30.1 --- src/ripple/protocol/impl/BuildInfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ripple/protocol/impl/BuildInfo.cpp b/src/ripple/protocol/impl/BuildInfo.cpp index f926b7768a..e5097389f6 100644 --- a/src/ripple/protocol/impl/BuildInfo.cpp +++ b/src/ripple/protocol/impl/BuildInfo.cpp @@ -35,7 +35,7 @@ char const* getRawVersionString () // // The build version number (edit this for each release) // - "0.30.1-rc4" + "0.30.1" // // Must follow the format described here: // From 31ecb4dcf34434369e6e5b56aea1fde38cc07bc7 Mon Sep 17 00:00:00 2001 From: Nik Bougalis Date: Mon, 8 Feb 2016 15:35:22 -0800 Subject: [PATCH 11/12] Revert "Set version to 0.30.1" This reverts commit 5a4e900a217481597b8e6252042fb361db0a5094. --- src/ripple/protocol/impl/BuildInfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ripple/protocol/impl/BuildInfo.cpp b/src/ripple/protocol/impl/BuildInfo.cpp index e5097389f6..f926b7768a 100644 --- a/src/ripple/protocol/impl/BuildInfo.cpp +++ b/src/ripple/protocol/impl/BuildInfo.cpp @@ -35,7 +35,7 @@ char const* getRawVersionString () // // The build version number (edit this for each release) // - "0.30.1" + "0.30.1-rc4" // // Must follow the format described here: // From c717006c44126aa0edb3a36ca29ee30e7a72c1d3 Mon Sep 17 00:00:00 2001 From: Nik Bougalis Date: Wed, 3 Feb 2016 14:49:07 -0800 Subject: [PATCH 12/12] Set version to 0.30.1 --- src/ripple/protocol/impl/BuildInfo.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ripple/protocol/impl/BuildInfo.cpp b/src/ripple/protocol/impl/BuildInfo.cpp index f926b7768a..e5097389f6 100644 --- a/src/ripple/protocol/impl/BuildInfo.cpp +++ b/src/ripple/protocol/impl/BuildInfo.cpp @@ -35,7 +35,7 @@ char const* getRawVersionString () // // The build version number (edit this for each release) // - "0.30.1-rc4" + "0.30.1" // // Must follow the format described here: //