Skip to content

Use app_version_info for cairo_version - #3361

Merged
glihm merged 1 commit into
dojoengine:mainfrom
walnuthq:fix/walnut-verification-cairo-version
Oct 16, 2025
Merged

Use app_version_info for cairo_version#3361
glihm merged 1 commit into
dojoengine:mainfrom
walnuthq:fix/walnut-verification-cairo-version

Conversation

@marijamijailovic

@marijamijailovic marijamijailovic commented Oct 16, 2025

Copy link
Copy Markdown
Contributor

Description

Fixed Cairo version access in Walnut verification by using app_version_info.version instead of direct version field. This ensures proper access to the Cairo version information when verifying classes with Walnut backend.

Related issue

No created issue

Tests

  • Yes
  • [ x] No, because they aren't needed
  • No, because I need help

Added to documentation?

  • README.md
  • Dojo Book
  • [x ] No documentation needed

Checklist

  • I've formatted my code (scripts/rust_fmt.sh, scripts/cairo_fmt.sh)
  • I've linted my code (scripts/clippy.sh, scripts/docs.sh)
  • I've commented my code
  • I've requested a review after addressing the comments

Summary by CodeRabbit

  • Chores
    • Updated how the Cairo version is retrieved and included during the verification process to ensure the version is sourced and represented consistently.

@coderabbitai

coderabbitai Bot commented Oct 16, 2025

Copy link
Copy Markdown
Contributor

Ohayo, sensei! 👋

Walkthrough

Changed the cairo version source in the verification payload from scarb_metadata.version to scarb_metadata.app_version_info.version.clone(), using its string representation in the verification logic. (No other logic or control-flow changes.)

Changes

Cohort / File(s) Summary
Cairo version source update
crates/sozo/walnut/src/verification.rs
Retrieve cairo_version from scarb_metadata.app_version_info.version.clone() and use its string form in the verification payload (replaced scarb_metadata.version).

Sequence Diagram(s)

Not applicable — no new feature or control-flow changes to visualize.

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title clearly states that app_version_info is now used for cairo_version, which accurately captures the primary change of switching the version source in the Walnut verification logic.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0d6853a and 2e574f9.

📒 Files selected for processing (1)
  • crates/sozo/walnut/src/verification.rs (1 hunks)
🔇 Additional comments (3)
crates/sozo/walnut/src/verification.rs (3)

47-48: Ohayo! LGTM on the payload construction.

The usage of .to_string() on the cloned version is appropriate for serializing the Cairo version into the verification payload.


45-45: Ohayo sensei—no remaining instances of scarb_metadata.version found in the codebase.


45-45: Ohayo sensei! The code is type-safe as written.

The direct field access scarb_metadata.app_version_info.version without ? or .unwrap() is only possible if both fields are non-optional. Rust's compiler enforces this—if either app_version_info or version were Option types, the code would fail to compile. Since the code compiles, the type system guarantees these fields exist and are never None. No runtime panic risk exists from optional access.


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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@marijamijailovic
marijamijailovic force-pushed the fix/walnut-verification-cairo-version branch from 0d6853a to 2e574f9 Compare October 16, 2025 14:13
@glihm
glihm merged commit 20e8557 into dojoengine:main Oct 16, 2025
8 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.

2 participants