Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
marta-lokhova committed Jul 5, 2023
1 parent a2a114c commit 3e16572
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
7 changes: 5 additions & 2 deletions src/herder/HerderImpl.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2064,8 +2064,11 @@ HerderImpl::updateTransactionQueue(TxSetFrameConstPtr txSet)
updateQueue(mTransactionQueue,
txSet->getTxsForPhase(TxSetFrame::Phase::CLASSIC));
#ifdef ENABLE_NEXT_PROTOCOL_VERSION_UNSAFE_FOR_PRODUCTION
updateQueue(mSorobanTransactionQueue,
txSet->getTxsForPhase(TxSetFrame::Phase::SOROBAN));
if (txSet->numPhases() > static_cast<size_t>(TxSetFrame::Phase::SOROBAN))
{
updateQueue(mSorobanTransactionQueue,
txSet->getTxsForPhase(TxSetFrame::Phase::SOROBAN));
}
#endif
}

Expand Down
10 changes: 9 additions & 1 deletion src/herder/TxSetFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -496,6 +496,7 @@ TxSetFrame::previousLedgerHash() const
TxSetFrame::Transactions const&
TxSetFrame::getTxsForPhase(Phase phase) const
{
releaseAssert(static_cast<size_t>(phase) < mTxPhases.size());
return mTxPhases.at(static_cast<size_t>(phase));
}

Expand Down Expand Up @@ -705,7 +706,14 @@ TxSetFrame::size(LedgerHeader const& lh, std::optional<Phase> phase) const
{
size_t sz = 0;
#ifdef ENABLE_NEXT_PROTOCOL_VERSION_UNSAFE_FOR_PRODUCTION
if (!phase || phase.value() == Phase::SOROBAN)
if (!phase)
{
if (numPhases() > static_cast<size_t>(Phase::SOROBAN))
{
sz += sizeOp(Phase::SOROBAN);
}
}
else if (phase.value() == Phase::SOROBAN)
{
sz += sizeOp(Phase::SOROBAN);
}
Expand Down

5 comments on commit 3e16572

@latobarita
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

saw approval from dmkozh
at marta-lokhova@3e16572

@latobarita
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

merging marta-lokhova/stellar-core/soroban_flooding_bugs = 3e16572 into auto

@latobarita
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

marta-lokhova/stellar-core/soroban_flooding_bugs = 3e16572 merged ok, testing candidate = 875f47e

@latobarita
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fast-forwarding master to auto = 875f47e

Please sign in to comment.