Skip to content

Commit

Permalink
Fix build errors from rebase
Browse files Browse the repository at this point in the history
  • Loading branch information
bboston7 committed Apr 27, 2024
1 parent 6859b70 commit 9ec0ec8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 39 deletions.
29 changes: 0 additions & 29 deletions src/overlay/OverlayManagerImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,35 +103,6 @@ class OverlayManagerImpl : public OverlayManager

PeersList mInboundPeers;
PeersList mOutboundPeers;

// This gets called once when starting
// and it continues to call itself every FLOOD_DEMAND_PERIOD_MS.
void demand();
VirtualTimer mDemandTimer;
struct DemandHistory
{
VirtualClock::time_point firstDemanded;
VirtualClock::time_point lastDemanded;
UnorderedMap<NodeID, VirtualClock::time_point> peers;
bool latencyRecorded{false};
};
UnorderedMap<Hash, DemandHistory> mDemandHistoryMap;

std::queue<Hash> mPendingDemands;
enum class DemandStatus
{
DEMAND, // Demand
RETRY_LATER, // The timer hasn't expired, and we need to come back to
// this.
DISCARD // We should never demand this txn from this peer.
};
DemandStatus demandStatus(Hash const& txHash, Peer::pointer) const;

// After `MAX_RETRY_COUNT` attempts with linear back-off, we assume that
// no one has the transaction.
int const MAX_RETRY_COUNT = 15;
std::chrono::milliseconds retryDelayDemand(int numAttemptsMade) const;
size_t getMaxDemandSize() const;
int availableOutboundPendingSlots() const;

public:
Expand Down
21 changes: 11 additions & 10 deletions src/overlay/Peer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -691,10 +691,10 @@ Peer::sendMessage(std::shared_ptr<StellarMessage const> msg, bool log)
mOverlayMetrics.mSendSurveyResponseMeter.Mark();
break;
case TIME_SLICED_SURVEY_START_COLLECTING:
getOverlayMetrics().mSendStartSurveyCollectingMeter.Mark();
mOverlayMetrics.mSendStartSurveyCollectingMeter.Mark();
break;
case TIME_SLICED_SURVEY_STOP_COLLECTING:
getOverlayMetrics().mSendStopSurveyCollectingMeter.Mark();
mOverlayMetrics.mSendStopSurveyCollectingMeter.Mark();
break;
case SEND_MORE:
case SEND_MORE_EXTENDED:
Expand Down Expand Up @@ -993,15 +993,14 @@ Peer::recvRawMessage(StellarMessage const& stellarMsg)

case TIME_SLICED_SURVEY_START_COLLECTING:
{
auto t =
getOverlayMetrics().mRecvStartSurveyCollectingTimer.TimeScope();
auto t = mOverlayMetrics.mRecvStartSurveyCollectingTimer.TimeScope();
recvSurveyStartCollectingMessage(stellarMsg);
}
break;

case TIME_SLICED_SURVEY_STOP_COLLECTING:
{
auto t = getOverlayMetrics().mRecvStopSurveyCollectingTimer.TimeScope();
auto t = mOverlayMetrics.mRecvStopSurveyCollectingTimer.TimeScope();
recvSurveyStopCollectingMessage(stellarMsg);
}
break;
Expand Down Expand Up @@ -1200,7 +1199,7 @@ Peer::maybeProcessPingResponse(Hash const& id)
CLOG_DEBUG(Overlay, "Latency {}: {} ms", toString(),
mLastPing.count());
mOverlayMetrics.mConnectionLatencyTimer.Update(mLastPing);
mApp.getOverlayManager().getSurveyManager().modifyPeerData(
mAppConnector.getOverlayManager().getSurveyManager().modifyPeerData(
*this, [&](CollectingPeerData& peerData) {
peerData.mLatencyTimer.Update(
std::chrono::duration_cast<std::chrono::nanoseconds>(
Expand Down Expand Up @@ -1708,16 +1707,18 @@ void
Peer::recvSurveyStartCollectingMessage(StellarMessage const& msg)
{
ZoneScoped;
mApp.getOverlayManager().getSurveyManager().relayStartSurveyCollecting(
msg, shared_from_this());
mAppConnector.getOverlayManager()
.getSurveyManager()
.relayStartSurveyCollecting(msg, shared_from_this());
}

void
Peer::recvSurveyStopCollectingMessage(StellarMessage const& msg)
{
ZoneScoped;
mApp.getOverlayManager().getSurveyManager().relayStopSurveyCollecting(
msg, shared_from_this());
mAppConnector.getOverlayManager()
.getSurveyManager()
.relayStopSurveyCollecting(msg, shared_from_this());
}

void
Expand Down

0 comments on commit 9ec0ec8

Please sign in to comment.