Skip to content

Commit 0d7b434

Browse files
authored
Add P23 data corruption verification tool. (#4969)
# Description Add P23 data corruption verification tool. This allows specifying an external CSV table that contains the expected p23 Hot Archive corruption data. Then during catchup that covers the whole range of p23 and the upgrade to p24 the file is used to verify that: - Only the entries from the table are ever incorrectly archived, and that their correct and archived states match those in the table - Every entry from the table has indeed been incorrectly archived - The entries that have been marked as restored in the table were indeed restored with the expected corrupted state - During the protocol 24 upgrade only the entries from the table that have never been restored have been updated, and that the update has brought them back to the correct state # Checklist - [ ] Reviewed the [contributing](https://github.com/stellar/stellar-core/blob/master/CONTRIBUTING.md#submitting-changes) document - [ ] Rebased on top of master (no merge commits) - [ ] Ran `clang-format` v8.0.0 (via `make format` or the Visual Studio extension) - [ ] Compiles - [ ] Ran all tests - [ ] If change impacts performance, include supporting evidence per the [performance document](https://github.com/stellar/stellar-core/blob/master/performance-eval/performance-eval.md)
2 parents 2993259 + bf8bc2f commit 0d7b434

12 files changed

+569
-13
lines changed

src/ledger/LedgerManagerImpl.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2787,6 +2787,15 @@ LedgerManagerImpl::sealLedgerTxnAndTransferEntriesToBucketList(
27872787
mApp.getBucketManager().addHotArchiveBatch(
27882788
mApp, lh, evictedState.archivedEntries,
27892789
restoredEntries);
2790+
// Validate evicted entries against Protocol 23 corruption
2791+
// data if configured
2792+
if (mApp.getProtocol23CorruptionDataVerifier())
2793+
{
2794+
mApp.getProtocol23CorruptionDataVerifier()
2795+
->verifyArchivalOfCorruptedEntry(evictedState, mApp,
2796+
lh.ledgerSeq,
2797+
lh.ledgerVersion);
2798+
}
27902799
}
27912800
}
27922801

@@ -2803,9 +2812,9 @@ LedgerManagerImpl::sealLedgerTxnAndTransferEntriesToBucketList(
28032812
// Subtle: we snapshot the state size *before* flushing the updated
28042813
// entries into in-memory state (doing that after would be really
28052814
// tricky, as we seal LTX before flushing). So the snapshot taken at
2806-
// ledger `N` will have the state size for ledger `N - 1`. That doesn't
2807-
// really change anything for the size accounting, but is important to
2808-
// maintain as a protocol implementation detail.
2815+
// ledger `N` will have the state size for ledger `N - 1`. That
2816+
// doesn't really change anything for the size accounting, but is
2817+
// important to maintain as a protocol implementation detail.
28092818
mApplyState.getSorobanNetworkConfigForCommit()
28102819
.maybeSnapshotSorobanStateSize(
28112820
lh.ledgerSeq, mApplyState.getSorobanInMemoryStateSize(), ltx,

0 commit comments

Comments
 (0)