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

feat(blockifier): use same versioned constant as snos #2956

Merged
merged 2 commits into from
Jan 27, 2025

Conversation

kariy
Copy link
Member

@kariy kariy commented Jan 27, 2025

snos is using an older version of blockifier which only supports up to Starknet version v0.13.3 while katana's is up to v0.13.4. So, we pin the version on katana to match snos to make sure the execution outcome is similar.

The call to VersionedConstants::latest_constants() will basically use the latest version ie v0.13.4.

Copy link

coderabbitai bot commented Jan 27, 2025

Walkthrough

Ohayo, sensei! The pull request introduces a new constant SN_VERSION in the Katana executor's blockifier utilities, specifically setting the Starknet version to V0_13_3. This change modifies how versioned constants are retrieved, moving from a generic latest_constants() approach to a more explicit version-specific constant initialization. The modification ensures precise version matching for block context and versioned constants, potentially improving consistency in fee calculations and block processing.

Changes

File Change Summary
crates/katana/executor/src/implementation/blockifier/utils.rs - Added SN_VERSION constant with StarknetVersion::V0_13_3
- Replaced VersionedConstants::latest_constants().clone() with VersionedConstants::get(&SN_VERSION).unwrap().clone()
- Added clarifying comments about version matching

Possibly related PRs

Suggested reviewers

  • glihm

🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @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 generate unit testing code.
    • @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.

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 for this PR. (Beta)
  • @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.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

@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: 0

🧹 Nitpick comments (1)
crates/katana/executor/src/implementation/blockifier/utils.rs (1)

Line range hint 584-584: Consider addressing these TODOs, sensei.

There are several TODOs that might need attention:

  1. Legacy class compiled hash hack needs review
  2. Missing source for ABI length
  3. Gas prices need correct values

Would you like me to help create issues to track these TODOs?

Also applies to: 673-673, 789-789

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 9b722fd and 3872241.

📒 Files selected for processing (1)
  • crates/katana/executor/src/implementation/blockifier/utils.rs (2 hunks)
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: fmt
🔇 Additional comments (2)
crates/katana/executor/src/implementation/blockifier/utils.rs (2)

455-457: Heads up about potential invalid runs, sensei!

The comment warns about potential invalid runs due to overridden values unknown to snos. This is an important operational consideration.

Let's check what values are being overridden:

✅ Verification successful

Ohayo! The warning is valid and important, sensei!

The comment correctly warns about a critical operational concern. The code overrides important execution parameters (recursion depth and step limits) that directly affect transaction processing. Since snos runs independently without knowledge of these overridden values, it could lead to inconsistent behavior where transactions that pass in one environment might fail in another.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Find where these values are used in snos

# Search for max_recursion_depth, validate_max_n_steps, and invoke_tx_max_n_steps
rg -A 5 'max_recursion_depth|validate_max_n_steps|invoke_tx_max_n_steps'

Length of output: 4358


446-454: Ohayo, sensei! Important version pinning change looks good.

The explicit version pinning to V0_13_3 and the detailed comments explaining the rationale are well done. This change ensures consistent fee calculations by matching the version used in snos.

Let's verify the version compatibility with snos:

@kariy kariy changed the title feat(blockifier): use same versioned constant as SNOS feat(blockifier): use same versioned constant as snos Jan 27, 2025
Copy link

codecov bot commented Jan 27, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 56.71%. Comparing base (75dce98) to head (6f51dc0).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2956      +/-   ##
==========================================
+ Coverage   56.69%   56.71%   +0.02%     
==========================================
  Files         420      420              
  Lines       55554    55557       +3     
==========================================
+ Hits        31497    31511      +14     
+ Misses      24057    24046      -11     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

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.

1 participant