Skip to content

Commit cb7ce6c

Browse files
committed
Remove dead code now that in-memory mode is dropped
1 parent 064fe7b commit cb7ce6c

5 files changed

+0
-60
lines changed

src/catchup/ApplyBucketsWork.cpp

-14
Original file line numberDiff line numberDiff line change
@@ -207,20 +207,6 @@ ApplyBucketsWork::doWork()
207207
if (!mAssumeStateWork)
208208
{
209209
// Step 2: apply buckets.
210-
if (mApp.getLedgerManager().rebuildingInMemoryState() && !mDelayChecked)
211-
{
212-
mDelayChecked = true;
213-
auto delay = mApp.getConfig()
214-
.ARTIFICIALLY_DELAY_BUCKET_APPLICATION_FOR_TESTING;
215-
if (delay != std::chrono::seconds::zero())
216-
{
217-
CLOG_INFO(History, "Delay bucket application by {} seconds",
218-
delay.count());
219-
setupWaitingCallback(delay);
220-
return State::WORK_WAITING;
221-
}
222-
}
223-
224210
auto isCurr = mBucketToApplyIndex % 2 == 0;
225211
if (mBucketApplicator)
226212
{

src/catchup/ApplyBucketsWork.h

-1
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ class ApplyBucketsWork : public Work
4141
std::unordered_set<LedgerKey> mSeenKeys;
4242
std::vector<std::shared_ptr<LiveBucket>> mBucketsToApply;
4343
std::unique_ptr<BucketApplicator> mBucketApplicator;
44-
bool mDelayChecked{false};
4544

4645
BucketApplicator::Counters mCounters;
4746
bool const mIsApplyInvariantEnabled;

src/ledger/LedgerManager.h

-5
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,6 @@ class LedgerManager
156156
// and restart merges
157157
virtual void loadLastKnownLedger(bool restoreBucketlist) = 0;
158158

159-
// Return true if core is currently rebuilding in-memory state via local
160-
// catchup
161-
virtual bool rebuildingInMemoryState() = 0;
162-
virtual void setupInMemoryStateRebuild() = 0;
163-
164159
// Forcibly switch the application into catchup mode, treating `toLedger`
165160
// as the destination ledger number and count as the number of past ledgers
166161
// that should be replayed. Normally this happens automatically when

src/ledger/LedgerManagerImpl.cpp

-38
Original file line numberDiff line numberDiff line change
@@ -178,20 +178,6 @@ LedgerManagerImpl::setState(State s)
178178
{
179179
mApp.getCatchupManager().logAndUpdateCatchupStatus(true);
180180
}
181-
182-
if (mState == LM_CATCHING_UP_STATE && !mStartCatchup)
183-
{
184-
mStartCatchup = std::make_unique<VirtualClock::time_point>(
185-
mApp.getClock().now());
186-
}
187-
else if (mState == LM_SYNCED_STATE && mStartCatchup)
188-
{
189-
std::chrono::nanoseconds duration =
190-
mApp.getClock().now() - *mStartCatchup;
191-
mCatchupDuration.Update(duration);
192-
CLOG_DEBUG(Perf, "Caught up to the network in {} seconds",
193-
std::chrono::duration<double>(duration).count());
194-
}
195181
}
196182
}
197183

@@ -397,30 +383,6 @@ LedgerManagerImpl::loadLastKnownLedger(bool restoreBucketlist)
397383
}
398384
}
399385

400-
bool
401-
LedgerManagerImpl::rebuildingInMemoryState()
402-
{
403-
return mRebuildInMemoryState;
404-
}
405-
406-
void
407-
LedgerManagerImpl::setupInMemoryStateRebuild()
408-
{
409-
if (!mRebuildInMemoryState)
410-
{
411-
LedgerHeader lh;
412-
HistoryArchiveState has;
413-
auto& ps = mApp.getPersistentState();
414-
ps.setState(PersistentState::kLastClosedLedger,
415-
binToHex(xdrSha256(lh)));
416-
ps.setState(PersistentState::kHistoryArchiveState, has.toString());
417-
ps.setState(PersistentState::kLastSCPData, "");
418-
ps.setState(PersistentState::kLastSCPDataXDR, "");
419-
ps.setState(PersistentState::kLedgerUpgrades, "");
420-
mRebuildInMemoryState = true;
421-
}
422-
}
423-
424386
Database&
425387
LedgerManagerImpl::getDatabase()
426388
{

src/ledger/LedgerManagerImpl.h

-2
Original file line numberDiff line numberDiff line change
@@ -175,8 +175,6 @@ class LedgerManagerImpl : public LedgerManager
175175
void startNewLedger(LedgerHeader const& genesisLedger);
176176
void startNewLedger() override;
177177
void loadLastKnownLedger(bool restoreBucketlist) override;
178-
virtual bool rebuildingInMemoryState() override;
179-
virtual void setupInMemoryStateRebuild() override;
180178

181179
LedgerHeaderHistoryEntry const& getLastClosedLedgerHeader() const override;
182180

0 commit comments

Comments
 (0)