@@ -112,11 +112,11 @@ validateParallelComponent(ParallelTxsComponent const& component)
112
112
CLOG_DEBUG (Herder, " Got bad txSet: empty stage" );
113
113
return false ;
114
114
}
115
- for (auto const & thread : stage)
115
+ for (auto const & cluster : stage)
116
116
{
117
- if (thread .empty ())
117
+ if (cluster .empty ())
118
118
{
119
- CLOG_DEBUG (Herder, " Got bad txSet: empty thread " );
119
+ CLOG_DEBUG (Herder, " Got bad txSet: empty cluster " );
120
120
return false ;
121
121
}
122
122
}
@@ -315,13 +315,13 @@ parallelPhaseToXdr(TxStageFrameList const& txs,
315
315
{
316
316
auto & xdrStage = component.executionStages .emplace_back ();
317
317
xdrStage.reserve (stage.size ());
318
- for (auto const & thread : stage)
318
+ for (auto const & cluster : stage)
319
319
{
320
- auto & xdrThread = xdrStage.emplace_back ();
321
- xdrThread .reserve (thread .size ());
322
- for (auto const & tx : thread )
320
+ auto & xdrCluster = xdrStage.emplace_back ();
321
+ xdrCluster .reserve (cluster .size ());
322
+ for (auto const & tx : cluster )
323
323
{
324
- xdrThread .push_back (tx->getEnvelope ());
324
+ xdrCluster .push_back (tx->getEnvelope ());
325
325
}
326
326
}
327
327
}
@@ -404,13 +404,12 @@ sortedForApplyParallel(TxStageFrameList const& stages, Hash const& txSetHash)
404
404
ApplyTxSorter sorter (txSetHash);
405
405
for (auto & stage : sortedStages)
406
406
{
407
- for (auto & thread : stage)
407
+ for (auto & cluster : stage)
408
408
{
409
- std::sort (thread .begin (), thread .end (), sorter);
409
+ std::sort (cluster .begin (), cluster .end (), sorter);
410
410
}
411
- // There is no need to shuffle threads in the stage, as they are
412
- // independent, so the apply order doesn't matter even if the threads
413
- // are being applied sequentially.
411
+ // There is no need to shuffle clusters in the stage, as they are
412
+ // independent, so the apply order between clusters doesn't matter.
414
413
}
415
414
std::sort (sortedStages.begin (), sortedStages.end (),
416
415
[&sorter](auto const & a, auto const & b) {
@@ -1046,9 +1045,9 @@ TxSetXDRFrame::sizeTxTotal() const
1046
1045
for (auto const & stage :
1047
1046
phase.parallelTxsComponent ().executionStages )
1048
1047
{
1049
- for (auto const & thread : stage)
1048
+ for (auto const & cluster : stage)
1050
1049
{
1051
- totalSize += thread .size ();
1050
+ totalSize += cluster .size ();
1052
1051
}
1053
1052
}
1054
1053
break ;
@@ -1109,11 +1108,11 @@ TxSetXDRFrame::sizeOpTotalForLogging() const
1109
1108
for (auto const & stage :
1110
1109
phase.parallelTxsComponent ().executionStages )
1111
1110
{
1112
- for (auto const & thread : stage)
1111
+ for (auto const & cluster : stage)
1113
1112
{
1114
1113
totalSize +=
1115
- std::accumulate (thread .begin (), thread .end (), 0ull ,
1116
- accumulateTxsFn);
1114
+ std::accumulate (cluster .begin (), cluster .end (),
1115
+ 0ull , accumulateTxsFn);
1117
1116
}
1118
1117
}
1119
1118
break ;
@@ -1160,9 +1159,9 @@ TxSetXDRFrame::createTransactionFrames(Hash const& networkID) const
1160
1159
for (auto const & stage :
1161
1160
phase.parallelTxsComponent ().executionStages )
1162
1161
{
1163
- for (auto const & thread : stage)
1162
+ for (auto const & cluster : stage)
1164
1163
{
1165
- for (auto const & tx : thread )
1164
+ for (auto const & tx : cluster )
1166
1165
{
1167
1166
txs.emplace_back (
1168
1167
TransactionFrameBase::makeTransactionFromWire (
@@ -1237,12 +1236,12 @@ TxSetPhaseFrame::Iterator::operator*() const
1237
1236
{
1238
1237
1239
1238
if (mStageIndex >= mStages .size () ||
1240
- mThreadIndex >= mStages [mStageIndex ].size () ||
1241
- mTxIndex >= mStages [mStageIndex ][mThreadIndex ].size ())
1239
+ mClusterIndex >= mStages [mStageIndex ].size () ||
1240
+ mTxIndex >= mStages [mStageIndex ][mClusterIndex ].size ())
1242
1241
{
1243
1242
throw std::runtime_error (" TxPhase iterator out of bounds" );
1244
1243
}
1245
- return mStages [mStageIndex ][mThreadIndex ][mTxIndex ];
1244
+ return mStages [mStageIndex ][mClusterIndex ][mTxIndex ];
1246
1245
}
1247
1246
1248
1247
TxSetPhaseFrame::Iterator&
@@ -1253,13 +1252,13 @@ TxSetPhaseFrame::Iterator::operator++()
1253
1252
throw std::runtime_error (" TxPhase iterator out of bounds" );
1254
1253
}
1255
1254
++mTxIndex ;
1256
- if (mTxIndex >= mStages [mStageIndex ][mThreadIndex ].size ())
1255
+ if (mTxIndex >= mStages [mStageIndex ][mClusterIndex ].size ())
1257
1256
{
1258
1257
mTxIndex = 0 ;
1259
- ++mThreadIndex ;
1260
- if (mThreadIndex >= mStages [mStageIndex ].size ())
1258
+ ++mClusterIndex ;
1259
+ if (mClusterIndex >= mStages [mStageIndex ].size ())
1261
1260
{
1262
- mThreadIndex = 0 ;
1261
+ mClusterIndex = 0 ;
1263
1262
++mStageIndex ;
1264
1263
}
1265
1264
}
@@ -1278,7 +1277,7 @@ bool
1278
1277
TxSetPhaseFrame::Iterator::operator ==(Iterator const & other) const
1279
1278
{
1280
1279
return mStageIndex == other.mStageIndex &&
1281
- mThreadIndex == other.mThreadIndex && mTxIndex == other.mTxIndex &&
1280
+ mClusterIndex == other.mClusterIndex && mTxIndex == other.mTxIndex &&
1282
1281
// Make sure to compare the pointers, not the contents, both for
1283
1282
// correctness and optimization.
1284
1283
&mStages == &other.mStages ;
@@ -1348,11 +1347,11 @@ TxSetPhaseFrame::makeFromWire(Hash const& networkID,
1348
1347
{
1349
1348
auto & stage = stages.emplace_back ();
1350
1349
stage.reserve (xdrStage.size ());
1351
- for (auto const & xdrThread : xdrStage)
1350
+ for (auto const & xdrCluster : xdrStage)
1352
1351
{
1353
- auto & thread = stage.emplace_back ();
1354
- thread .reserve (xdrThread .size ());
1355
- for (auto const & env : xdrThread )
1352
+ auto & cluster = stage.emplace_back ();
1353
+ cluster .reserve (xdrCluster .size ());
1354
+ for (auto const & env : xdrCluster )
1356
1355
{
1357
1356
auto tx = TransactionFrameBase::makeTransactionFromWire (
1358
1357
networkID, env);
@@ -1362,14 +1361,14 @@ TxSetPhaseFrame::makeFromWire(Hash const& networkID,
1362
1361
" transaction has invalid XDR" );
1363
1362
return std::nullopt;
1364
1363
}
1365
- thread .push_back (tx);
1364
+ cluster .push_back (tx);
1366
1365
inclusionFeeMap[tx] = baseFee;
1367
1366
}
1368
- if (!std::is_sorted (thread .begin (), thread .end (),
1367
+ if (!std::is_sorted (cluster .begin (), cluster .end (),
1369
1368
&TxSetUtils::hashTxSorter))
1370
1369
{
1371
1370
CLOG_DEBUG (Herder, " Got bad generalized txSet: "
1372
- " thread is not sorted" );
1371
+ " cluster is not sorted" );
1373
1372
return std::nullopt;
1374
1373
}
1375
1374
}
@@ -1474,9 +1473,9 @@ TxSetPhaseFrame::size() const
1474
1473
size_t size = 0 ;
1475
1474
for (auto const & stage : mStages )
1476
1475
{
1477
- for (auto const & thread : stage)
1476
+ for (auto const & cluster : stage)
1478
1477
{
1479
- size += thread .size ();
1478
+ size += cluster .size ();
1480
1479
}
1481
1480
}
1482
1481
return size;
0 commit comments