Skip to content

Commit

Permalink
Rename TxExecutionThread to Cluster.
Browse files Browse the repository at this point in the history
This is a bit more generic and doesn't suggest the exact execution model (protocol technically allows multiple clusters to be executed sequentially, or a single cluster to be executed via multiple threads).

Also added some comments.
  • Loading branch information
dmkozh committed Dec 14, 2024
1 parent 734bccc commit ddd6434
Showing 1 changed file with 21 additions and 3 deletions.
24 changes: 21 additions & 3 deletions Stellar-ledger.x
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,30 @@ enum TxSetComponentType
TXSET_COMP_TXS_MAYBE_DISCOUNTED_FEE = 0
};

typedef TransactionEnvelope TxExecutionThread<>;
typedef TxExecutionThread ParallelTxExecutionStage<>;

// A collection of transactions that *may* have arbitrary read-write data
// dependencies between each other, i.e. in a general case the transaction
// execution order within a cluster may not be arbitrarily shuffled without
// affecting the end result.
typedef TransactionEnvelope TxExecutionCluster<>;
// A collection of clusters such that are *guaranteed* to not have read-write
// data dependencies in-between clusters, i.e. such that the cluster execution
// order can be arbitrarily shuffled without affecting the end result. Thus
// clusters can be executed in parallel with respect to each other.
typedef TxExecutionCluster ParallelTxExecutionStage<>;

// Transaction set component that contains transactions organized in a
// parallelism-friendly fashion.
//
// The component consists of several stages that have to be executed in
// sequential order, each stage consists of several clusters that can be
// executed in parallel, and the cluster itself consists of several
// transactions that have to be executed in sequential order in a general case.
struct ParallelTxsComponent
{
int64* baseFee;
// A sequence of stages that *may* have arbitrary data dependencies between
// each other, i.e. in a general case the stage execution order may not be
// arbitrarily shuffled without affecting the end result.
ParallelTxExecutionStage executionStages<>;
};

Expand Down

0 comments on commit ddd6434

Please sign in to comment.