Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tide up state pruner validation #8459

Merged

Conversation

gfukushima
Copy link
Contributor

@gfukushima gfukushima commented Jul 22, 2024

PR Description

Removes the value "0" from the possible range of retained slots. Adds validation to prevent state pruner to be created when the database version is on leveldb tree.
We already have a validation at the storage configuration level that checks for the frequency (which is ultimately how leveldb tree gets set) but if we change the frequency and leveldb tree is still used. We don't want to support that at the moment.

Fixed Issue(s)

Part of #8449

Documentation

  • I thought about documentation and added the doc-change-required label to this PR if updates are required.

Changelog

  • I thought about adding a changelog entry, and added one if I deemed necessary.

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

The pull request focuses on refining the state pruner validation logic to enhance robustness and prevent issues with unsupported database versions.

  • Removed 0 from retained slots range: Ensures state pruning logic in services/chainstorage/src/main/java/tech/pegasys/teku/services/chainstorage/StorageService.java is valid.
  • Validation for LEVELDB_TREE: Prevents state pruner creation when the database version is LEVELDB_TREE in StorageService.java.
  • Updated default value for DEFAULT_STORAGE_RETAINED_SLOTS: Changed from -1 to 0 in storage/src/main/java/tech/pegasys/teku/storage/server/StorageConfiguration.java.
  • Validation logic update: Ensures retainedSlots cannot be less than 0 in StorageConfiguration.java.

2 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

(updates since last review)

Enhanced state pruner validation to prevent unsupported configurations and ensure robustness.

  • Validation for LEVELDB_TREE: Added check in services/chainstorage/src/main/java/tech/pegasys/teku/services/chainstorage/StorageService.java to throw InvalidConfigurationException if state pruner is enabled with LEVELDB_TREE.
  • Test enhancements: Updated storage/src/test/java/tech/pegasys/teku/storage/server/StorageConfigurationTest.java to include tests ensuring state pruner cannot be enabled with tree mode storage.
  • Removed 0 from retained slots range: Ensures valid state pruning configurations in StorageService.java.

2 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

Copy link

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR Summary

(updates since last review)

Enhanced state pruner validation to prevent unsupported configurations and ensure robustness.

  • Validation for LEVELDB_TREE: Added check in services/chainstorage/src/main/java/tech/pegasys/teku/services/chainstorage/StorageService.java to throw InvalidConfigurationException if state pruner is enabled with LEVELDB_TREE.
  • Test enhancements: Updated storage/src/test/java/tech/pegasys/teku/storage/server/StorageConfigurationTest.java to include tests ensuring state pruner cannot be enabled with tree mode storage.
  • Removed 0 from retained slots range: Ensures valid state pruning configurations in StorageService.java.

No major changes found since last review.

11 file(s) reviewed, no comment(s)
Edit PR Review Bot Settings

@gfukushima gfukushima enabled auto-merge (squash) July 24, 2024 01:12
@gfukushima gfukushima merged commit 56a746b into Consensys:master Jul 24, 2024
16 checks passed
@gfukushima gfukushima deleted the tide-up-statepruner-validation branch July 24, 2024 02:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants