Skip to content

Commit

Permalink
Initial support for parallel Soroban phase XDR.
Browse files Browse the repository at this point in the history
I've tried to minimize the scope of the changes; specifically this doesn't contain any actual logic for the parallel execution (such as data dependency validation and building parallel stages). However, there is still some refactoring that needed to happen in order to support new, more complex tx sets.
  • Loading branch information
dmkozh committed Aug 9, 2024
1 parent f25405b commit f38272f
Show file tree
Hide file tree
Showing 26 changed files with 2,466 additions and 1,768 deletions.
4 changes: 4 additions & 0 deletions Builds/VisualStudio/stellar-core.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,7 @@ exit /b 0
<ClCompile Include="..\..\src\transactions\ManageOfferOpFrameBase.cpp" />
<ClCompile Include="..\..\src\transactions\ManageSellOfferOpFrame.cpp" />
<ClCompile Include="..\..\src\transactions\MergeOpFrame.cpp" />
<ClCompile Include="..\..\src\transactions\MutableTransactionResult.cpp" />
<ClCompile Include="..\..\src\transactions\OfferExchange.cpp" />
<ClCompile Include="..\..\src\transactions\OperationFrame.cpp" />
<ClCompile Include="..\..\src\transactions\PathPaymentOpFrameBase.cpp" />
Expand Down Expand Up @@ -699,6 +700,7 @@ exit /b 0
<ClCompile Include="..\..\src\transactions\test\SignatureUtilsTest.cpp" />
<ClCompile Include="..\..\src\transactions\test\SorobanTxTestUtils.cpp" />
<ClCompile Include="..\..\src\transactions\test\SponsorshipTestUtils.cpp" />
<ClCompile Include="..\..\src\transactions\test\TransactionTestFrame.cpp" />
<ClCompile Include="..\..\src\transactions\test\TxEnvelopeTests.cpp" />
<ClCompile Include="..\..\src\transactions\test\TxResultsTests.cpp" />
<ClCompile Include="..\..\src\transactions\TransactionBridge.cpp" />
Expand Down Expand Up @@ -1067,6 +1069,7 @@ exit /b 0
<ClInclude Include="..\..\src\transactions\ManageOfferOpFrameBase.h" />
<ClInclude Include="..\..\src\transactions\ManageSellOfferOpFrame.h" />
<ClInclude Include="..\..\src\transactions\MergeOpFrame.h" />
<ClInclude Include="..\..\src\transactions\MutableTransactionResult.h" />
<ClInclude Include="..\..\src\transactions\OfferExchange.h" />
<ClInclude Include="..\..\src\transactions\OperationFrame.h" />
<ClInclude Include="..\..\src\transactions\PathPaymentOpFrameBase.h" />
Expand All @@ -1082,6 +1085,7 @@ exit /b 0
<ClInclude Include="..\..\src\transactions\SponsorshipUtils.h" />
<ClInclude Include="..\..\src\transactions\test\SorobanTxTestUtils.h" />
<ClInclude Include="..\..\src\transactions\test\SponsorshipTestUtils.h" />
<ClInclude Include="..\..\src\transactions\test\TransactionTestFrame.h" />
<ClInclude Include="..\..\src\transactions\TransactionBridge.h" />
<ClInclude Include="..\..\src\transactions\TransactionFrame.h" />
<ClInclude Include="..\..\src\transactions\TransactionFrameBase.h" />
Expand Down
12 changes: 12 additions & 0 deletions Builds/VisualStudio/stellar-core.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -1347,6 +1347,12 @@
<ClCompile Include="..\..\src\overlay\Hmac.cpp">
<Filter>overlay</Filter>
</ClCompile>
<ClCompile Include="..\..\src\transactions\test\TransactionTestFrame.cpp">
<Filter>transactions\tests</Filter>
</ClCompile>
<ClCompile Include="..\..\src\transactions\MutableTransactionResult.cpp">
<Filter>transactions</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\lib\util\cpptoml.h">
Expand Down Expand Up @@ -2345,6 +2351,12 @@
<ClInclude Include="..\..\src\overlay\Hmac.h">
<Filter>overlay</Filter>
</ClInclude>
<ClInclude Include="..\..\src\transactions\test\TransactionTestFrame.h">
<Filter>transactions\tests</Filter>
</ClInclude>
<ClInclude Include="..\..\src\transactions\MutableTransactionResult.h">
<Filter>transactions</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<None Include="..\..\AUTHORS" />
Expand Down
4 changes: 2 additions & 2 deletions src/herder/HerderImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1351,7 +1351,7 @@ HerderImpl::triggerNextLedger(uint32_t ledgerSeqToTrigger,
// our first choice for this round's set is all the tx we have collected
// during last few ledger closes
auto const& lcl = mLedgerManager.getLastClosedLedgerHeader();
TxSetPhaseTransactions txPhases;
PerPhaseTransactionList txPhases;
txPhases.emplace_back(mTransactionQueue.getTransactions(lcl.header));

if (protocolVersionStartsFrom(lcl.header.ledgerVersion,
Expand Down Expand Up @@ -1416,7 +1416,7 @@ HerderImpl::triggerNextLedger(uint32_t ledgerSeqToTrigger,
upperBoundCloseTimeOffset = nextCloseTime - lcl.header.scpValue.closeTime;
lowerBoundCloseTimeOffset = upperBoundCloseTimeOffset;

TxSetPhaseTransactions invalidTxPhases;
PerPhaseTransactionList invalidTxPhases;
invalidTxPhases.resize(txPhases.size());

auto [proposedSet, applicableProposedSet] =
Expand Down
4 changes: 2 additions & 2 deletions src/herder/TransactionQueue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -867,11 +867,11 @@ TransactionQueue::isBanned(Hash const& hash) const
});
}

TxSetTransactions
TxFrameList
TransactionQueue::getTransactions(LedgerHeader const& lcl) const
{
ZoneScoped;
TxSetTransactions txs;
TxFrameList txs;

uint32_t const nextLedgerSeq = lcl.ledgerSeq + 1;
int64_t const startingSeq = getStartingSequenceNumber(nextLedgerSeq);
Expand Down
2 changes: 1 addition & 1 deletion src/herder/TransactionQueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ class TransactionQueue

bool isBanned(Hash const& hash) const;
TransactionFrameBaseConstPtr getTx(Hash const& hash) const;
TxSetTransactions getTransactions(LedgerHeader const& lcl) const;
TxFrameList getTransactions(LedgerHeader const& lcl) const;
bool sourceAccountPending(AccountID const& accountID) const;

virtual size_t getMaxQueueSizeOps() const = 0;
Expand Down
Loading

0 comments on commit f38272f

Please sign in to comment.