From fcd066524a439f8fe4be91a12524d56b01c8c946 Mon Sep 17 00:00:00 2001 From: Mustafa Uzun Date: Thu, 12 Jun 2025 15:38:30 +0300 Subject: [PATCH 1/7] docs: enhance simulator configuration documentation Signed-off-by: Mustafa Uzun --- docs/simulator/configuration.md | 81 +++++++++++++++---- .../config/data/BlockGeneratorConfig.java | 4 + .../config/data/BlockStreamConfig.java | 2 + .../simulator/config/data/ConsumerConfig.java | 6 ++ 4 files changed, 76 insertions(+), 17 deletions(-) diff --git a/docs/simulator/configuration.md b/docs/simulator/configuration.md index f755d2bbc..2fcdcff64 100644 --- a/docs/simulator/configuration.md +++ b/docs/simulator/configuration.md @@ -2,33 +2,80 @@ There are 3 configuration sets: 1. [BlockStreamConfig](#blockstreamconfig): contains the configuration for the Block Stream Simulator logic. -1. [GeneratorConfig](#generatorconfig): contains the configuration for the Block Stream Simulator generation module. +1. [BlockGeneratorConfig](#blockGeneratorConfig): contains the configuration for the Block Stream Simulator generation module. +1. [SimulatorStartupDataConfig](#simulatorstartupdataconfig): contains the configuration for the Block Stream Simulator startup data. +1. [UnorderedStreamConfig](#unorderedstreamconfig): contains the configuration for the Unordered Stream Simulator logic. +1. [ConsumerConfig](#consumerConfig): contains the configuration for the Consumer Simulator logic. 1. [GrpcConfig](#grpcconfig): contains the configuration for the gRPC communication with the Block-Node. +1. [PrometheusConfig](#prometheusconfig): contains the configuration for the Prometheus. ## BlockStreamConfig Uses the prefix `blockStream` so all properties should start with `blockStream.` -| Key | Description | Default Value | -|:-------------------------|:------------------------------------------------------------------------------------------------------------------------------------|----------------:| -| `simulatorMode` | The desired simulator mode to use, it can be either `PUBLISHER` or `CONSUMER`. | `PUBLISHER` | -| `delayBetweenBlockItems` | The delay between each block item in nanoseconds, only applicable when streamingMode=CONSTANT_RATE | `1_500_000` | -| `maxBlockItemsToStream` | exit condition for the simulator and the circular implementations such as `BlockAsDir` or `BlockAsFile` implementations | `10_000` | -| `streamingMode` | can either be `CONSTANT_RATE` or `MILLIS_PER_BLOCK` | `CONSTANT_RATE` | -| `millisecondsPerBlock` | if streamingMode is `MILLIS_PER_BLOCK` this will be the time to wait between blocks in milliseconds | `1_000` | -| `blockItemsBatchSize` | the number of block items to send in a single batch, however if a block has less block items, it will send all the items in a block | `1_000` | +| Key | Description | Default Value | +|:-----------------------------|:------------------------------------------------------------------------------------------------------------------------------------|----------------:| +| `simulatorMode` | The desired simulator mode to use, it can be either `PUBLISHER` or `CONSUMER`. | `PUBLISHER` | +| `lastKnownStatusesCapacity` | The store capacity for the last known statuses. | `10` | +| `delayBetweenBlockItems` | The delay between each block item in nanoseconds, only applicable when streamingMode=CONSTANT_RATE | `1_500_000` | +| `maxBlockItemsToStream` | The maximum number of block items to stream before stopping | `100_000` | +| `streamingMode` | Can either be `CONSTANT_RATE` or `MILLIS_PER_BLOCK` | `CONSTANT_RATE` | +| `millisecondsPerBlock` | If streamingMode is `MILLIS_PER_BLOCK` this will be the time to wait between blocks in milliseconds | `1_000` | +| `blockItemsBatchSize` | The number of block items to send in a single batch, however if a block has less block items, it will send all the items in a block | `1_000` | +| `midBlockFailType` | The type of failure to occur while streaming. It can be `NONE`, `ABRUPT` or `EOS` | `NONE` | +| `midBlockFailOffset` | The index where the failure will occur, only applicable if midBlockFailType is not `NONE` | `0` | -## GeneratorConfig +## BlockGeneratorConfig Uses the prefix `generator` so all properties should start with `generator.` -| Key | Description | Default Value | -|:------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------:| -| `generationMode` | The desired generation Mode to use, it can only be `DIR` or `AD_HOC` | `DIR` | -| `folderRootPath` | If the generationMode is DIR this will be used as the source of the recording to stream to the Block-Node | `` | -| `managerImplementation` | The desired implementation of the BlockStreamManager to use, it can only be `BlockAsDirBlockStreamManager`, `BlockAsFileBlockStreamManager` or `BlockAsFileLargeDataSets` | `BlockAsFileBlockStreamManager` | -| `paddedLength` | on the `BlockAsFileLargeDataSets` implementation, the length of the padded left zeroes `000001.blk.gz` | 36 | -| `fileExtension` | on the `BlockAsFileLargeDataSets` implementation, the extension of the files to be streamed | `.blk.gz` | +| Key | Description | Default Value | +|:--------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------:| +| `generationMode` | The desired generation Mode to use, it can only be `DIR` or `CRAFT` | `DIR` | +| `minEventsPerBlock` | The minimum number of events per block | `1` | +| `maxEventsPerBlock` | The maximum number of events per block | `10` | +| `minTransactionsPerEvent` | The minimum number of transactions per event | `1` | +| `maxTransactionsPerEvent` | The maximum number of transactions per event | `10` | +| `folderRootPath` | If the generationMode is `DIR` this will be used as the source of the recording to stream to the Block-Node | `` | +| `managerImplementation` | The desired implementation of the BlockStreamManager to use, it can only be `BlockAsDirBlockStreamManager`, `BlockAsFileBlockStreamManager` or `BlockAsFileLargeDataSets` | `BlockAsFileBlockStreamManager` | +| `paddedLength` | On the `BlockAsFileLargeDataSets` implementation, the length of the padded left zeroes `000001.blk.gz` | `36` | +| `fileExtension` | On the `BlockAsFileLargeDataSets` implementation, the extension of the files to be streamed | `.blk.gz` | +| `startBlockNumber` | The block number to start streaming from | `0` | +| `endBlockNumber` | The block number to stop streaming at | `-1` | +| `invalidBlockHash` | If set to true, will send invalid block root hash | `false` | + +## SimulatorStartupDataConfig + +Uses the prefix `simulator.startup.data` so all properties should start with `simulator.startup.data.` + +| Key | Description | Default Value | +|:---------------------------|:-----------------------------------------------------------------|--------------------------------------------:| +| `enabled` | Whether the startup data functionality is enabled | `false` | +| `latestAckBlockNumberPath` | Path to the file containing the latest acknowledged block number | `/opt/simulator/data/latestAckBlockNumber` | +| `latestAckBlockHashPath` | Path to the file containing the latest acknowledged block hash | `/opt/simulator/data/latestAckBlockHash` | + +## UnorderedStreamConfig + +Uses the prefix `unorderedStream` so all properties should start with `unorderedStream.` + +| Key | Description | Default Value | +|:-------------------------|:-------------------------------------------------------------------------|--------------:| +| `enabled` | Whether to enable the unordered streaming mode | `false` | +| `availableBlocks` | The numbers of the blocks which will be considered available for sending | `[1-10]` | +| `sequenceScrambleLevel` | The coefficient used to randomly scramble the stream | `0` | +| `fixedStreamingSequence` | The numbers of the blocks which will form the steam | `1,2,4,3` | + +## ConsumerConfig + +Uses the prefix `consumer` so all properties should start with `consumer.` + +| Key | Description | Default Value | +|:------------------------|:--------------------------------------------------------------------------------------------------------|----------------:| +| `startBlockNumber` | The block number from which to start consuming | `-1` | +| `endBlockNumber` | The block number at which to stop consuming | `-1` | +| `slowDownType` | The type of slow down to apply while consuming, it can be `NONE`, `FIXED`, `RANDOM`, `RANDOM_WITH_WAIT` | `NONE` | +| `slowDownMilliseconds` | The slowdown in milliseconds | `2` | +| `slowDownForBlockRange` | The range of blocks to apply the slowdown | `10-30` | ## GrpcConfig diff --git a/tools-and-tests/simulator/src/main/java/org/hiero/block/simulator/config/data/BlockGeneratorConfig.java b/tools-and-tests/simulator/src/main/java/org/hiero/block/simulator/config/data/BlockGeneratorConfig.java index 5d2480e5c..a13b74bf8 100644 --- a/tools-and-tests/simulator/src/main/java/org/hiero/block/simulator/config/data/BlockGeneratorConfig.java +++ b/tools-and-tests/simulator/src/main/java/org/hiero/block/simulator/config/data/BlockGeneratorConfig.java @@ -14,6 +14,10 @@ * Defines the configuration for the BlockStreamManager (Generator) of blocks in the Hedera Block Simulator. * * @param generationMode the mode of block generation (e.g., directory-based) + * @param minEventsPerBlock the minimum number of events per block + * @param maxEventsPerBlock the maximum number of events per block + * @param minTransactionsPerEvent the minimum number of transactions per event + * @param maxTransactionsPerEvent the maximum number of transactions per event * @param folderRootPath the root path of the folder containing block files * @param managerImplementation the implementation class name of the block stream manager * @param paddedLength the length to which block identifiers are padded diff --git a/tools-and-tests/simulator/src/main/java/org/hiero/block/simulator/config/data/BlockStreamConfig.java b/tools-and-tests/simulator/src/main/java/org/hiero/block/simulator/config/data/BlockStreamConfig.java index f910d76d1..acae2cdbe 100644 --- a/tools-and-tests/simulator/src/main/java/org/hiero/block/simulator/config/data/BlockStreamConfig.java +++ b/tools-and-tests/simulator/src/main/java/org/hiero/block/simulator/config/data/BlockStreamConfig.java @@ -18,6 +18,8 @@ * @param streamingMode the mode of streaming for the block stream (e.g., time-based, count-based) * @param millisecondsPerBlock the duration in milliseconds for each block when using time-based streaming * @param blockItemsBatchSize the number of block items to stream in each batch + * @param midBlockFailType the type of failure to occur while streaming + * @param midBlockFailOffset the index of the failing block */ @ConfigData("blockStream") public record BlockStreamConfig( diff --git a/tools-and-tests/simulator/src/main/java/org/hiero/block/simulator/config/data/ConsumerConfig.java b/tools-and-tests/simulator/src/main/java/org/hiero/block/simulator/config/data/ConsumerConfig.java index d866ad70d..ebe0cb43b 100644 --- a/tools-and-tests/simulator/src/main/java/org/hiero/block/simulator/config/data/ConsumerConfig.java +++ b/tools-and-tests/simulator/src/main/java/org/hiero/block/simulator/config/data/ConsumerConfig.java @@ -5,6 +5,12 @@ import com.swirlds.config.api.ConfigProperty; import org.hiero.block.simulator.config.logging.Loggable; +/** + * Defines the configuration data for the consumer. + * + * @param startBlockNumber the block number from which to start consuming + * @param endBlockNumber the block number at which to stop consuming + */ @ConfigData("consumer") public record ConsumerConfig( @Loggable @ConfigProperty(defaultValue = "-1") long startBlockNumber, From dd5de75e0673796457a533dedd5a710ecc9f0290 Mon Sep 17 00:00:00 2001 From: Mustafa Uzun Date: Thu, 12 Jun 2025 15:47:01 +0300 Subject: [PATCH 2/7] style: formatting Signed-off-by: Mustafa Uzun --- docs/simulator/configuration.md | 74 ++++++++++++++++----------------- 1 file changed, 37 insertions(+), 37 deletions(-) diff --git a/docs/simulator/configuration.md b/docs/simulator/configuration.md index 2fcdcff64..38d5c053d 100644 --- a/docs/simulator/configuration.md +++ b/docs/simulator/configuration.md @@ -13,46 +13,46 @@ There are 3 configuration sets: Uses the prefix `blockStream` so all properties should start with `blockStream.` -| Key | Description | Default Value | -|:-----------------------------|:------------------------------------------------------------------------------------------------------------------------------------|----------------:| -| `simulatorMode` | The desired simulator mode to use, it can be either `PUBLISHER` or `CONSUMER`. | `PUBLISHER` | -| `lastKnownStatusesCapacity` | The store capacity for the last known statuses. | `10` | -| `delayBetweenBlockItems` | The delay between each block item in nanoseconds, only applicable when streamingMode=CONSTANT_RATE | `1_500_000` | -| `maxBlockItemsToStream` | The maximum number of block items to stream before stopping | `100_000` | -| `streamingMode` | Can either be `CONSTANT_RATE` or `MILLIS_PER_BLOCK` | `CONSTANT_RATE` | -| `millisecondsPerBlock` | If streamingMode is `MILLIS_PER_BLOCK` this will be the time to wait between blocks in milliseconds | `1_000` | -| `blockItemsBatchSize` | The number of block items to send in a single batch, however if a block has less block items, it will send all the items in a block | `1_000` | -| `midBlockFailType` | The type of failure to occur while streaming. It can be `NONE`, `ABRUPT` or `EOS` | `NONE` | -| `midBlockFailOffset` | The index where the failure will occur, only applicable if midBlockFailType is not `NONE` | `0` | +| Key | Description | Default Value | +|:----------------------------|:------------------------------------------------------------------------------------------------------------------------------------|----------------:| +| `simulatorMode` | The desired simulator mode to use, it can be either `PUBLISHER` or `CONSUMER`. | `PUBLISHER` | +| `lastKnownStatusesCapacity` | The store capacity for the last known statuses. | `10` | +| `delayBetweenBlockItems` | The delay between each block item in nanoseconds, only applicable when streamingMode=CONSTANT_RATE | `1_500_000` | +| `maxBlockItemsToStream` | The maximum number of block items to stream before stopping | `100_000` | +| `streamingMode` | Can either be `CONSTANT_RATE` or `MILLIS_PER_BLOCK` | `CONSTANT_RATE` | +| `millisecondsPerBlock` | If streamingMode is `MILLIS_PER_BLOCK` this will be the time to wait between blocks in milliseconds | `1_000` | +| `blockItemsBatchSize` | The number of block items to send in a single batch, however if a block has less block items, it will send all the items in a block | `1_000` | +| `midBlockFailType` | The type of failure to occur while streaming. It can be `NONE`, `ABRUPT` or `EOS` | `NONE` | +| `midBlockFailOffset` | The index where the failure will occur, only applicable if midBlockFailType is not `NONE` | `0` | ## BlockGeneratorConfig Uses the prefix `generator` so all properties should start with `generator.` -| Key | Description | Default Value | -|:--------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---------------------------------:| -| `generationMode` | The desired generation Mode to use, it can only be `DIR` or `CRAFT` | `DIR` | -| `minEventsPerBlock` | The minimum number of events per block | `1` | -| `maxEventsPerBlock` | The maximum number of events per block | `10` | -| `minTransactionsPerEvent` | The minimum number of transactions per event | `1` | -| `maxTransactionsPerEvent` | The maximum number of transactions per event | `10` | -| `folderRootPath` | If the generationMode is `DIR` this will be used as the source of the recording to stream to the Block-Node | `` | -| `managerImplementation` | The desired implementation of the BlockStreamManager to use, it can only be `BlockAsDirBlockStreamManager`, `BlockAsFileBlockStreamManager` or `BlockAsFileLargeDataSets` | `BlockAsFileBlockStreamManager` | -| `paddedLength` | On the `BlockAsFileLargeDataSets` implementation, the length of the padded left zeroes `000001.blk.gz` | `36` | -| `fileExtension` | On the `BlockAsFileLargeDataSets` implementation, the extension of the files to be streamed | `.blk.gz` | -| `startBlockNumber` | The block number to start streaming from | `0` | -| `endBlockNumber` | The block number to stop streaming at | `-1` | -| `invalidBlockHash` | If set to true, will send invalid block root hash | `false` | +| Key | Description | Default Value | +|:--------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------:| +| `generationMode` | The desired generation Mode to use, it can only be `DIR` or `CRAFT` | `DIR` | +| `minEventsPerBlock` | The minimum number of events per block | `1` | +| `maxEventsPerBlock` | The maximum number of events per block | `10` | +| `minTransactionsPerEvent` | The minimum number of transactions per event | `1` | +| `maxTransactionsPerEvent` | The maximum number of transactions per event | `10` | +| `folderRootPath` | If the generationMode is `DIR` this will be used as the source of the recording to stream to the Block-Node | `` | +| `managerImplementation` | The desired implementation of the BlockStreamManager to use, it can only be `BlockAsDirBlockStreamManager`, `BlockAsFileBlockStreamManager` or `BlockAsFileLargeDataSets` | `BlockAsFileBlockStreamManager` | +| `paddedLength` | On the `BlockAsFileLargeDataSets` implementation, the length of the padded left zeroes `000001.blk.gz` | `36` | +| `fileExtension` | On the `BlockAsFileLargeDataSets` implementation, the extension of the files to be streamed | `.blk.gz` | +| `startBlockNumber` | The block number to start streaming from | `0` | +| `endBlockNumber` | The block number to stop streaming at | `-1` | +| `invalidBlockHash` | If set to true, will send invalid block root hash | `false` | ## SimulatorStartupDataConfig Uses the prefix `simulator.startup.data` so all properties should start with `simulator.startup.data.` -| Key | Description | Default Value | -|:---------------------------|:-----------------------------------------------------------------|--------------------------------------------:| -| `enabled` | Whether the startup data functionality is enabled | `false` | -| `latestAckBlockNumberPath` | Path to the file containing the latest acknowledged block number | `/opt/simulator/data/latestAckBlockNumber` | -| `latestAckBlockHashPath` | Path to the file containing the latest acknowledged block hash | `/opt/simulator/data/latestAckBlockHash` | +| Key | Description | Default Value | +|:---------------------------|:-----------------------------------------------------------------|-------------------------------------------:| +| `enabled` | Whether the startup data functionality is enabled | `false` | +| `latestAckBlockNumberPath` | Path to the file containing the latest acknowledged block number | `/opt/simulator/data/latestAckBlockNumber` | +| `latestAckBlockHashPath` | Path to the file containing the latest acknowledged block hash | `/opt/simulator/data/latestAckBlockHash` | ## UnorderedStreamConfig @@ -69,13 +69,13 @@ Uses the prefix `unorderedStream` so all properties should start with `unordered Uses the prefix `consumer` so all properties should start with `consumer.` -| Key | Description | Default Value | -|:------------------------|:--------------------------------------------------------------------------------------------------------|----------------:| -| `startBlockNumber` | The block number from which to start consuming | `-1` | -| `endBlockNumber` | The block number at which to stop consuming | `-1` | -| `slowDownType` | The type of slow down to apply while consuming, it can be `NONE`, `FIXED`, `RANDOM`, `RANDOM_WITH_WAIT` | `NONE` | -| `slowDownMilliseconds` | The slowdown in milliseconds | `2` | -| `slowDownForBlockRange` | The range of blocks to apply the slowdown | `10-30` | +| Key | Description | Default Value | +|:------------------------|:--------------------------------------------------------------------------------------------------------|--------------:| +| `startBlockNumber` | The block number from which to start consuming | `-1` | +| `endBlockNumber` | The block number at which to stop consuming | `-1` | +| `slowDownType` | The type of slow down to apply while consuming, it can be `NONE`, `FIXED`, `RANDOM`, `RANDOM_WITH_WAIT` | `NONE` | +| `slowDownMilliseconds` | The slowdown in milliseconds | `2` | +| `slowDownForBlockRange` | The range of blocks to apply the slowdown | `10-30` | ## GrpcConfig From a0c10c145de4dc3b69196000c0020d101333d147 Mon Sep 17 00:00:00 2001 From: Mustafa Uzun Date: Thu, 12 Jun 2025 16:06:48 +0300 Subject: [PATCH 3/7] docs: refactor Signed-off-by: Mustafa Uzun --- docs/simulator/configuration.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/simulator/configuration.md b/docs/simulator/configuration.md index 38d5c053d..d76fc4cde 100644 --- a/docs/simulator/configuration.md +++ b/docs/simulator/configuration.md @@ -2,10 +2,10 @@ There are 3 configuration sets: 1. [BlockStreamConfig](#blockstreamconfig): contains the configuration for the Block Stream Simulator logic. -1. [BlockGeneratorConfig](#blockGeneratorConfig): contains the configuration for the Block Stream Simulator generation module. +1. [BlockGeneratorConfig](#blockgeneratorconfig): contains the configuration for the Block Stream Simulator generation module. 1. [SimulatorStartupDataConfig](#simulatorstartupdataconfig): contains the configuration for the Block Stream Simulator startup data. 1. [UnorderedStreamConfig](#unorderedstreamconfig): contains the configuration for the Unordered Stream Simulator logic. -1. [ConsumerConfig](#consumerConfig): contains the configuration for the Consumer Simulator logic. +1. [ConsumerConfig](#consumerconfig): contains the configuration for the Consumer Simulator logic. 1. [GrpcConfig](#grpcconfig): contains the configuration for the gRPC communication with the Block-Node. 1. [PrometheusConfig](#prometheusconfig): contains the configuration for the Prometheus. @@ -13,17 +13,17 @@ There are 3 configuration sets: Uses the prefix `blockStream` so all properties should start with `blockStream.` -| Key | Description | Default Value | -|:----------------------------|:------------------------------------------------------------------------------------------------------------------------------------|----------------:| -| `simulatorMode` | The desired simulator mode to use, it can be either `PUBLISHER` or `CONSUMER`. | `PUBLISHER` | -| `lastKnownStatusesCapacity` | The store capacity for the last known statuses. | `10` | -| `delayBetweenBlockItems` | The delay between each block item in nanoseconds, only applicable when streamingMode=CONSTANT_RATE | `1_500_000` | -| `maxBlockItemsToStream` | The maximum number of block items to stream before stopping | `100_000` | -| `streamingMode` | Can either be `CONSTANT_RATE` or `MILLIS_PER_BLOCK` | `CONSTANT_RATE` | -| `millisecondsPerBlock` | If streamingMode is `MILLIS_PER_BLOCK` this will be the time to wait between blocks in milliseconds | `1_000` | -| `blockItemsBatchSize` | The number of block items to send in a single batch, however if a block has less block items, it will send all the items in a block | `1_000` | -| `midBlockFailType` | The type of failure to occur while streaming. It can be `NONE`, `ABRUPT` or `EOS` | `NONE` | -| `midBlockFailOffset` | The index where the failure will occur, only applicable if midBlockFailType is not `NONE` | `0` | +| Key | Description | Default Value | +|:----------------------------|:------------------------------------------------------------------------------------------------------------------------------------|-------------------:| +| `simulatorMode` | The desired simulator mode to use, it can be either `PUBLISHER` or `CONSUMER`. | `PUBLISHER` | +| `lastKnownStatusesCapacity` | The store capacity for the last known statuses. | `10` | +| `delayBetweenBlockItems` | The delay between each block item in nanoseconds, only applicable when streamingMode=CONSTANT_RATE | `1_500_000` | +| `maxBlockItemsToStream` | The maximum number of block items to stream before stopping | `100_000` | +| `streamingMode` | Can either be `CONSTANT_RATE` or `MILLIS_PER_BLOCK` | `MILLIS_PER_BLOCK` | +| `millisecondsPerBlock` | If streamingMode is `MILLIS_PER_BLOCK` this will be the time to wait between blocks in milliseconds | `1_000` | +| `blockItemsBatchSize` | The number of block items to send in a single batch, however if a block has less block items, it will send all the items in a block | `1_000` | +| `midBlockFailType` | The type of failure to occur while streaming. It can be `NONE`, `ABRUPT` or `EOS` | `NONE` | +| `midBlockFailOffset` | The index where the failure will occur, only applicable if midBlockFailType is not `NONE` | `0` | ## BlockGeneratorConfig From b7e2b6a437df310366d7d5b64e36449b51656295 Mon Sep 17 00:00:00 2001 From: Mustafa Uzun Date: Fri, 13 Jun 2025 09:47:27 +0300 Subject: [PATCH 4/7] docs: refactor PR comments Signed-off-by: Mustafa Uzun --- docs/simulator/configuration.md | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/docs/simulator/configuration.md b/docs/simulator/configuration.md index d76fc4cde..0a6d3aa07 100644 --- a/docs/simulator/configuration.md +++ b/docs/simulator/configuration.md @@ -7,7 +7,7 @@ There are 3 configuration sets: 1. [UnorderedStreamConfig](#unorderedstreamconfig): contains the configuration for the Unordered Stream Simulator logic. 1. [ConsumerConfig](#consumerconfig): contains the configuration for the Consumer Simulator logic. 1. [GrpcConfig](#grpcconfig): contains the configuration for the gRPC communication with the Block-Node. -1. [PrometheusConfig](#prometheusconfig): contains the configuration for the Prometheus. +1. [PrometheusConfig](#prometheusconfig): contains the configuration for the Prometheus agent. ## BlockStreamConfig @@ -17,7 +17,7 @@ Uses the prefix `blockStream` so all properties should start with `blockStream.` |:----------------------------|:------------------------------------------------------------------------------------------------------------------------------------|-------------------:| | `simulatorMode` | The desired simulator mode to use, it can be either `PUBLISHER` or `CONSUMER`. | `PUBLISHER` | | `lastKnownStatusesCapacity` | The store capacity for the last known statuses. | `10` | -| `delayBetweenBlockItems` | The delay between each block item in nanoseconds, only applicable when streamingMode=CONSTANT_RATE | `1_500_000` | +| `delayBetweenBlockItems` | The delay between each block item in nanoseconds, only applicable when streamingMode is `CONSTANT_RATE` | `1_500_000` | | `maxBlockItemsToStream` | The maximum number of block items to stream before stopping | `100_000` | | `streamingMode` | Can either be `CONSTANT_RATE` or `MILLIS_PER_BLOCK` | `MILLIS_PER_BLOCK` | | `millisecondsPerBlock` | If streamingMode is `MILLIS_PER_BLOCK` this will be the time to wait between blocks in milliseconds | `1_000` | @@ -29,20 +29,20 @@ Uses the prefix `blockStream` so all properties should start with `blockStream.` Uses the prefix `generator` so all properties should start with `generator.` -| Key | Description | Default Value | -|:--------------------------|:--------------------------------------------------------------------------------------------------------------------------------------------------------------------------|--------------------------------:| -| `generationMode` | The desired generation Mode to use, it can only be `DIR` or `CRAFT` | `DIR` | -| `minEventsPerBlock` | The minimum number of events per block | `1` | -| `maxEventsPerBlock` | The maximum number of events per block | `10` | -| `minTransactionsPerEvent` | The minimum number of transactions per event | `1` | -| `maxTransactionsPerEvent` | The maximum number of transactions per event | `10` | -| `folderRootPath` | If the generationMode is `DIR` this will be used as the source of the recording to stream to the Block-Node | `` | -| `managerImplementation` | The desired implementation of the BlockStreamManager to use, it can only be `BlockAsDirBlockStreamManager`, `BlockAsFileBlockStreamManager` or `BlockAsFileLargeDataSets` | `BlockAsFileBlockStreamManager` | -| `paddedLength` | On the `BlockAsFileLargeDataSets` implementation, the length of the padded left zeroes `000001.blk.gz` | `36` | -| `fileExtension` | On the `BlockAsFileLargeDataSets` implementation, the extension of the files to be streamed | `.blk.gz` | -| `startBlockNumber` | The block number to start streaming from | `0` | -| `endBlockNumber` | The block number to stop streaming at | `-1` | -| `invalidBlockHash` | If set to true, will send invalid block root hash | `false` | +| Key | Description | Default Value | +|:--------------------------|:------------------------------------------------------------------------------------------------------------|--------------------------------:| +| `generationMode` | The desired generation Mode to use, it can only be `DIR` or `CRAFT` | `DIR` | +| `minEventsPerBlock` | The minimum number of events per block | `1` | +| `maxEventsPerBlock` | The maximum number of events per block | `10` | +| `minTransactionsPerEvent` | The minimum number of transactions per event | `1` | +| `maxTransactionsPerEvent` | The maximum number of transactions per event | `10` | +| `folderRootPath` | If the generationMode is `DIR` this will be used as the source of the recording to stream to the Block-Node | `` | +| `managerImplementation` | The desired implementation of the BlockStreamManager to use | `BlockAsFileBlockStreamManager` | +| `paddedLength` | On the `BlockAsFileLargeDataSets` implementation, the length of the padded left zeroes `000001.blk.gz` | `36` | +| `fileExtension` | On the `BlockAsFileLargeDataSets` implementation, the extension of the files to be streamed | `.blk.gz` | +| `startBlockNumber` | The block number to start streaming from | `0` | +| `endBlockNumber` | The block number to stop streaming at | `-1` | +| `invalidBlockHash` | If set to true, will send invalid block root hash | `false` | ## SimulatorStartupDataConfig From d413617d53d2facdb6a7a591012902bca94a9da4 Mon Sep 17 00:00:00 2001 From: Mustafa Uzun Date: Fri, 13 Jun 2025 09:50:54 +0300 Subject: [PATCH 5/7] docs: refactor PR comments Signed-off-by: Mustafa Uzun --- .../org/hiero/block/simulator/config/data/ConsumerConfig.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools-and-tests/simulator/src/main/java/org/hiero/block/simulator/config/data/ConsumerConfig.java b/tools-and-tests/simulator/src/main/java/org/hiero/block/simulator/config/data/ConsumerConfig.java index ebe0cb43b..c7f5b8f54 100644 --- a/tools-and-tests/simulator/src/main/java/org/hiero/block/simulator/config/data/ConsumerConfig.java +++ b/tools-and-tests/simulator/src/main/java/org/hiero/block/simulator/config/data/ConsumerConfig.java @@ -9,7 +9,7 @@ * Defines the configuration data for the consumer. * * @param startBlockNumber the block number from which to start consuming - * @param endBlockNumber the block number at which to stop consuming + * @param endBlockNumber the block number at which to stop consuming */ @ConfigData("consumer") public record ConsumerConfig( From 03d35cdc3544b2848cfca2013c658dbaed70bea6 Mon Sep 17 00:00:00 2001 From: Mustafa Uzun Date: Fri, 13 Jun 2025 09:55:55 +0300 Subject: [PATCH 6/7] docs: enhance consumer config javadoc Signed-off-by: Mustafa Uzun --- .../org/hiero/block/simulator/config/data/ConsumerConfig.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tools-and-tests/simulator/src/main/java/org/hiero/block/simulator/config/data/ConsumerConfig.java b/tools-and-tests/simulator/src/main/java/org/hiero/block/simulator/config/data/ConsumerConfig.java index 6b4fb7ceb..7cc80f6d2 100644 --- a/tools-and-tests/simulator/src/main/java/org/hiero/block/simulator/config/data/ConsumerConfig.java +++ b/tools-and-tests/simulator/src/main/java/org/hiero/block/simulator/config/data/ConsumerConfig.java @@ -11,6 +11,9 @@ * * @param startBlockNumber the block number from which to start consuming * @param endBlockNumber the block number at which to stop consuming + * @param slowDownType the type of slowdown to apply while consuming + * @param slowDownMilliseconds the slowdown in milliseconds + * @param slowDownForBlockRange the range of blocks to apply the slowdown */ @ConfigData("consumer") public record ConsumerConfig( From 574cf42eb3e0b782dc7ac0e865e11e87c61eaa07 Mon Sep 17 00:00:00 2001 From: Mustafa Uzun Date: Fri, 13 Jun 2025 10:05:15 +0300 Subject: [PATCH 7/7] docs: update default values Signed-off-by: Mustafa Uzun --- docs/simulator/configuration.md | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/docs/simulator/configuration.md b/docs/simulator/configuration.md index 0a6d3aa07..bb1e3b5b6 100644 --- a/docs/simulator/configuration.md +++ b/docs/simulator/configuration.md @@ -1,13 +1,12 @@ # Configuration -There are 3 configuration sets: 1. [BlockStreamConfig](#blockstreamconfig): contains the configuration for the Block Stream Simulator logic. -1. [BlockGeneratorConfig](#blockgeneratorconfig): contains the configuration for the Block Stream Simulator generation module. -1. [SimulatorStartupDataConfig](#simulatorstartupdataconfig): contains the configuration for the Block Stream Simulator startup data. -1. [UnorderedStreamConfig](#unorderedstreamconfig): contains the configuration for the Unordered Stream Simulator logic. -1. [ConsumerConfig](#consumerconfig): contains the configuration for the Consumer Simulator logic. -1. [GrpcConfig](#grpcconfig): contains the configuration for the gRPC communication with the Block-Node. -1. [PrometheusConfig](#prometheusconfig): contains the configuration for the Prometheus agent. +2. [BlockGeneratorConfig](#blockgeneratorconfig): contains the configuration for the Block Stream Simulator generation module. +3. [SimulatorStartupDataConfig](#simulatorstartupdataconfig): contains the configuration for the Block Stream Simulator startup data. +4. [UnorderedStreamConfig](#unorderedstreamconfig): contains the configuration for the Unordered Stream Simulator logic. +5. [ConsumerConfig](#consumerconfig): contains the configuration for the Consumer Simulator logic. +6. [GrpcConfig](#grpcconfig): contains the configuration for the gRPC communication with the Block-Node. +7. [PrometheusConfig](#prometheusconfig): contains the configuration for the Prometheus agent. ## BlockStreamConfig @@ -15,7 +14,7 @@ Uses the prefix `blockStream` so all properties should start with `blockStream.` | Key | Description | Default Value | |:----------------------------|:------------------------------------------------------------------------------------------------------------------------------------|-------------------:| -| `simulatorMode` | The desired simulator mode to use, it can be either `PUBLISHER` or `CONSUMER`. | `PUBLISHER` | +| `simulatorMode` | The desired simulator mode to use, it can be either `PUBLISHER_SERVER` or `CONSUMER`. | `PUBLISHER_SERVER` | | `lastKnownStatusesCapacity` | The store capacity for the last known statuses. | `10` | | `delayBetweenBlockItems` | The delay between each block item in nanoseconds, only applicable when streamingMode is `CONSTANT_RATE` | `1_500_000` | | `maxBlockItemsToStream` | The maximum number of block items to stream before stopping | `100_000` | @@ -31,7 +30,7 @@ Uses the prefix `generator` so all properties should start with `generator.` | Key | Description | Default Value | |:--------------------------|:------------------------------------------------------------------------------------------------------------|--------------------------------:| -| `generationMode` | The desired generation Mode to use, it can only be `DIR` or `CRAFT` | `DIR` | +| `generationMode` | The desired generation Mode to use, it can only be `DIR` or `CRAFT` | `CRAFT` | | `minEventsPerBlock` | The minimum number of events per block | `1` | | `maxEventsPerBlock` | The maximum number of events per block | `10` | | `minTransactionsPerEvent` | The minimum number of transactions per event | `1` |