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
2 changes: 2 additions & 0 deletions Builds/VisualStudio/stellar-core.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -771,6 +771,7 @@ exit /b 0
<ClCompile Include="..\..\src\util\Scheduler.cpp" />
<ClCompile Include="..\..\src\util\SecretManager.cpp" />
<ClCompile Include="..\..\src\util\SimpleTimer.cpp" />
<ClCompile Include="..\..\src\util\StackThread.cpp" />
<ClCompile Include="..\..\src\util\test\BinaryFuseTests.cpp" />
<ClCompile Include="..\..\src\util\test\MetricTests.cpp" />
<ClCompile Include="..\..\src\util\test\SchedulerTests.cpp" />
Expand Down Expand Up @@ -1197,6 +1198,7 @@ exit /b 0
<ClInclude Include="..\..\src\util\Scheduler.h" />
<ClInclude Include="..\..\src\util\SecretManager.h" />
<ClInclude Include="..\..\src\util\SimpleTimer.h" />
<ClInclude Include="..\..\src\util\StackThread.h" />
<ClInclude Include="..\..\src\util\TxResource.h" />
<ClInclude Include="..\..\src\util\UnorderedMap.h" />
<ClInclude Include="..\..\src\util\UnorderedSet.h" />
Expand Down
6 changes: 6 additions & 0 deletions Builds/VisualStudio/stellar-core.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -492,6 +492,9 @@
<ClCompile Include="..\..\src\util\Thread.cpp">
<Filter>util</Filter>
</ClCompile>
<ClCompile Include="..\..\src\util\StackThread.cpp">
<Filter>util</Filter>
</ClCompile>
<ClCompile Include="..\..\src\util\BitSet.h">
<Filter>util</Filter>
</ClCompile>
Expand Down Expand Up @@ -2599,6 +2602,9 @@
<ClInclude Include="..\..\src\main\NtpProbe.h">
<Filter>main</Filter>
</ClInclude>
<ClInclude Include="..\..\src\util\StackThread.h">
<Filter>util</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\..\COPYING" />
Expand Down
6 changes: 6 additions & 0 deletions src/transactions/InvokeHostFunctionOpFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@
#include <Tracy.hpp>
#include <crypto/SHA.h>

#ifdef _WIN32
#ifdef ERROR
#undef ERROR
#endif
#endif

namespace stellar
{
namespace
Expand Down
3 changes: 0 additions & 3 deletions src/transactions/test/InvokeHostFunctionTests.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6862,8 +6862,6 @@ TEST_CASE("Soroban delegated signer authentication", "[tx][soroban]")
InvokeHostFunctionResultCode::INVOKE_HOST_FUNCTION_TRAPPED);
}
}
// This test causes stack overflow on Windows, but works fine on Linux.
#ifndef WIN32
SECTION("deep delegate tree")
{
auto buildDelegateChain = [&](int depth) {
Expand Down Expand Up @@ -6910,7 +6908,6 @@ TEST_CASE("Soroban delegated signer authentication", "[tx][soroban]")
InvokeHostFunctionResultCode::INVOKE_HOST_FUNCTION_TRAPPED);
}
}
#endif
}

TEST_CASE("Soroban authorization", "[tx][soroban]")
Expand Down
5 changes: 3 additions & 2 deletions src/util/BatchExecutor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,9 @@ BatchExecutor::ensureWorkers(size_t count)
{
size_t index = mWorkers.size();
uint64_t batchId = mBatchId;
mWorkers.emplace_back(
[this, index, batchId]() { workerLoop(index, batchId); });
mWorkers.emplace_back(WORKER_STACK_BYTES, [this, index, batchId]() {
workerLoop(index, batchId);
});
pinWorker(index);
}
}
Expand Down
5 changes: 3 additions & 2 deletions src/util/BatchExecutor.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
#include "lib/util/finally.h"
#include "util/GlobalChecks.h"
#include "util/NonCopyable.h"
#include "util/StackThread.h"

#include <atomic>
#include <condition_variable>
Expand All @@ -15,12 +16,12 @@
#include <exception>
#include <functional>
#include <mutex>
#include <thread>
#include <type_traits>
#include <vector>

namespace stellar
{
inline constexpr size_t WORKER_STACK_BYTES = 1 << 23; // 8 MiB

// Executes batches of CPU-bound tasks in parallel on a pool of worker threads.
//
Expand Down Expand Up @@ -77,7 +78,7 @@ class BatchExecutor : private NonMovableOrCopyable
// with std::condition_variable.
std::mutex mMutex;
std::condition_variable mCondition;
std::vector<std::thread> mWorkers;
std::vector<StackThread> mWorkers;
// All allowed logical CPUs in pinning-preference order.
std::vector<unsigned> mPinCpuOrder;
// Number of distinct physical cores found in the allowed logical CPUs.
Expand Down
Loading