Skip to content

Conversation

distractedm1nd
Copy link
Contributor

@distractedm1nd distractedm1nd commented Apr 29, 2025

closes #194

Now just uses SP1_PROVER everywhere. The features no longer exist

Summary by CodeRabbit

  • Refactor

    • Removed the "groth16" and "mock_prover" feature flags from configuration files and build scripts.
    • Unified and simplified prover client logic, always using the environment-based prover.
    • Streamlined build, test, and coverage commands by removing explicit feature flags and using environment variables.
    • Updated epoch management to handle detailed finalized epochs instead of simple numeric values across database implementations.
    • Enhanced epoch storage with validation and atomic updates in persistent storage layers.
    • Introduced a configuration flag to enable or disable recursive proofs based on environment variables.
  • Bug Fixes

    • Enabled unconditional SNARK proof verification in the light client.
    • Added explicit parsing error handling for database operations.
  • Chores

    • Made minor formatting adjustments and cleaned up configuration files.
    • Updated verification keys with new values.

@distractedm1nd distractedm1nd requested a review from smuu April 29, 2025 12:31
Copy link

vercel bot commented Apr 29, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

1 Skipped Deployment
Name Status Preview Comments Updated (UTC)
prism ⬜️ Ignored (Inspect) Visit Preview May 23, 2025 11:58am

Copy link
Contributor

coderabbitai bot commented Apr 29, 2025

## Walkthrough

This change removes the `groth16` and `mock_prover` feature flags from multiple Cargo.toml files and build scripts, unifying the prover implementation to always use `EnvProver` instead of conditionally using `CpuProver` or mock provers. All conditional logic and code paths related to these feature flags are eliminated, and the initialization of prover clients is simplified to use environment-based configuration. The build and test scripts are also updated to no longer reference these features. Additionally, a new `recursive_proofs` boolean config flag is introduced to control recursive proof usage at runtime, set via environment variable `SP1_PROVER`.

## Changes

| File(s)                                                                                           | Change Summary                                                                                                                      |
|-------------------------------------------------------------------------------------------------|-----------------------------------------------------------------------------------------------------------------------------------|
| crates/cli/Cargo.toml<br>crates/node_types/lightclient/Cargo.toml<br>crates/node_types/prover/Cargo.toml<br>crates/tests/Cargo.toml | Removed `groth16` and `mock_prover` feature flags from `[features]` sections and dependency specifications.                      |
| crates/node_types/prover/src/prover/mod.rs                                                      | Replaced all usage of `CpuProver` with `EnvProver`; removed conditional compilation for mock/cpu/groth16; simplified prover logic; added `recursive_proofs` config flag; updated epoch management and proof verification logic. |
| justfile                                                                                        | Removed `--features groth16` and `--features "mock_prover"` from build, test, and coverage recipes.                               |
| .github/workflows/ci.yml                                                                        | Removed `--features mock_prover` from cargo test commands; added `SP1_PROVER=mock` environment variable instead.                  |
| CLAUDE.md                                                                                      | Updated test command example to use `SP1_PROVER=mock` environment variable instead of `--features "mock_prover"`.                  |
| Cargo.toml                                                                                     | Updated zk-related dependencies to version 4.2.0; removed `mock_prover` from workspace features.                                  |
| crates/errors/src/lib.rs                                                                       | Added `ParsingError(String)` variant to `DatabaseError` enum.                                                                       |
| crates/node_types/lightclient/src/lightclient.rs                                              | Removed conditional compilation around `verify_snark_proof`; proof verification now always runs.                                  |
| crates/node_types/prover/src/prover/tests.rs                                                  | Updated tests to use `get_latest_epoch_height()` instead of `get_epoch()` and adjusted expected epoch values accordingly.          |
| crates/storage/Cargo.toml                                                                     | Added `prism-da` as a workspace dependency.                                                                                        |
| crates/storage/src/database.rs                                                                | Replaced simple epoch get/set with detailed epoch management using `FinalizedEpoch`; added methods for latest epoch retrieval.    |
| crates/storage/src/inmemory.rs                                                                | Changed epoch storage from single `u64` to vector of `FinalizedEpoch`; updated methods accordingly with validation.               |
| crates/storage/src/redis.rs                                                                   | Replaced simple epoch get/set with structured `FinalizedEpoch` storage keyed by height; added sequential insertion validation.    |
| crates/storage/src/rocksdb.rs                                                                 | Replaced simple epoch get/set with `FinalizedEpoch` keyed by height; added atomic batch writes and validation for epoch storage.  |
| verification_keys/keys.json                                                                   | Replaced existing base and recursive verification keys with new hexadecimal values.                                               |
| crates/cli/src/main.rs                                                                        | Added `recursive_proofs` boolean config parameter to prover config, set via `SP1_PROVER` environment variable to disable recursive proofs in mock mode. |

## Sequence Diagram(s)

```mermaid
sequenceDiagram
    participant Config
    participant Prover
    participant EnvProver

    Config->>Prover: Initialize (recursive_proofs flag)
    Prover->>EnvProver: ProverClient::from_env()
    Prover->>EnvProver: prove_with_base_prover()/prove_with_recursive_prover()
    EnvProver-->>Prover: Proof result
    Prover-->>Config: Proof output

Assessment against linked issues

Objective Addressed Explanation
Move prover "mock mode" from build flag to config value for both node types (#194)

Possibly related PRs

Poem

In fields of code where features once grew,
The flags are gone—now only a few!
Mock and Groth16, you’ve had your day,
EnvProver leads the unified way.
With configs in charge and builds less complex,
The rabbits rejoice—what’s next?
🐇✨


<!-- walkthrough_end -->


---

<details>
<summary>📜 Recent review details</summary>

**Configuration used: CodeRabbit UI**
**Review profile: CHILL**
**Plan: Pro**


<details>
<summary>📥 Commits</summary>

Reviewing files that changed from the base of the PR and between f4607a76d309615182d86762fb98eb7f4f29043f and 4362d989a4aaf03c58f1937327cfa82ed8959cf6.

</details>

<details>
<summary>📒 Files selected for processing (1)</summary>

* `crates/node_types/prover/src/prover/mod.rs` (16 hunks)

</details>

<details>
<summary>🚧 Files skipped from review as they are similar to previous changes (1)</summary>

* crates/node_types/prover/src/prover/mod.rs

</details>

<details>
<summary>⏰ Context from checks skipped due to timeout of 90000ms (5)</summary>

* GitHub Check: build-and-push-image
* GitHub Check: integration-test
* GitHub Check: unused dependencies
* GitHub Check: clippy
* GitHub Check: unit-test

</details>

</details>
<!-- internal state start -->


<!-- DwQgtGAEAqAWCWBnSTIEMB26CuAXA9mAOYCmGJATmriQCaQDG+Ats2bgFyQAOFk+AIwBWJBrngA3EsgEBPRvlqU0AgfFwA6NPEgQAfACgjoCEYDEZyAAUASpETZWaCrKNwSPbABsvkCiQBHbGlcSHFcLzpIACIAMxJqLn9mfClIIgp8XFgARgA2dAx6FIYAawB9XlTKSHjqbH9EABo/Em4vNAYouUgAZSsc8tsAeQA1AFE7MglICWdoyAB3NGQHAWZ1Gnoe7I9sRBraJFwqMTpmHKL0ZG5vX38gkMgMRwEagGYABgAWDRhYDwMWCYUjIeBYbKoWyMLz4A4oRAODxmHIATl+/w8zG0WGw3Fo1A84Ik+C8UmQyVS4KIYQBPH8Eng+H2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Lo60wkDSKCUSMyF8IO0KFTQBQNt4QKH9GUiBTjBZhuAXoIEZ4jwA3gFAMy6DJI7uRKk9RJkOZbUT+0coFy7qLb3o4QgThFlITrdH2SpU3WN1Zi4tJ+k7tL228biwWoMZ8XsjAl9c0JfN0yDrGzBjiDhDrCKYiIIEBSxRFpRUQaIeghiChCYhqAWIWEdiAYFqs4FygKcTtP+jHAdcB+aiNiDVd/DoABAU3AQHkBIDvA8gAAVhIBzW8gAgWIJU0WsAB2NAJUym5TcVraAXa3kE+BoAVrnwEgFN3eC3XOgOQLUNhBmvrWcgu1gcO8ByC0BdrSgXa58Hes3WTr/1x628DWtHXKmdAWgJUxWtnXaAd0Z6xAwYBvBvgrfNALEEev7Wkbu1qbpUzhsrXYg51xa2gHeC7XUQRsd4JUzuuohPg8QX+gjagDvA0AeQea4kMet5A0AOQBgJ9byCxApu3wVEAIG+DM3vgx1nIO8AFsrW8geQN60Dbpt9XarOQIWytclsnW8gDANW98EVsEhHr6WFa3NbRBw2BAtAO65U2+ACAtbPNqa/1ZmsCAGAlTSpm9cqY/XYg3wEgN8EkwkBFrqINAOWCls/AcgU3AWzkAECVMQ7qIXawIAPT03IA4t9EF8EqZoASANNqbhzfeDvABAZNhILtdiCx2Q7AgRm58HVvqhUQdAKO/LZmsrWbjogNAP9c2vK2vgA4bG58AEArXw7OQf298AYAi3cb6tuGwwFRBW3arLt86/tdhtfBUQ0tlawHdxtTc8gZ1yprEAztTd1r2dlG5U2pvfB3gT18uxA03t5BcbqIQO2gG+A+3Ygnwd4AwBWtTd0bqIEmxTfevywcbdAQO63ZU4FBvw1txG3YXUBDWFa9mJ+mNd71XB9AQAA -->

<!-- internal state end -->
<!-- finishing_touch_checkbox_start -->

<details open="true">
<summary>✨ Finishing Touches</summary>

- [ ] <!-- {"checkboxId": "7962f53c-55bc-4827-bfbf-6a18da830691"} --> 📝 Generate Docstrings

</details>

<!-- finishing_touch_checkbox_end -->
<!-- tips_start -->

---

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

<details>
<summary>❤️ Share</summary>

- [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai)
- [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai)
- [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai)
- [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)

</details>

<details>
<summary>🪧 Tips</summary>

### Chat

There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai?utm_source=oss&utm_medium=github&utm_campaign=deltadevsde/prism&utm_content=304):

- Review comments: Directly reply to a review comment made by CodeRabbit. Example:
  - `I pushed a fix in commit <commit_id>, please review it.`
  - `Explain this complex logic.`
  - `Open a follow-up GitHub issue for this discussion.`
- Files and specific lines of code (under the "Files changed" tab): Tag `@coderabbitai` in a new review comment at the desired location with your query. Examples:
  - `@coderabbitai explain this code block.`
  -	`@coderabbitai modularize this function.`
- PR comments: Tag `@coderabbitai` in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
  - `@coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.`
  - `@coderabbitai read src/utils.ts and explain its main purpose.`
  - `@coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.`
  - `@coderabbitai help me debug CodeRabbit configuration file.`

### Support

Need help? Create a ticket on our [support page](https://www.coderabbit.ai/contact-us/support) for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

### CodeRabbit Commands (Invoked using PR comments)

- `@coderabbitai pause` to pause the reviews on a PR.
- `@coderabbitai resume` to resume the paused reviews.
- `@coderabbitai review` to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
- `@coderabbitai full review` to do a full review from scratch and review all the files again.
- `@coderabbitai summary` to regenerate the summary of the PR.
- `@coderabbitai generate docstrings` to [generate docstrings](https://docs.coderabbit.ai/finishing-touches/docstrings) for this PR.
- `@coderabbitai generate sequence diagram` to generate a sequence diagram of the changes in this PR.
- `@coderabbitai resolve` resolve all the CodeRabbit review comments.
- `@coderabbitai configuration` to show the current CodeRabbit configuration for the repository.
- `@coderabbitai help` to get help.

### Other keywords and placeholders

- Add `@coderabbitai ignore` anywhere in the PR description to prevent this PR from being reviewed.
- Add `@coderabbitai summary` to generate the high-level summary at a specific location in the PR description.
- Add `@coderabbitai` anywhere in the PR title to generate the title automatically.

### CodeRabbit Configuration File (`.coderabbit.yaml`)

- You can programmatically configure CodeRabbit by adding a `.coderabbit.yaml` file to the root of your repository.
- Please see the [configuration documentation](https://docs.coderabbit.ai/guides/configure-coderabbit) for more information.
- If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: `# yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json`

### Documentation and Community

- Visit our [Documentation](https://docs.coderabbit.ai) for detailed information on how to use CodeRabbit.
- Join our [Discord Community](http://discord.gg/coderabbit) to get help, request features, and share feedback.
- Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.

</details>

<!-- tips_end -->

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
crates/node_types/prover/src/prover/mod.rs (1)

527-527: Update outdated comment

The comment still mentions mock prover which is no longer part of the implementation after this PR.

-        // we use the base prover for the first epoch and always for mock prover because recursive verification is not really supported at the moment
+        // we use the base prover for the first epoch and the recursive prover for all subsequent epochs
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between abc438a and ab8b6e3.

📒 Files selected for processing (6)
  • crates/cli/Cargo.toml (1 hunks)
  • crates/node_types/lightclient/Cargo.toml (2 hunks)
  • crates/node_types/prover/Cargo.toml (0 hunks)
  • crates/node_types/prover/src/prover/mod.rs (6 hunks)
  • crates/tests/Cargo.toml (1 hunks)
  • justfile (3 hunks)
💤 Files with no reviewable changes (1)
  • crates/node_types/prover/Cargo.toml
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: clippy
  • GitHub Check: build-and-push-image
  • GitHub Check: Analyze (javascript-typescript)
🔇 Additional comments (14)
crates/cli/Cargo.toml (1)

13-16: Successful removal of groth16 and mock_prover features

The removal of the groth16 and mock_prover features from the [features] section is consistent with the PR objective of replacing these features with the SP1_PROVER environment variable.

crates/node_types/lightclient/Cargo.toml (2)

9-12: Successful removal of groth16 and mock_prover features

The removal of the groth16 and mock_prover features from the [features] section aligns with the PR objective of replacing these features with the SP1_PROVER environment variable.


24-24: Minor formatting improvement

Added a space inside the braces for better code style consistency.

justfile (3)

90-91: Successful removal of groth16 feature flag from build command

Removing the --features groth16 flag from the build command aligns with the PR objective of replacing feature flags with the SP1_PROVER environment variable.


111-112: Successfully replaced mock_prover feature with SP1_PROVER env var

The unit-test recipe now uses SP1_PROVER=mock instead of the --features "mock_prover" flag, which aligns with the PR objective.


121-122: Successfully replaced mock_prover feature with SP1_PROVER env var in coverage command

The coverage command now uses SP1_PROVER=mock instead of --features "mock_prover", but retains an empty --features flag. This appears to be a successful migration to the environment variable approach.

crates/tests/Cargo.toml (2)

20-20: Successfully removed mock_prover feature from prism-prover dependency

The mock_prover feature has been successfully removed from the prism-prover dependency, which aligns with the PR objective.


22-22:

✅ Verification successful

Verify if mock_prover feature should still be used for prism-lightclient

While the PR objective is to remove the groth16 and mock_prover features and replace them with the SP1_PROVER environment variable, the prism-lightclient dependency still includes the mock_prover feature. Please verify if this is intentional or if it was overlooked.


🏁 Script executed:

#!/bin/bash
# Check if mock_prover feature is defined in prism-lightclient
grep -r "mock_prover" --include="*.rs" --include="*.toml" ./crates/node_types/lightclient/

Length of output: 516


Mock_prover feature is still required in tests
The lightclient crate’s src/lightclient.rs uses #[cfg(feature = "mock_prover")] (and its inverse) to gate proof‐verification logic. Enabling mock_prover in crates/tests/Cargo.toml is therefore intentional so the tests compile against the code’s current conditional branches.

crates/node_types/prover/src/prover/mod.rs (6)

36-37: Clean import list replacement

The import list has been updated to remove specialized provers, keeping only the EnvProver and necessary related imports. This aligns with the PR objective of removing the groth16 and mock_prover feature flags.


123-123: Appropriate type replacement from CpuProver to EnvProver

Both the base and recursive prover clients have been updated to use EnvProver instead of likely CpuProver before. This unified approach allows prover configuration to be controlled through environment variables rather than compile-time features.

Also applies to: 127-127


151-152: Simplified prover client initialization

The prover client initialization has been simplified to use ProverClient::from_env() for both base and recursive provers, removing any conditional logic that was likely present before. This is a cleaner approach that relies on runtime configuration.


442-442: Updated return types for prove_with functions

The return types for both prove_with_base_prover and prove_with_recursive_prover functions have been correctly updated to return read guards for EnvProver instead of the previous type.

Also applies to: 473-473


528-532: Simplified prover selection logic

The logic for selecting between base and recursive prover has been greatly simplified to only check the epoch height, removing conditional branches that were likely based on feature flags. This makes the code more readable and maintainable.


451-451:

✅ Verification successful

Unconditional use of Groth16 proving

The method now always invokes Groth16 proving without conditional compilation, which is consistent with the removal of feature flags. Ensure this behavior works correctly under all expected environment configurations.


🏁 Script executed:

#!/bin/bash
# Check if there are any remaining references to removed features in the codebase
echo "Checking for remaining references to removed features..."
rg -i "groth16" --type rust
rg -i "mock_prover" --type rust

Length of output: 4908


Unconditional Groth16 proving confirmed
All groth16 feature flags have been removed and both prover methods now invoke Groth16 unconditionally across the codebase (verified via rg -i groth16). Please ensure your full test suite—including any environment-specific tests—passes to validate this behavior under all expected configurations.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 4

🔭 Outside diff range comments (1)
crates/errors/src/lib.rs (1)

23-25: 🛠️ Refactor suggestion

Duplicate “ParsingError” variants can confuse error-handling paths

GeneralError::ParsingError and the newly-added DatabaseError::ParsingError both convey the same failure mode. Having two variants with almost identical semantics:

  • forces callers to choose “the right parsing error”,
  • complicates pattern-matching (match arms are duplicated),
  • makes conversion logic (From<…>) harder to maintain.

Unless you intentionally need to distinguish where the parsing failed (general code vs. DB back-end), prefer re-using the existing GeneralError::ParsingError through the existing DatabaseError::GeneralError(…) wrapper.

-    #[error("parsing error: {0}")]
-    ParsingError(String),
+    // Remove this variant and rely on the existing
+    //   DatabaseError::GeneralError(GeneralError::ParsingError(_))
+    // mapping.

If keeping both variants is required, add clear doc-comments that describe the difference and audit all match blocks to ensure both cases are handled.

Also applies to: 63-64

🧹 Nitpick comments (6)
.github/workflows/ci.yml (2)

22-22: Use GitHub Actions env mapping for SP1_PROVER
To improve readability and follow GH Actions best practices, declare SP1_PROVER in an env block instead of inline:

       - name: Run non-integration tests
-        run: SP1_PROVER=mock cargo test --lib --release -- --skip test_light_client_prover_talking
+        env:
+          SP1_PROVER: mock
+        run: cargo test --lib --release -- --skip test_light_client_prover_talking

92-92: Use a dedicated env section for SP1_PROVER
Similarly, for the integration-test step, extract the environment variable into its own env section for consistency:

      - name: Run integration tests
-        run: SP1_PROVER=mock cargo test -p prism-tests --lib --release
+        env:
+          SP1_PROVER: mock
+        run: cargo test -p prism-tests --lib --release
crates/storage/src/inmemory.rs (1)

128-135: get_latest_epoch_height panics on empty DB – consider returning NotFound without special-casing

Good to see an explicit error, but downstream callers frequently unwrap; providing Option<u64> (or a bespoke DatabaseError::NotFoundError) would clarify intent and remove the magic -1 logic.

crates/node_types/prover/src/prover/tests.rs (2)

158-167: Avoid double unwrap() and improve readability

The current predicate calls unwrap() right after is_ok(), consuming the Result and risking a panic if code is later refactored. A pattern-match is safer and clearer:

-        let epoch = prover2.clone().db.get_latest_epoch_height();
-        if epoch.is_ok() && epoch.unwrap() == 3 {
+        if matches!(prover2.clone().db.get_latest_epoch_height(), Ok(3)) {

200-206: Same minor simplification applies here

-    let epoch = prover2.clone().db.get_latest_epoch_height().unwrap();
-    assert_eq!(epoch, 3);
+    assert_eq!(
+        prover2.clone().db.get_latest_epoch_height().expect("no epoch present"),
+        3
+    );
crates/storage/src/rocksdb.rs (1)

111-117: Avoid lossy u64 → usize casts when comparing heights

usize is 32-bit on some targets; casting a large u64 epoch height can truncate the value and pass the sequential-height check even though the numbers differ.
Keep everything in u64:

-if latest as usize + 1 != epoch.height as usize {
+if latest + 1 != epoch.height {
📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between ab8b6e3 and eb17ca3.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (15)
  • .github/workflows/ci.yml (2 hunks)
  • CLAUDE.md (2 hunks)
  • Cargo.toml (1 hunks)
  • crates/errors/src/lib.rs (1 hunks)
  • crates/node_types/lightclient/src/lightclient.rs (0 hunks)
  • crates/node_types/prover/src/prover/mod.rs (16 hunks)
  • crates/node_types/prover/src/prover/tests.rs (2 hunks)
  • crates/storage/Cargo.toml (1 hunks)
  • crates/storage/src/database.rs (2 hunks)
  • crates/storage/src/inmemory.rs (5 hunks)
  • crates/storage/src/redis.rs (3 hunks)
  • crates/storage/src/rocksdb.rs (2 hunks)
  • crates/tests/Cargo.toml (1 hunks)
  • justfile (4 hunks)
  • verification_keys/keys.json (1 hunks)
💤 Files with no reviewable changes (1)
  • crates/node_types/lightclient/src/lightclient.rs
✅ Files skipped from review due to trivial changes (4)
  • crates/storage/Cargo.toml
  • verification_keys/keys.json
  • CLAUDE.md
  • Cargo.toml
🚧 Files skipped from review as they are similar to previous changes (2)
  • justfile
  • crates/tests/Cargo.toml
🧰 Additional context used
🧬 Code Graph Analysis (2)
crates/storage/src/inmemory.rs (3)
crates/storage/src/redis.rs (5)
  • new (48-72)
  • get_epoch (199-211)
  • add_epoch (213-250)
  • get_latest_epoch_height (252-256)
  • get_latest_epoch (258-261)
crates/storage/src/rocksdb.rs (6)
  • new (31-35)
  • new (45-53)
  • get_epoch (91-104)
  • add_epoch (106-144)
  • get_latest_epoch_height (146-155)
  • get_latest_epoch (157-160)
crates/storage/src/database.rs (4)
  • get_epoch (21-21)
  • add_epoch (22-22)
  • get_latest_epoch_height (24-24)
  • get_latest_epoch (25-25)
crates/storage/src/rocksdb.rs (4)
crates/storage/src/inmemory.rs (4)
  • get_epoch (106-112)
  • add_epoch (114-126)
  • get_latest_epoch_height (128-134)
  • get_latest_epoch (136-139)
crates/storage/src/database.rs (4)
  • get_epoch (21-21)
  • add_epoch (22-22)
  • get_latest_epoch_height (24-24)
  • get_latest_epoch (25-25)
crates/storage/src/redis.rs (4)
  • get_epoch (199-211)
  • add_epoch (213-250)
  • get_latest_epoch_height (252-256)
  • get_latest_epoch (258-261)
crates/serde/src/binary.rs (2)
  • decode_from_bytes (24-24)
  • decode_from_bytes (32-34)
🔇 Additional comments (5)
crates/storage/src/database.rs (1)

21-26:

✅ Verification successful

Trait additions look good, but scan the codebase for stale set_epoch calls

The old set_epoch() API has been removed in favour of add_epoch() and richer getters. To avoid build breaks, ensure no crates still invoke the obsolete method.

If the search returns anything, migrate those sites to add_epoch().


🏁 Script executed:

#!/bin/bash
# grep for lingering `set_epoch(` calls
rg -n $'\\.set_epoch\\('

Length of output: 23


🏁 Script executed:

#!/bin/bash
# Search for any lingering `set_epoch(` calls anywhere in the codebase
rg -n 'set_epoch\s*\('

Length of output: 24


No stale set_epoch() calls found
I ran rg -n 'set_epoch\s*\(' across the repo and confirmed there are no remaining usages of the old API. The removal of set_epoch() won’t introduce any build breaks.

crates/storage/src/inmemory.rs (2)

154-155: flush_database clears epochs but leaves sync_height untouched

After a full flush, sync_height likely no longer reflects reality. Reset it to 0 (or 1 if height is one-based) to keep internal state consistent.


106-111: ⚠️ Potential issue

Indexing with usize may overflow for large epoch heights

epochs.get(*height as usize) and the subsequent cast implicitly assume every u64 height fits into usize. On 32-bit targets, heights ≥ 2³² will panic.

-        match epochs.get(*height as usize) {
+        if *height > usize::MAX as u64 {
+            return Err(DatabaseError::ReadError(format!(
+                "epoch height {} exceeds addressable memory", height
+            ))
+            .into());
+        }
+        match epochs.get(*height as usize) {

Similar as usize casts appear in add_epoch; consider replacing them with an explicit expected_height computed in u64 and compared without casting.

Likely an incorrect or invalid review comment.

crates/storage/src/rocksdb.rs (1)

107-124: Don’t silently swallow database errors when checking the latest epoch height

get_latest_epoch_height().ok() converts any error – including I/O or data-corruption errors – into None, treating them the same as “no height stored yet”.
That makes genuine corruption or permission issues indistinguishable from the clean bootstrap case and can cause hard-to-diagnose bugs later on.

-let latest_height = self.get_latest_epoch_height().ok();
+let latest_height = match self.get_latest_epoch_height() {
+    Ok(h) => Some(h),
+    Err(e) => {
+        // Only ignore the “not found” bootstrap case.
+        if e.downcast_ref::<DatabaseError>()
+            .is_some_and(|de| matches!(de, DatabaseError::NotFoundError(_)))
+        {
+            None
+        } else {
+            return Err(e);
+        }
+    }
+};

[ suggest_essential_refactor ]

crates/node_types/prover/src/prover/mod.rs (1)

143-149: Verify whether saved_epoch = latest + 1 is correct – potential off-by-one

KeyDirectoryTree::load(db, saved_epoch) is fed latest_epoch_height + 1.
If the tree’s version equals the last finalized epoch height (rather than “next height to be produced”), this will load a non-existent version and may corrupt state.

Please double-check the expected semantics of KeyDirectoryTree::load.
If the tree is versioned by epoch height, you likely want:

-let saved_epoch = match db.get_latest_epoch_height() {
-    Ok(height) => height,
+let saved_epoch = match db.get_latest_epoch_height() {
+    Ok(height) => height,

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🔭 Outside diff range comments (1)
crates/storage/src/rocksdb.rs (1)

1-312: 🛠️ Refactor suggestion

Missing tests for new epoch-related methods

While the code implements the Database trait methods correctly, there are no tests for the new epoch-related methods (get_epoch, add_epoch, get_latest_epoch_height, get_latest_epoch).

Consider adding tests similar to the existing ones for other methods. This is especially important since these methods handle critical data and have validation logic that should be verified.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
Cache: Disabled due to data retention organization setting
Knowledge Base: Disabled due to data retention organization setting

📥 Commits

Reviewing files that changed from the base of the PR and between cbe4ffa and 3a68b64.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (19)
  • .github/workflows/ci.yml (2 hunks)
  • CLAUDE.md (2 hunks)
  • Cargo.toml (1 hunks)
  • crates/cli/Cargo.toml (1 hunks)
  • crates/cli/src/main.rs (5 hunks)
  • crates/errors/src/lib.rs (1 hunks)
  • crates/node_types/lightclient/Cargo.toml (2 hunks)
  • crates/node_types/lightclient/src/lightclient.rs (0 hunks)
  • crates/node_types/prover/Cargo.toml (0 hunks)
  • crates/node_types/prover/src/prover/mod.rs (17 hunks)
  • crates/node_types/prover/src/prover/tests.rs (2 hunks)
  • crates/storage/Cargo.toml (1 hunks)
  • crates/storage/src/database.rs (2 hunks)
  • crates/storage/src/inmemory.rs (5 hunks)
  • crates/storage/src/redis.rs (3 hunks)
  • crates/storage/src/rocksdb.rs (2 hunks)
  • crates/tests/Cargo.toml (1 hunks)
  • justfile (4 hunks)
  • verification_keys/keys.json (1 hunks)
💤 Files with no reviewable changes (2)
  • crates/node_types/prover/Cargo.toml
  • crates/node_types/lightclient/src/lightclient.rs
✅ Files skipped from review due to trivial changes (1)
  • justfile
🚧 Files skipped from review as they are similar to previous changes (15)
  • crates/storage/Cargo.toml
  • crates/tests/Cargo.toml
  • crates/node_types/prover/src/prover/tests.rs
  • Cargo.toml
  • verification_keys/keys.json
  • crates/node_types/lightclient/Cargo.toml
  • CLAUDE.md
  • crates/cli/Cargo.toml
  • crates/errors/src/lib.rs
  • crates/cli/src/main.rs
  • .github/workflows/ci.yml
  • crates/storage/src/database.rs
  • crates/storage/src/redis.rs
  • crates/storage/src/inmemory.rs
  • crates/node_types/prover/src/prover/mod.rs
🧰 Additional context used
🧬 Code Graph Analysis (1)
crates/storage/src/rocksdb.rs (4)
crates/storage/src/database.rs (4)
  • get_epoch (21-21)
  • add_epoch (22-22)
  • get_latest_epoch_height (24-24)
  • get_latest_epoch (25-25)
crates/storage/src/inmemory.rs (4)
  • get_epoch (106-112)
  • add_epoch (114-126)
  • get_latest_epoch_height (128-134)
  • get_latest_epoch (136-139)
crates/storage/src/redis.rs (4)
  • get_epoch (199-211)
  • add_epoch (213-250)
  • get_latest_epoch_height (252-256)
  • get_latest_epoch (258-261)
crates/serde/src/binary.rs (2)
  • decode_from_bytes (24-24)
  • decode_from_bytes (32-34)
⏰ Context from checks skipped due to timeout of 90000ms (4)
  • GitHub Check: unused dependencies
  • GitHub Check: unit-test
  • GitHub Check: integration-test
  • GitHub Check: build-and-push-image
🔇 Additional comments (6)
crates/storage/src/rocksdb.rs (6)

4-4: Import addition and organization looks good

The addition of anyhow::{Result, anyhow} matches its usage throughout the file for error handling and creating detailed error messages.


15-15: Import refinement for RocksDB types looks good

Explicitly importing the RocksDB types (DB, DBWithThreadMode, MultiThreaded, Options) improves code clarity.


21-21: Added constant for epoch storage

The new key prefix constant follows the established naming convention for other key prefixes in the file.


91-104: Solid implementation of get_epoch method

The method correctly retrieves and deserializes a FinalizedEpoch by its height, with appropriate error handling for both missing records and deserialization failures. This implementation aligns well with the similar implementations in inmemory.rs and redis.rs.


146-155: Appropriate implementation of get_latest_epoch_height

The method properly retrieves the latest epoch height from the database with appropriate error handling.


157-160: Clean implementation of get_latest_epoch

This method efficiently combines get_latest_epoch_height and get_epoch to retrieve the most recent epoch.

@distractedm1nd distractedm1nd merged commit 20fc82b into main May 23, 2025
9 of 10 checks passed
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.

feat(prover): allow prover in mock mode after build
2 participants