@@ -196,18 +196,18 @@ class TxSetXDRFrame : public NonMovableOrCopyable
196
196
// - The whole phase (`TxStageFrameList`) consists of several sequential
197
197
// 'stages' (`TxStageFrame`). A stage has to be executed after every
198
198
// transaction in the previous stage has been applied.
199
- // - A 'stage' (`TxStageFrame`) consists of several parallel 'threads '
200
- // (`TxThreadFrame `). Transactions in different 'threads ' are independent of
199
+ // - A 'stage' (`TxStageFrame`) consists of several independent 'clusters '
200
+ // (`TxClusterFrame `). Transactions in different 'clusters ' are independent of
201
201
// each other and can be applied in parallel.
202
- // - A 'thread ' (`TxThreadFrame `) consists of transactions that should
202
+ // - A 'cluster ' (`TxClusterFrame `) consists of transactions that should
203
203
// generally be applied sequentially. However, not all the transactions in
204
- // the thread are necessarily conflicting with each other; it is possible
205
- // that some, or even all transactions in the thread structure can be applied
204
+ // the cluster are necessarily conflicting with each other; it is possible
205
+ // that some, or even all transactions in the cluster structure can be applied
206
206
// in parallel with each other (depending on their footprints).
207
207
//
208
208
// This structure mimics the XDR structure of the `ParallelTxsComponent`.
209
- using TxThreadFrame = TxFrameList;
210
- using TxStageFrame = std::vector<TxThreadFrame >;
209
+ using TxClusterFrame = TxFrameList;
210
+ using TxStageFrame = std::vector<TxClusterFrame >;
211
211
using TxStageFrameList = std::vector<TxStageFrame>;
212
212
213
213
// Alias for the map from transaction to its inclusion fee as defined by the
@@ -276,19 +276,23 @@ class TxSetPhaseFrame
276
276
Iterator (TxStageFrameList const & txs, size_t stageIndex);
277
277
TxStageFrameList const & mStages ;
278
278
size_t mStageIndex = 0 ;
279
- size_t mThreadIndex = 0 ;
279
+ size_t mClusterIndex = 0 ;
280
280
size_t mTxIndex = 0 ;
281
281
};
282
282
Iterator begin () const ;
283
283
Iterator end () const ;
284
- size_t size () const ;
284
+ size_t sizeTx () const ;
285
+ size_t sizeOp () const ;
286
+ size_t size (LedgerHeader const & lclHeader) const ;
285
287
bool empty () const ;
286
288
287
289
// Get _inclusion_ fee map for this phase. The map contains lowest base
288
290
// fee for each transaction (lowest base fee is identical for all
289
291
// transactions in the same lane)
290
292
InclusionFeeMap const & getInclusionFeeMap () const ;
291
293
294
+ std::optional<Resource> getTotalResources () const ;
295
+
292
296
private:
293
297
friend class TxSetXDRFrame ;
294
298
friend class ApplicableTxSetFrame ;
@@ -312,16 +316,16 @@ class TxSetPhaseFrame
312
316
TxFrameList& invalidTxs,
313
317
bool enforceTxsApplyOrder);
314
318
#endif
315
-
316
- TxSetPhaseFrame (TxFrameList const & txs,
319
+ TxSetPhaseFrame (TxSetPhase phase, TxFrameList const & txs,
317
320
std::shared_ptr<InclusionFeeMap> inclusionFeeMap);
318
- TxSetPhaseFrame (TxStageFrameList&& txs,
321
+ TxSetPhaseFrame (TxSetPhase phase, TxStageFrameList&& txs,
319
322
std::shared_ptr<InclusionFeeMap> inclusionFeeMap);
320
323
321
324
// Creates a new phase from `TransactionPhase` XDR coming from a
322
325
// `GeneralizedTransactionSet`.
323
326
static std::optional<TxSetPhaseFrame>
324
- makeFromWire (Hash const & networkID, TransactionPhase const & xdrPhase);
327
+ makeFromWire (TxSetPhase phase, Hash const & networkID,
328
+ TransactionPhase const & xdrPhase);
325
329
326
330
// Creates a new phase from all the transactions in the legacy
327
331
// `TransactionSet` XDR.
@@ -330,10 +334,20 @@ class TxSetPhaseFrame
330
334
xdr::xvector<TransactionEnvelope> const & xdrTxs);
331
335
332
336
// Creates a valid empty phase with given `isParallel` flag.
333
- static TxSetPhaseFrame makeEmpty (bool isParallel);
337
+ static TxSetPhaseFrame makeEmpty (TxSetPhase phase, bool isParallel);
334
338
335
339
// Returns a copy of this phase with transactions sorted for apply.
336
340
TxSetPhaseFrame sortedForApply (Hash const & txSetHash) const ;
341
+ bool checkValid (Application& app, uint64_t lowerBoundCloseTimeOffset,
342
+ uint64_t upperBoundCloseTimeOffset) const ;
343
+ bool checkValidClassic (LedgerHeader const & lclHeader) const ;
344
+ bool checkValidSoroban (LedgerHeader const & lclHeader,
345
+ SorobanNetworkConfig const & sorobanConfig) const ;
346
+
347
+ bool txsAreValid (Application& app, uint64_t lowerBoundCloseTimeOffset,
348
+ uint64_t upperBoundCloseTimeOffset) const ;
349
+
350
+ TxSetPhase mPhase ;
337
351
338
352
TxStageFrameList mStages ;
339
353
std::shared_ptr<InclusionFeeMap> mInclusionFeeMap ;
@@ -471,8 +485,6 @@ class ApplicableTxSetFrame
471
485
ApplicableTxSetFrame (ApplicableTxSetFrame const &) = default ;
472
486
ApplicableTxSetFrame (ApplicableTxSetFrame&&) = default ;
473
487
474
- std::optional<Resource> getTxSetSorobanResource () const ;
475
-
476
488
void toXDR (TransactionSet& set) const ;
477
489
void toXDR (GeneralizedTransactionSet& generalizedTxSet) const ;
478
490
0 commit comments