Skip to content

Commit

Permalink
docs: enhance ConsistencyTestingTool readme (#16841)
Browse files Browse the repository at this point in the history
Signed-off-by: Mustafa Uzun <mustafa.uzun@limechain.tech>
  • Loading branch information
mustafauzunn authored Dec 3, 2024
1 parent 5fb5d52 commit 8e56593
Showing 1 changed file with 67 additions and 0 deletions.
67 changes: 67 additions & 0 deletions platform-sdk/platform-apps/tests/ConsistencyTestingTool/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,70 @@ During operation, when a given round comes to consensus, the tool behaves in the
- If the round coming to consensus already appears in the log:
- the tool checks that the transactions included in the round are the same as the ones already
in the log, in the exact same order

### config.txt

comment out the current app

```
# app, StatsDemo.jar, 1, 3000, 0, 100, -1, 200
```

uncomment the ConsistencyTestingTool.jar

```
app, ConsistencyTestingTool.jar,
```

### settings.txt

Following configurations can be set in the settings.txt file

```
consistencyTestingTool.freezeAfterGenesis, 5s
consistencyTestingTool.logfileDirectory, consistency-example
```

- `freezeAfterGenesis`: The time after which the node will be frozen after genesis block is created.
- `logfileDirectory`: The directory where the consistency log file will be stored.

## Testing Consistency Behavior

### Test Scenario 1: Basic Consistency Check

#### Instructions

1. Delete `sdk/data/saved` directory if it exists
2. Run the app for some time

#### Validation

- Check the `swirlds.log` for any consistency errors or exceptions
- Verify that the consistency log file exists in the configured directory
- Confirm that all transactions are handled exactly once
- Verify transaction ordering remains consistent

### Test Scenario 2: Freeze After Genesis

#### Instructions

1. Delete `sdk/data/saved` directory if it exists
2. Ensure settings.txt has the following values

```
consistencyTestingTool.freezeAfterGenesis, 5s
```

3. Run the node and wait for freeze
4. Stop the node during freeze
5. Restart the node
6. Remove the freezeAfterGenesis setting from settings.txt
7. Verify consistency is maintained

#### Validation

- Check `swirlds.log` for:
- Confirmation that freeze occurred at specified time
- No consistency errors during or after freeze
- Verify all pre-freeze transactions are handled in same order after restart
- Confirm no transactions were lost during the freeze/restart cycle

0 comments on commit 8e56593

Please sign in to comment.