Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 6 additions & 7 deletions Builds/VisualStudio/stellar-core.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@
<WarningLevel>Level4</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>CEREAL_THREAD_SAFE;USE_POSTGRES;ENABLE_NEXT_PROTOCOL_VERSION_UNSAFE_FOR_PRODUCTION=1;USE_SPDLOG;FMT_HEADER_ONLY=1;BUILD_TESTS;WIN32_LEAN_AND_MEAN;NOMINMAX;ASIO_STANDALONE;_WINSOCK_DEPRECATED_NO_WARNINGS;SODIUM_STATIC;ASIO_SEPARATE_COMPILATION;ASIO_ERROR_CATEGORY_NOEXCEPT=noexcept;_CRT_SECURE_NO_WARNINGS;_WIN32_WINNT=0x0601;WIN32;_MBCS;_CRT_NONSTDC_NO_DEPRECATE;YY_NO_UNISTD_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>CEREAL_THREAD_SAFE;_SILENCE_CXX20_OLD_SHARED_PTR_ATOMIC_SUPPORT_DEPRECATION_WARNING;USE_POSTGRES;ENABLE_NEXT_PROTOCOL_VERSION_UNSAFE_FOR_PRODUCTION=1;USE_SPDLOG;FMT_HEADER_ONLY=1;BUILD_TESTS;WIN32_LEAN_AND_MEAN;NOMINMAX;ASIO_STANDALONE;_WINSOCK_DEPRECATED_NO_WARNINGS;SODIUM_STATIC;ASIO_SEPARATE_COMPILATION;ASIO_ERROR_CATEGORY_NOEXCEPT=noexcept;_CRT_SECURE_NO_WARNINGS;_WIN32_WINNT=0x0601;WIN32;_MBCS;_CRT_NONSTDC_NO_DEPRECATE;YY_NO_UNISTD_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>src;../../src;../../lib;../../lib/tracy/public/tracy;../../lib/spdlog/include;../../lib/libmedida/src;../../lib/soci/src/core;../../lib/autocheck/include;../../lib/cereal/include;../../lib/asio/asio/include;../../lib/xdrpp;../../lib/libsodium/src/libsodium/include;../../lib/fmt/include;../../lib/util;../..;src/$(Configuration)/generated;src/generated;../../lib/sqlite;c:\Program Files\PostgreSQL\15\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<MinimalRebuild>false</MinimalRebuild>
Expand Down Expand Up @@ -187,7 +187,7 @@ exit /b 0
<WarningLevel>Level4</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>CEREAL_THREAD_SAFE;USE_POSTGRES;USE_SPDLOG;FMT_HEADER_ONLY=1;BUILD_TESTS;WIN32_LEAN_AND_MEAN;NOMINMAX;ASIO_STANDALONE;_WINSOCK_DEPRECATED_NO_WARNINGS;SODIUM_STATIC;ASIO_SEPARATE_COMPILATION;ASIO_ERROR_CATEGORY_NOEXCEPT=noexcept;_CRT_SECURE_NO_WARNINGS;_WIN32_WINNT=0x0601;WIN32;_MBCS;_CRT_NONSTDC_NO_DEPRECATE;YY_NO_UNISTD_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>CEREAL_THREAD_SAFE;_SILENCE_CXX20_OLD_SHARED_PTR_ATOMIC_SUPPORT_DEPRECATION_WARNING;USE_POSTGRES;USE_SPDLOG;FMT_HEADER_ONLY=1;BUILD_TESTS;WIN32_LEAN_AND_MEAN;NOMINMAX;ASIO_STANDALONE;_WINSOCK_DEPRECATED_NO_WARNINGS;SODIUM_STATIC;ASIO_SEPARATE_COMPILATION;ASIO_ERROR_CATEGORY_NOEXCEPT=noexcept;_CRT_SECURE_NO_WARNINGS;_WIN32_WINNT=0x0601;WIN32;_MBCS;_CRT_NONSTDC_NO_DEPRECATE;YY_NO_UNISTD_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>src;../../src;../../lib;../../lib/tracy/public/tracy;../../lib/spdlog/include;../../lib/libmedida/src;../../lib/soci/src/core;../../lib/autocheck/include;../../lib/cereal/include;../../lib/asio/asio/include;../../lib/xdrpp;../../lib/libsodium/src/libsodium/include;../../lib/fmt/include;../../lib/util;../..;src/$(Configuration)/generated;src/generated;../../lib/sqlite;c:\Program Files\PostgreSQL\15\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<MinimalRebuild>false</MinimalRebuild>
Expand Down Expand Up @@ -251,7 +251,7 @@ exit /b 0
<WarningLevel>Level4</WarningLevel>
<Optimization>Disabled</Optimization>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>CEREAL_THREAD_SAFE;ENABLE_NEXT_PROTOCOL_VERSION_UNSAFE_FOR_PRODUCTION=1;USE_SPDLOG;FMT_HEADER_ONLY=1;BUILD_TESTS;WIN32_LEAN_AND_MEAN;NOMINMAX;ASIO_STANDALONE;_WINSOCK_DEPRECATED_NO_WARNINGS;SODIUM_STATIC;ASIO_SEPARATE_COMPILATION;ASIO_ERROR_CATEGORY_NOEXCEPT=noexcept;_CRT_SECURE_NO_WARNINGS;_WIN32_WINNT=0x0601;WIN32;_MBCS;_CRT_NONSTDC_NO_DEPRECATE;YY_NO_UNISTD_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>CEREAL_THREAD_SAFE;_SILENCE_CXX20_OLD_SHARED_PTR_ATOMIC_SUPPORT_DEPRECATION_WARNING;ENABLE_NEXT_PROTOCOL_VERSION_UNSAFE_FOR_PRODUCTION=1;USE_SPDLOG;FMT_HEADER_ONLY=1;BUILD_TESTS;WIN32_LEAN_AND_MEAN;NOMINMAX;ASIO_STANDALONE;_WINSOCK_DEPRECATED_NO_WARNINGS;SODIUM_STATIC;ASIO_SEPARATE_COMPILATION;ASIO_ERROR_CATEGORY_NOEXCEPT=noexcept;_CRT_SECURE_NO_WARNINGS;_WIN32_WINNT=0x0601;WIN32;_MBCS;_CRT_NONSTDC_NO_DEPRECATE;YY_NO_UNISTD_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>src;../../src;../../lib;../../lib/tracy/public/tracy;../../lib/spdlog/include;../../lib/libmedida/src;../../lib/soci/src/core;../../lib/autocheck/include;../../lib/cereal/include;../../lib/asio/asio/include;../../lib/xdrpp;../../lib/libsodium/src/libsodium/include;../../lib/fmt/include;../../lib/util;../..;src/$(Configuration)/generated;src/generated;../../lib/sqlite;c:\Program Files\PostgreSQL\15\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
<MinimalRebuild>false</MinimalRebuild>
Expand Down Expand Up @@ -319,7 +319,7 @@ exit /b 0
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>CEREAL_THREAD_SAFE;USE_POSTGRES;ENABLE_NEXT_PROTOCOL_VERSION_UNSAFE_FOR_PRODUCTION=1;USE_SPDLOG;FMT_HEADER_ONLY=1;BUILD_TESTS;WIN32_LEAN_AND_MEAN;NOMINMAX;ASIO_STANDALONE;_WINSOCK_DEPRECATED_NO_WARNINGS;SODIUM_STATIC;ASIO_SEPARATE_COMPILATION;ASIO_ERROR_CATEGORY_NOEXCEPT=noexcept;TRACY_ENABLE;TRACY_ON_DEMAND;TRACY_NO_BROADCAST;TRACY_ONLY_LOCALHOST;TRACY_DELAYED_INIT;USE_TRACY;_CRT_SECURE_NO_WARNINGS;_WIN32_WINNT=0x0601;WIN32;_MBCS;_CRT_NONSTDC_NO_DEPRECATE;YY_NO_UNISTD_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>CEREAL_THREAD_SAFE;_SILENCE_CXX20_OLD_SHARED_PTR_ATOMIC_SUPPORT_DEPRECATION_WARNING;USE_POSTGRES;ENABLE_NEXT_PROTOCOL_VERSION_UNSAFE_FOR_PRODUCTION=1;USE_SPDLOG;FMT_HEADER_ONLY=1;BUILD_TESTS;WIN32_LEAN_AND_MEAN;NOMINMAX;ASIO_STANDALONE;_WINSOCK_DEPRECATED_NO_WARNINGS;SODIUM_STATIC;ASIO_SEPARATE_COMPILATION;ASIO_ERROR_CATEGORY_NOEXCEPT=noexcept;TRACY_ENABLE;TRACY_ON_DEMAND;TRACY_NO_BROADCAST;TRACY_ONLY_LOCALHOST;TRACY_DELAYED_INIT;USE_TRACY;_CRT_SECURE_NO_WARNINGS;_WIN32_WINNT=0x0601;WIN32;_MBCS;_CRT_NONSTDC_NO_DEPRECATE;YY_NO_UNISTD_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>src;../../src;../../lib;../../lib/tracy/public/tracy;../../lib/spdlog/include;../../lib/libmedida/src;../../lib/soci/src/core;../../lib/autocheck/include;../../lib/cereal/include;../../lib/asio/asio/include;../../lib/xdrpp;../../lib/libsodium/src/libsodium/include;../../lib/fmt/include;../../lib/util;../..;src/$(Configuration)/generated;src/generated;../../lib/sqlite;c:\Program Files\PostgreSQL\15\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<BrowseInformation>false</BrowseInformation>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
Expand Down Expand Up @@ -382,7 +382,7 @@ exit /b 0
<FunctionLevelLinking>true</FunctionLevelLinking>
<IntrinsicFunctions>true</IntrinsicFunctions>
<SDLCheck>true</SDLCheck>
<PreprocessorDefinitions>CEREAL_THREAD_SAFE;USE_POSTGRES;USE_SPDLOG;FMT_HEADER_ONLY=1;BUILD_TESTS;WIN32_LEAN_AND_MEAN;NOMINMAX;ASIO_STANDALONE;_WINSOCK_DEPRECATED_NO_WARNINGS;SODIUM_STATIC;ASIO_SEPARATE_COMPILATION;ASIO_ERROR_CATEGORY_NOEXCEPT=noexcept;TRACY_ENABLE;TRACY_ON_DEMAND;TRACY_NO_BROADCAST;TRACY_ONLY_LOCALHOST;TRACY_DELAYED_INIT;USE_TRACY;_CRT_SECURE_NO_WARNINGS;_WIN32_WINNT=0x0601;WIN32;_MBCS;_CRT_NONSTDC_NO_DEPRECATE;YY_NO_UNISTD_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessorDefinitions>CEREAL_THREAD_SAFE;_SILENCE_CXX20_OLD_SHARED_PTR_ATOMIC_SUPPORT_DEPRECATION_WARNING;USE_POSTGRES;USE_SPDLOG;FMT_HEADER_ONLY=1;BUILD_TESTS;WIN32_LEAN_AND_MEAN;NOMINMAX;ASIO_STANDALONE;_WINSOCK_DEPRECATED_NO_WARNINGS;SODIUM_STATIC;ASIO_SEPARATE_COMPILATION;ASIO_ERROR_CATEGORY_NOEXCEPT=noexcept;TRACY_ENABLE;TRACY_ON_DEMAND;TRACY_NO_BROADCAST;TRACY_ONLY_LOCALHOST;TRACY_DELAYED_INIT;USE_TRACY;_CRT_SECURE_NO_WARNINGS;_WIN32_WINNT=0x0601;WIN32;_MBCS;_CRT_NONSTDC_NO_DEPRECATE;YY_NO_UNISTD_H;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<AdditionalIncludeDirectories>src;../../src;../../lib;../../lib/tracy/public/tracy;../../lib/spdlog/include;../../lib/libmedida/src;../../lib/soci/src/core;../../lib/autocheck/include;../../lib/cereal/include;../../lib/asio/asio/include;../../lib/xdrpp;../../lib/libsodium/src/libsodium/include;../../lib/fmt/include;../../lib/util;../..;src/$(Configuration)/generated;src/generated;../../lib/sqlite;c:\Program Files\PostgreSQL\15\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<BrowseInformation>false</BrowseInformation>
<MultiProcessorCompilation>true</MultiProcessorCompilation>
Expand Down Expand Up @@ -723,6 +723,7 @@ exit /b 0
<ClCompile Include="..\..\src\transactions\test\EventTests.cpp" />
<ClCompile Include="..\..\src\transactions\test\ExchangeTests.cpp" />
<ClCompile Include="..\..\src\transactions\test\FeeBumpTransactionTests.cpp" />
<ClCompile Include="..\..\src\transactions\test\FrozenLedgerKeysTests.cpp" />
<ClCompile Include="..\..\src\transactions\test\InflationTests.cpp" />
<ClCompile Include="..\..\src\transactions\test\InvokeHostFunctionTests.cpp" />
<ClCompile Include="..\..\src\transactions\test\LiquidityPoolDepositTests.cpp" />
Expand Down Expand Up @@ -853,7 +854,6 @@ exit /b 0
<ClCompile Include="..\..\src\main\Config.cpp" />
<ClCompile Include="..\..\src\main\dumpxdr.cpp" />
<ClCompile Include="..\..\src\main\main.cpp" />
<ClCompile Include="..\..\src\main\Maintainer.cpp" />
<ClCompile Include="..\..\src\main\PersistentState.cpp" />
<ClCompile Include="..\..\src\main\StellarCoreVersion.cpp" />
<ClCompile Include="..\..\src\util\test\BitSetTests.cpp" />
Expand Down Expand Up @@ -1200,7 +1200,6 @@ exit /b 0
<ClInclude Include="..\..\src\main\Config.h" />
<ClInclude Include="..\..\src\main\dumpxdr.h" />
<ClInclude Include="..\..\src\main\ErrorMessages.h" />
<ClInclude Include="..\..\src\main\Maintainer.h" />
<ClInclude Include="..\..\src\main\PersistentState.h" />
<ClInclude Include="..\..\src\main\StellarCoreVersion.h" />
<ClInclude Include="..\..\lib\http\connection.hpp" />
Expand Down
7 changes: 1 addition & 6 deletions Builds/VisualStudio/stellar-core.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -408,9 +408,6 @@
<ClCompile Include="..\..\src\main\main.cpp">
<Filter>main</Filter>
</ClCompile>
<ClCompile Include="..\..\src\main\Maintainer.cpp">
<Filter>main</Filter>
</ClCompile>
<ClCompile Include="..\..\src\main\PersistentState.cpp">
<Filter>main</Filter>
</ClCompile>
Expand Down Expand Up @@ -1437,6 +1434,7 @@
<ClCompile Include="..\..\lib\tracy\public\TracyClient.cpp">
<Filter>lib\tracy</Filter>
</ClCompile>
<ClCompile Include="..\..\src\transactions\test\FrozenLedgerKeysTests.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\lib\util\cpptoml.h">
Expand Down Expand Up @@ -1679,9 +1677,6 @@
<ClInclude Include="..\..\src\main\ErrorMessages.h">
<Filter>main</Filter>
</ClInclude>
<ClInclude Include="..\..\src\main\Maintainer.h">
<Filter>main</Filter>
</ClInclude>
<ClInclude Include="..\..\src\main\PersistentState.h">
<Filter>main</Filter>
</ClInclude>
Expand Down
9 changes: 5 additions & 4 deletions src/database/test/DatabaseTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -589,12 +589,13 @@ TEST_CASE("Database splitting migration works correctly", "[db]")

TEST_CASE("ledgerheaders migration works correctly", "[db]")
{
Config::TestDbMode mode = GENERATE(Config::TESTDB_BUCKET_DB_PERSISTENT
#ifdef USE_POSTGRES
,
Config::TESTDB_POSTGRESQL
Config::TestDbMode mode = GENERATE(Config::TESTDB_BUCKET_DB_PERSISTENT,
Config::TESTDB_POSTGRESQL);
#else
Config::TestDbMode mode = GENERATE(Config::TESTDB_BUCKET_DB_PERSISTENT);
#endif
);

#ifdef USE_POSTGRES
INFO("Testing mode: " << (mode == Config::TESTDB_POSTGRESQL
? "PostgreSQL"
Expand Down
83 changes: 81 additions & 2 deletions src/herder/Upgrades.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1267,6 +1267,7 @@ Upgrades::applyVersionUpgrade(Application& app, AbstractLedgerTxn& ltx,
if (needUpgradeToVersion(ProtocolVersion::V_26, prevVersion, newVersion))
{
SorobanNetworkConfig::updateCostTypesForV26(ltx, app);
SorobanNetworkConfig::createLedgerEntriesForV26(ltx, app);
}
}

Expand Down Expand Up @@ -1419,6 +1420,18 @@ ConfigUpgradeSetFrame::upgradeNeeded(LedgerSnapshot const& ls) const
}
for (auto const& updatedEntry : mConfigUpgradeSet.updatedEntry)
{
// The delta entry has no stored counterpart — it always needs
// to be applied (it modifies CONFIG_SETTING_FROZEN_LEDGER_KEYS).
#ifdef ENABLE_NEXT_PROTOCOL_VERSION_UNSAFE_FOR_PRODUCTION
if (updatedEntry.configSettingID() ==
ConfigSettingID::CONFIG_SETTING_FROZEN_LEDGER_KEYS_DELTA ||
updatedEntry.configSettingID() ==
ConfigSettingID::CONFIG_SETTING_FREEZE_BYPASS_TXS_DELTA)
{
return true;
}
#endif

LedgerKey key(LedgerEntryType::CONFIG_SETTING);
key.configSetting().configSettingID = updatedEntry.configSettingID();
bool isSame =
Expand All @@ -1438,10 +1451,76 @@ ConfigUpgradeSetFrame::applyTo(AbstractLedgerTxn& ltx, Application& app) const
bool hasMemorySettingsUpgrade = false;
for (auto const& updatedEntry : mConfigUpgradeSet.updatedEntry)
{
LedgerKey key(LedgerEntryType::CONFIG_SETTING);
auto const id = updatedEntry.configSettingID();
#ifdef ENABLE_NEXT_PROTOCOL_VERSION_UNSAFE_FOR_PRODUCTION
// Delta entries are not stored config entries. They modify the
// corresponding base entries instead.
if (id == ConfigSettingID::CONFIG_SETTING_FROZEN_LEDGER_KEYS_DELTA)
{
LedgerKey frozenKeysLk(LedgerEntryType::CONFIG_SETTING);
frozenKeysLk.configSetting().configSettingID =
CONFIG_SETTING_FROZEN_LEDGER_KEYS;
auto frozenKeysLtxe = ltx.load(frozenKeysLk);
auto& frozenKeysVec = frozenKeysLtxe.current()
.data.configSetting()
.frozenLedgerKeys()
.keys;
std::set<xdr::opaque_vec<>> existing;
for (auto const& k : frozenKeysVec)
{
existing.insert(k);
}

auto const& delta = updatedEntry.frozenLedgerKeysDelta();
for (auto const& k : delta.keysToFreeze)
{
existing.insert(k);
}
for (auto const& k : delta.keysToUnfreeze)
{
existing.erase(k);
}

frozenKeysVec.assign(existing.begin(), existing.end());
continue;
}

if (id == ConfigSettingID::CONFIG_SETTING_FREEZE_BYPASS_TXS_DELTA)
{
LedgerKey bypassTxsLk(LedgerEntryType::CONFIG_SETTING);
bypassTxsLk.configSetting().configSettingID =
CONFIG_SETTING_FREEZE_BYPASS_TXS;
auto bypassTxsLtxe = ltx.load(bypassTxsLk);
auto& bypassTxsVec = bypassTxsLtxe.current()
.data.configSetting()
.freezeBypassTxs()
.txHashes;

std::set<Hash> existing;
for (auto const& h : bypassTxsVec)
{
existing.insert(h);
}

auto const& delta = updatedEntry.freezeBypassTxsDelta();
for (auto const& h : delta.addTxs)
{
existing.insert(h);
}
for (auto const& h : delta.removeTxs)
{
existing.erase(h);
}

bypassTxsVec.assign(existing.begin(), existing.end());
continue;
}
#endif

LedgerKey key(LedgerEntryType::CONFIG_SETTING);
key.configSetting().configSettingID = id;
auto& currentEntry = ltx.load(key).current().data.configSetting();
auto ltxe = ltx.load(key);
auto& currentEntry = ltxe.current().data.configSetting();
if (id == ConfigSettingID::CONFIG_SETTING_STATE_ARCHIVAL &&
currentEntry.stateArchivalSettings()
.liveSorobanStateSizeWindowSampleSize !=
Expand Down
1 change: 1 addition & 0 deletions src/history/test/HistoryTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1582,6 +1582,7 @@ TEST_CASE_VERSIONS(
Config cfg(getTestConfig(0));
cfg.MANUAL_CLOSE = false;
cfg.MAX_CONCURRENT_SUBPROCESSES = 0;
cfg.PARALLEL_LEDGER_APPLY = false;
TmpDirHistoryConfigurator tcfg;
cfg = tcfg.configure(cfg, true);
VirtualClock clock;
Expand Down
Loading
Loading