From 34d92e21e1c24d7e34dcc159306bf1758c9e47fc Mon Sep 17 00:00:00 2001 From: Garand Tyson Date: Mon, 13 Jan 2025 19:31:07 -0800 Subject: [PATCH] cleanup --- src/bucket/test/BucketTestUtils.cpp | 3 +-- src/ledger/LedgerManagerImpl.cpp | 2 -- src/transactions/InvokeHostFunctionOpFrame.cpp | 8 ++------ src/transactions/RestoreFootprintOpFrame.cpp | 6 ------ 4 files changed, 3 insertions(+), 16 deletions(-) diff --git a/src/bucket/test/BucketTestUtils.cpp b/src/bucket/test/BucketTestUtils.cpp index ebe94c8696..c5b79d9f04 100644 --- a/src/bucket/test/BucketTestUtils.cpp +++ b/src/bucket/test/BucketTestUtils.cpp @@ -235,7 +235,6 @@ LedgerManagerForBucketTests::transferLedgerEntriesToBucketList( ltxEvictions, lh.ledgerSeq, keys, initialLedgerVers, mApp.getLedgerManager() .getSorobanNetworkConfigForApply()); -#ifdef ENABLE_NEXT_PROTOCOL_VERSION_UNSAFE_FOR_PRODUCTION if (protocolVersionStartsFrom( initialLedgerVers, BucketBase:: @@ -256,7 +255,7 @@ LedgerManagerForBucketTests::transferLedgerEntriesToBucketList( mApp, lh, evictedState.archivedEntries, restoredKeys, {}); } -#endif + if (ledgerCloseMeta) { ledgerCloseMeta->populateEvictedEntries(evictedState); diff --git a/src/ledger/LedgerManagerImpl.cpp b/src/ledger/LedgerManagerImpl.cpp index 2bbc06adc8..1afd2ffdb8 100644 --- a/src/ledger/LedgerManagerImpl.cpp +++ b/src/ledger/LedgerManagerImpl.cpp @@ -1788,7 +1788,6 @@ LedgerManagerImpl::transferLedgerEntriesToBucketList( ltxEvictions, lh.ledgerSeq, keys, initialLedgerVers, *mSorobanNetworkConfigForApply); -#ifdef ENABLE_NEXT_PROTOCOL_VERSION_UNSAFE_FOR_PRODUCTION if (protocolVersionStartsFrom( initialLedgerVers, BucketBase::FIRST_PROTOCOL_SUPPORTING_PERSISTENT_EVICTION)) @@ -1807,7 +1806,6 @@ LedgerManagerImpl::transferLedgerEntriesToBucketList( mApp.getBucketManager().addHotArchiveBatch( mApp, lh, evictedState.archivedEntries, restoredKeys, {}); } -#endif if (ledgerCloseMeta) { diff --git a/src/transactions/InvokeHostFunctionOpFrame.cpp b/src/transactions/InvokeHostFunctionOpFrame.cpp index 5135a64a84..7de739ea74 100644 --- a/src/transactions/InvokeHostFunctionOpFrame.cpp +++ b/src/transactions/InvokeHostFunctionOpFrame.cpp @@ -406,7 +406,6 @@ InvokeHostFunctionOpFrame::doApply( } } // If ttlLtxe doesn't exist, this is a new Soroban entry -#ifdef ENABLE_NEXT_PROTOCOL_VERSION_UNSAFE_FOR_PRODUCTION // Starting in protocol 23, we must check the Hot Archive for // new keys. If a new key is actually archived, fail the op. if (isPersistentEntry(lk) && @@ -422,8 +421,7 @@ InvokeHostFunctionOpFrame::doApply( { sorobanData->pushApplyTimeDiagnosticError( appConfig, SCE_VALUE, SCEC_INVALID_INPUT, - "trying to access an archived contract " - "code " + "trying to access an archived contract code " "entry", {makeBytesSCVal(lk.contractCode().hash)}); } @@ -431,8 +429,7 @@ InvokeHostFunctionOpFrame::doApply( { sorobanData->pushApplyTimeDiagnosticError( appConfig, SCE_VALUE, SCEC_INVALID_INPUT, - "trying to access an archived contract " - "data " + "trying to access an archived contract data " "entry", {makeAddressSCVal(lk.contractData().contract), lk.contractData().key}); @@ -443,7 +440,6 @@ InvokeHostFunctionOpFrame::doApply( return false; } } -#endif } if (!isSorobanEntry(lk) || sorobanEntryLive) diff --git a/src/transactions/RestoreFootprintOpFrame.cpp b/src/transactions/RestoreFootprintOpFrame.cpp index 72afe64d72..e17fa9cec3 100644 --- a/src/transactions/RestoreFootprintOpFrame.cpp +++ b/src/transactions/RestoreFootprintOpFrame.cpp @@ -85,7 +85,6 @@ RestoreFootprintOpFrame::doApply( auto constTTLLtxe = ltx.loadWithoutRecord(ttlKey); if (!constTTLLtxe) { -#ifdef ENABLE_NEXT_PROTOCOL_VERSION_UNSAFE_FOR_PRODUCTION // Next check the hot archive if protocol >= 23 if (protocolVersionStartsFrom( ltx.getHeader().ledgerVersion, @@ -100,7 +99,6 @@ RestoreFootprintOpFrame::doApply( } } else -#endif { // Entry doesn't exist, skip continue; @@ -116,14 +114,12 @@ RestoreFootprintOpFrame::doApply( // We must load the ContractCode/ContractData entry for fee purposes, as // restore is considered a write uint32_t entrySize = 0; -#ifdef ENABLE_NEXT_PROTOCOL_VERSION_UNSAFE_FOR_PRODUCTION if (hotArchiveEntry) { entrySize = static_cast( xdr::xdr_size(hotArchiveEntry->archivedEntry())); } else -#endif { auto constEntryLtxe = ltx.loadWithoutRecord(lk); @@ -177,14 +173,12 @@ RestoreFootprintOpFrame::doApply( rustChange.new_size_bytes = entrySize; rustChange.new_live_until_ledger = restoredLiveUntilLedger; -#ifdef ENABLE_NEXT_PROTOCOL_VERSION_UNSAFE_FOR_PRODUCTION if (hotArchiveEntry) { ltx.restoreFromHotArchive(hotArchiveEntry->archivedEntry(), restoredLiveUntilLedger); } else -#endif { // Entry exists in the live BucketList if we get this this point due // to the constTTLLtxe loadWithoutRecord logic above.