From a8859b495b552fe1eb140771f0f2cb32d11d2ac2 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Wed, 21 Oct 2015 18:26:02 -0700 Subject: [PATCH 1/6] Set version to 0.30.0 --- Builds/rpm/rippled.spec | 2 +- src/ripple/protocol/impl/BuildInfo.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Builds/rpm/rippled.spec b/Builds/rpm/rippled.spec index cd81db027..156624632 100644 --- a/Builds/rpm/rippled.spec +++ b/Builds/rpm/rippled.spec @@ -4,7 +4,7 @@ Name: rippled Version: 0.30.0 # Release should include either the build or hotfix number (ex: hf1%{?dist} or b2%{?dist}) # If there is no b# or hf#, then use 1%{?dist} -Release: rc1%{?dist} +Release: %{?dist} Summary: Ripple peer-to-peer network daemon Group: Applications/Internet diff --git a/src/ripple/protocol/impl/BuildInfo.cpp b/src/ripple/protocol/impl/BuildInfo.cpp index f95e7e02b..0d0b5f200 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-rc1" + "0.30.0" // // Must follow the format described here: // From d20f0d5014da513321eb8699cf06f918c7acc8bd Mon Sep 17 00:00:00 2001 From: David Schwartz Date: Tue, 6 Oct 2015 12:24:24 -0700 Subject: [PATCH 2/6] Make sure LedgerHistory::builtLedger gets called --- src/ripple/app/ledger/impl/LedgerMaster.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/ripple/app/ledger/impl/LedgerMaster.cpp b/src/ripple/app/ledger/impl/LedgerMaster.cpp index d6506a518..42594809f 100644 --- a/src/ripple/app/ledger/impl/LedgerMaster.cpp +++ b/src/ripple/app/ledger/impl/LedgerMaster.cpp @@ -972,6 +972,8 @@ public: << "Consensus triggered check of ledger"; checkAccept (maxLedger, maxSeq); } + + mLedgerHistory.builtLedger (ledger); } void advanceThread() From 3d5ff2b4cd05f1c35ff70f24f4851aff361c0228 Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Tue, 3 Nov 2015 13:45:27 -0800 Subject: [PATCH 3/6] Prevent some missed proposals, faster consensus catch up --- src/ripple/app/ledger/impl/LedgerConsensusImp.cpp | 9 +++++++-- src/ripple/app/misc/NetworkOPs.cpp | 5 +++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/src/ripple/app/ledger/impl/LedgerConsensusImp.cpp b/src/ripple/app/ledger/impl/LedgerConsensusImp.cpp index 40c1dd3b0..5129d893b 100644 --- a/src/ripple/app/ledger/impl/LedgerConsensusImp.cpp +++ b/src/ripple/app/ledger/impl/LedgerConsensusImp.cpp @@ -298,6 +298,13 @@ LedgerConsensusImp::LedgerConsensusImp ( // update the network status table as to whether we're // proposing/validating consensus_.setProposing (mProposing, mValidating); + + playbackProposals (); + if (mPeerPositions.size () > (mPreviousProposers / 2)) + { + // We may be falling behind, don't wait for the timer + timerEntry (); + } } Json::Value LedgerConsensusImp::getJson (bool full) @@ -976,8 +983,6 @@ void LedgerConsensusImp::accept (std::shared_ptr set) consensus_.takePosition (mPreviousLedger->info().seq, set); assert (set->getHash () == mOurPosition->getCurrentHash ()); - // these are now obsolete - consensus_.peekStoredProposals ().clear (); } auto closeTime = mOurPosition->getCloseTime(); diff --git a/src/ripple/app/misc/NetworkOPs.cpp b/src/ripple/app/misc/NetworkOPs.cpp index 93e132c9f..dc18ee32c 100644 --- a/src/ripple/app/misc/NetworkOPs.cpp +++ b/src/ripple/app/misc/NetworkOPs.cpp @@ -1384,6 +1384,9 @@ void NetworkOPsImp::processTrustedProposal ( bool relay = true; + if (mConsensus) + mConsensus->storeProposal (proposal, nodePublic); + if (!haveConsensusObject ()) { m_journal.info << "Received proposal outside consensus window"; @@ -1393,8 +1396,6 @@ void NetworkOPsImp::processTrustedProposal ( } else { - mConsensus->storeProposal (proposal, nodePublic); - if (mLedgerConsensus->getLCL () == proposal->getPrevLedger ()) { relay = mLedgerConsensus->peerPosition (proposal); From 3d2aae9ea515807ff1fefc798469565c4e3f90f7 Mon Sep 17 00:00:00 2001 From: JoelKatz Date: Tue, 3 Nov 2015 13:55:54 -0800 Subject: [PATCH 4/6] Make close time consensus detection use montonic close time rules --- .../app/ledger/impl/LedgerConsensusImp.cpp | 21 ++++++++++++------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/src/ripple/app/ledger/impl/LedgerConsensusImp.cpp b/src/ripple/app/ledger/impl/LedgerConsensusImp.cpp index 5129d893b..185a87983 100644 --- a/src/ripple/app/ledger/impl/LedgerConsensusImp.cpp +++ b/src/ripple/app/ledger/impl/LedgerConsensusImp.cpp @@ -1551,8 +1551,10 @@ void LedgerConsensusImp::updateOurPositions () else { // proposal is still fresh - ++closeTimes[roundCloseTime ( - it->second->getCloseTime (), mCloseResolution)]; + ++closeTimes[std::max ( + roundCloseTime (it->second->getCloseTime (), + mCloseResolution), + mPreviousLedger->info().closeTime + 1)]; ++it; } } @@ -1604,16 +1606,20 @@ void LedgerConsensusImp::updateOurPositions () { // no other times mHaveCloseTimeConsensus = true; - closeTime = roundCloseTime ( - mOurPosition->getCloseTime (), mCloseResolution); + closeTime = std::max( + roundCloseTime (mOurPosition->getCloseTime (), + mCloseResolution), + mPreviousLedger->info().closeTime + 1); } else { int participants = mPeerPositions.size (); if (mProposing) { - ++closeTimes[roundCloseTime ( - mOurPosition->getCloseTime (), mCloseResolution)]; + ++closeTimes[std::max ( + roundCloseTime (mOurPosition->getCloseTime (), + mCloseResolution), + mPreviousLedger->info().closeTime + 1)]; ++participants; } @@ -1663,8 +1669,7 @@ void LedgerConsensusImp::updateOurPositions () } if (!changes && - ((closeTime != roundCloseTime ( - mOurPosition->getCloseTime (), mCloseResolution)) + ((closeTime != mOurPosition->getCloseTime ()) || mOurPosition->isStale (ourCutoff))) { // close time changed or our position is stale From 0a0adaac6d2bf357accd8efc2a7695b5bfe5b000 Mon Sep 17 00:00:00 2001 From: Vinnie Falco Date: Fri, 2 Oct 2015 19:32:29 -0700 Subject: [PATCH 5/6] Set admin privileges on websocket: When the websocket connection is established, any configured administrative privileges are applied to resource limits. --- src/ripple/resource/impl/Logic.h | 14 -------------- src/ripple/server/Role.h | 6 ++++++ src/ripple/server/impl/Role.cpp | 11 +++++++++++ src/ripple/websocket/Connection.h | 5 +++-- 4 files changed, 20 insertions(+), 16 deletions(-) diff --git a/src/ripple/resource/impl/Logic.h b/src/ripple/resource/impl/Logic.h index 956421938..8a493db21 100644 --- a/src/ripple/resource/impl/Logic.h +++ b/src/ripple/resource/impl/Logic.h @@ -112,9 +112,6 @@ public: Consumer newInboundEndpoint (beast::IP::Endpoint const& address) { - if (isWhitelisted (address)) - return newAdminEndpoint (to_string (address)); - Entry* entry (nullptr); { @@ -146,9 +143,6 @@ public: Consumer newOutboundEndpoint (beast::IP::Endpoint const& address) { - if (isWhitelisted (address)) - return newAdminEndpoint (to_string (address)); - Entry* entry (nullptr); { @@ -370,14 +364,6 @@ public: //-------------------------------------------------------------------------- - bool isWhitelisted (beast::IP::Endpoint const& address) - { - if (! is_public (address)) - return true; - - return false; - } - // Called periodically to expire entries and groom the table. // void periodicActivity () diff --git a/src/ripple/server/Role.h b/src/ripple/server/Role.h index e8a13fb98..6956d81e8 100644 --- a/src/ripple/server/Role.h +++ b/src/ripple/server/Role.h @@ -22,6 +22,7 @@ #include #include +#include #include #include @@ -47,6 +48,11 @@ Role requestRole (Role const& required, HTTP::Port const& port, Json::Value const& jsonRPC, beast::IP::Endpoint const& remoteIp); +Resource::Consumer +requestInboundEndpoint (Resource::Manager& manager, + beast::IP::Endpoint const& remoteAddress, + HTTP::Port const& port); + } // ripple #endif diff --git a/src/ripple/server/impl/Role.cpp b/src/ripple/server/impl/Role.cpp index 9b4139fea..0e6e642ed 100644 --- a/src/ripple/server/impl/Role.cpp +++ b/src/ripple/server/impl/Role.cpp @@ -66,4 +66,15 @@ requestRole (Role const& required, HTTP::Port const& port, return role; } +Resource::Consumer +requestInboundEndpoint (Resource::Manager& manager, + beast::IP::Endpoint const& remoteAddress, + HTTP::Port const& port) +{ + if (requestRole (Role::GUEST, port, Json::Value(), remoteAddress) == + Role::ADMIN) + return manager.newAdminEndpoint (to_string (remoteAddress)); + return manager.newInboundEndpoint(remoteAddress); +} + } diff --git a/src/ripple/websocket/Connection.h b/src/ripple/websocket/Connection.h index d46cc8f2d..a456a5703 100644 --- a/src/ripple/websocket/Connection.h +++ b/src/ripple/websocket/Connection.h @@ -34,6 +34,7 @@ #include #include #include +#include #include #include #include @@ -133,8 +134,8 @@ ConnectionImpl ::ConnectionImpl ( connection_ptr const& cpConnection, beast::IP::Endpoint const& remoteAddress, boost::asio::io_service& io_service) - : InfoSub (source, // usage - resourceManager.newInboundEndpoint (remoteAddress)) + : InfoSub (source, requestInboundEndpoint ( + resourceManager, remoteAddress, handler.port())) , app_(app) , m_port (handler.port ()) , m_resourceManager (resourceManager) From aa4f347e7cd1773f24b1254ac6118a3bdaefc801 Mon Sep 17 00:00:00 2001 From: Nik Bougalis Date: Thu, 5 Nov 2015 16:47:41 -0800 Subject: [PATCH 6/6] Set version to 0.30.0-hf1 --- 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 0d0b5f200..37aabeccd 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" + "0.30.0-hf1" // // Must follow the format described here: //