Skip to content

Commit a757b61

Browse files
committed
Remove dead code now that in-memory mode is dropped
1 parent 229beb4 commit a757b61

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
@@ -161,11 +161,6 @@ class LedgerManager
161161
// and restart merges
162162
virtual void loadLastKnownLedger(bool restoreBucketlist) = 0;
163163

164-
// Return true if core is currently rebuilding in-memory state via local
165-
// catchup
166-
virtual bool rebuildingInMemoryState() = 0;
167-
virtual void setupInMemoryStateRebuild() = 0;
168-
169164
// Forcibly switch the application into catchup mode, treating `toLedger`
170165
// as the destination ledger number and count as the number of past ledgers
171166
// 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

@@ -398,30 +384,6 @@ LedgerManagerImpl::loadLastKnownLedger(bool restoreBucketlist)
398384
}
399385
}
400386

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

src/ledger/LedgerManagerImpl.h

-2
Original file line numberDiff line numberDiff line change
@@ -189,8 +189,6 @@ class LedgerManagerImpl : public LedgerManager
189189
void startNewLedger(LedgerHeader const& genesisLedger);
190190
void startNewLedger() override;
191191
void loadLastKnownLedger(bool restoreBucketlist) override;
192-
virtual bool rebuildingInMemoryState() override;
193-
virtual void setupInMemoryStateRebuild() override;
194192

195193
LedgerHeaderHistoryEntry const& getLastClosedLedgerHeader() const override;
196194

0 commit comments

Comments
 (0)