Skip to content

Commit 97aec3f

Browse files
authored
Support longer state_hash_tree.state_version_history_length (#1063)
## Summary Whilst we advise against large values for `state_hash_tree.state_version_history_length`, it appears the node doesn't even support values larger than Java's max int. This was an oversight, as the next line tries to cast it to a long. This PR fixes this oversight, avoiding this error for any configured value between `2,147,483,647` and `9,223,372,036,854,775,807`: ```txt Caused by: java.lang.IllegalArgumentException: There was an error when parsing configuration 'state_hash_tree.state_version_history_length' with value 'xxxxxxxxxxxx'. ``` ## Testing Existing tests pass ## Changelog The changelog has been updated.
2 parents ed0ada2 + 08781bf commit 97aec3f

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

CHANGELOG.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,10 +62,16 @@
6262

6363
# v1.3.x - [Cuttlefish](https://docs.radixdlt.com/docs/cuttlefish)
6464

65+
## v1.3.1
66+
67+
### Other changes
68+
69+
* [#1063](https://github.com/radixdlt/babylon-node/pull/1063) - Permits configuring larger values of `state_hash_tree.state_version_history_length` up to `9,223,372,036,854,775,807`, although we currently advise against running with full history; due to very large disk usage.
70+
6571
## v1.3.0
6672

6773
We didn't have a formal changelog. Please see the [protocol updates](https://docs.radixdlt.com/docs/protocol-updates) section of the docs site for more information.
6874

6975
# v1.2.x - [Bottlenose](https://docs.radixdlt.com/docs/bottlenose) and before
7076

71-
We didn't have a formal changelog. Please see the [protocol updates](https://docs.radixdlt.com/docs/protocol-updates) section of the docs site for more information.
77+
We didn't have a formal changelog. Please see the [protocol updates](https://docs.radixdlt.com/docs/protocol-updates) section of the docs site for more information.

core/src/main/java/com/radixdlt/RadixNodeModule.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ private StateTreeGcConfig parseStateTreeGcConfig(RuntimeProperties properties) {
475475
// - we want to offer Merkle proofs verification up to 10 minutes after their generation.
476476
// Note: the legacy `state_hash_tree` name lives on here to avoid breaking configurations.
477477
var stateVersionHistoryLength =
478-
properties.get("state_hash_tree.state_version_history_length", 60000);
478+
properties.get("state_hash_tree.state_version_history_length", 60000L);
479479
Preconditions.checkArgument(
480480
stateVersionHistoryLength >= 0,
481481
"state version history length must not be negative: %s",

0 commit comments

Comments
 (0)