mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-19 18:45:52 +00:00
Compare commits
5 Commits
0.30.0
...
0.30.0-hf1
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
aa4f347e7c | ||
|
|
0a0adaac6d | ||
|
|
3d2aae9ea5 | ||
|
|
3d5ff2b4cd | ||
|
|
d20f0d5014 |
@@ -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<SHAMap> set)
|
||||
consensus_.takePosition (mPreviousLedger->info().seq, set);
|
||||
|
||||
assert (set->getHash () == mOurPosition->getCurrentHash ());
|
||||
// these are now obsolete
|
||||
consensus_.peekStoredProposals ().clear ();
|
||||
}
|
||||
|
||||
auto closeTime = mOurPosition->getCloseTime();
|
||||
@@ -1546,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;
|
||||
}
|
||||
}
|
||||
@@ -1599,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;
|
||||
}
|
||||
|
||||
@@ -1658,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
|
||||
|
||||
@@ -972,6 +972,8 @@ public:
|
||||
<< "Consensus triggered check of ledger";
|
||||
checkAccept (maxLedger, maxSeq);
|
||||
}
|
||||
|
||||
mLedgerHistory.builtLedger (ledger);
|
||||
}
|
||||
|
||||
void advanceThread()
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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:
|
||||
//
|
||||
|
||||
@@ -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 ()
|
||||
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
#include <ripple/server/Port.h>
|
||||
#include <ripple/json/json_value.h>
|
||||
#include <ripple/resource/ResourceManager.h>
|
||||
#include <beast/net/IPEndpoint.h>
|
||||
#include <vector>
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -34,6 +34,7 @@
|
||||
#include <ripple/rpc/Coroutine.h>
|
||||
#include <ripple/rpc/RPCHandler.h>
|
||||
#include <ripple/server/Port.h>
|
||||
#include <ripple/server/Role.h>
|
||||
#include <ripple/json/to_string.h>
|
||||
#include <ripple/rpc/RPCHandler.h>
|
||||
#include <ripple/rpc/Yield.h>
|
||||
@@ -133,8 +134,8 @@ ConnectionImpl <WebSocket>::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)
|
||||
|
||||
Reference in New Issue
Block a user