Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit a6f78b1

Browse files
committedJun 24, 2024··
small fixes
1 parent 42634b2 commit a6f78b1

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed
 

‎src/herder/TxSetFrame.cpp

+16-2
Original file line numberDiff line numberDiff line change
@@ -852,8 +852,12 @@ TxSetXDRFrame::makeEmpty(LedgerHeaderHistoryEntry const& lclHeader)
852852
if (protocolVersionStartsFrom(lclHeader.header.ledgerVersion,
853853
SOROBAN_PROTOCOL_VERSION))
854854
{
855+
// Create only non-parallel phases for now. Later we'll need to add an
856+
// empty Soroban parallel stage starting from the respective protocol
857+
// version.
855858
std::vector<TxSetPhaseFrame> emptyPhases(
856-
static_cast<size_t>(TxSetPhase::PHASE_COUNT));
859+
static_cast<size_t>(TxSetPhase::PHASE_COUNT),
860+
TxSetPhaseFrame::makeEmpty(false));
857861
GeneralizedTransactionSet txSet;
858862
transactionsToGeneralizedTransactionSetXDR(emptyPhases, lclHeader.hash,
859863
txSet);
@@ -1002,7 +1006,6 @@ TxSetXDRFrame::prepareForApply(Application& app) const
10021006
else
10031007
{
10041008
auto const& xdrTxSet = std::get<TransactionSet>(mXDRTxSet);
1005-
phaseFrames.emplace_back();
10061009
auto maybePhase = TxSetPhaseFrame::makeFromWireLegacy(
10071010
app.getLedgerManager().getLastClosedLedgerHeader().header,
10081011
app.getNetworkID(), xdrTxSet.txs);
@@ -1406,6 +1409,17 @@ TxSetPhaseFrame::makeFromWireLegacy(
14061409
inclusionFeeMapPtr);
14071410
}
14081411

1412+
TxSetPhaseFrame
1413+
TxSetPhaseFrame::makeEmpty(bool isParallel)
1414+
{
1415+
if (isParallel)
1416+
{
1417+
return TxSetPhaseFrame(TxStageFrameList{},
1418+
std::make_shared<InclusionFeeMap>());
1419+
}
1420+
return TxSetPhaseFrame(TxFrameList{}, std::make_shared<InclusionFeeMap>());
1421+
}
1422+
14091423
TxSetPhaseFrame::TxSetPhaseFrame(
14101424
TxFrameList&& txs, std::shared_ptr<InclusionFeeMap> inclusionFeeMap)
14111425
: mTxs(txs), mInclusionFeeMap(inclusionFeeMap)

‎src/herder/TxSetFrame.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -203,11 +203,12 @@ class TxSetPhaseFrame
203203
makeFromWireLegacy(LedgerHeader const& lclHeader, Hash const& networkID,
204204
xdr::xvector<TransactionEnvelope> const& xdrTxs);
205205

206+
static TxSetPhaseFrame makeEmpty(bool isParallel);
207+
206208
TxSetPhaseFrame(TxFrameList&& txs,
207209
std::shared_ptr<InclusionFeeMap> inclusionFeeMap);
208210
TxSetPhaseFrame(TxStageFrameList&& txs,
209211
std::shared_ptr<InclusionFeeMap> inclusionFeeMap);
210-
TxSetPhaseFrame() = default;
211212

212213
bool isParallel() const;
213214

‎src/main/ApplicationImpl.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ ApplicationImpl::initialize(bool createNewDB, bool forceRebuild)
355355
}
356356

357357
AccountSubEntriesCountIsValid::registerInvariant(*this);
358-
//ConservationOfLumens::registerInvariant(*this);
358+
ConservationOfLumens::registerInvariant(*this);
359359
LedgerEntryIsValid::registerInvariant(*this);
360360
LiabilitiesMatchOffers::registerInvariant(*this);
361361
SponsorshipCountIsValid::registerInvariant(*this);

0 commit comments

Comments
 (0)
Please sign in to comment.