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 Sep 18, 2024
1 parent bfd1cc2 commit 93c9541
Show file tree
Hide file tree
Showing 22 changed files with 1,875 additions and 1,041 deletions.
1 change: 1 addition & 0 deletions Builds/VisualStudio/stellar-core.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -596,6 +596,7 @@ exit /b 0
<ClCompile Include="..\..\src\ledger\LedgerHeaderUtils.cpp" />
<ClCompile Include="..\..\src\ledger\LedgerManagerImpl.cpp" />
<ClCompile Include="..\..\src\ledger\LedgerRange.cpp" />
<ClCompile Include="..\..\src\ledger\LedgerStateSnapshot.cpp" />
<ClCompile Include="..\..\src\ledger\LedgerTxn.cpp" />
<ClCompile Include="..\..\src\ledger\LedgerTxnAccountSQL.cpp" />
<ClCompile Include="..\..\src\ledger\LedgerTxnClaimableBalanceSQL.cpp" />
Expand Down
3 changes: 3 additions & 0 deletions Builds/VisualStudio/stellar-core.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -1377,6 +1377,9 @@
<ClCompile Include="..\..\src\main\QueryServer.cpp">
<Filter>main</Filter>
</ClCompile>
<ClCompile Include="..\..\src\ledger\LedgerStateSnapshot.cpp">
<Filter>ledger</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="..\..\lib\util\cpptoml.h">
Expand Down
4 changes: 2 additions & 2 deletions src/herder/HerderImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1350,7 +1350,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 @@ -1415,7 +1415,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 @@ -937,11 +937,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 93c9541

Please sign in to comment.