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: bump to cairo 2.9.2 #2879

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open

feat: bump to cairo 2.9.2 #2879

wants to merge 20 commits into from

Conversation

glihm
Copy link
Collaborator

@glihm glihm commented Jan 8, 2025

New blockifier and starknet_api rev: 92da150d.

Summary by CodeRabbit

Release Notes

  • Dependency Updates

    • Upgraded Cairo version from 2.8.4 to 2.9.2
    • Updated StarkNet framework dependencies
    • Upgraded Rust toolchain to version 1.81.0
  • Code Improvements

    • Enhanced code formatting and syntax consistency
    • Added optional diagnostic note fields in various plugin structures
    • Refined transaction and execution handling in blockifier utilities
  • Performance and Compatibility

    • Improved gas price handling
    • Updated contract class and entry point representations
    • Refined state management and contract execution
  • Testing and Validation

    • Expanded test coverage for contract interactions
    • Updated test utilities and configuration

@glihm glihm mentioned this pull request Jan 8, 2025
Copy link

coderabbitai bot commented Jan 8, 2025

Walkthrough

Ohayo, sensei! This pull request represents a comprehensive upgrade across the Dojo ecosystem, primarily focusing on version bumps from Cairo 2.8.4 to 2.9.2. The changes span multiple components including core libraries, language plugins, executors, and example projects. The upgrade involves updating dependency versions, refining type handling, and making minor syntactical improvements across the codebase.

Changes

File/Path Change Summary
.github/workflows/ci.yml Updated scarb version from 2.8.4 to 2.9.1
.tool-versions Updated scarb version from 2.8.4 to 2.9.2
Cargo.toml Updated numerous cairo-lang dependencies to version 2.9.2, updated git revisions for scarb and scarb-ui
rust-toolchain.toml Upgraded Rust toolchain from 1.80.0 to 1.81.0
Various Scarb.toml files Updated Cairo and StarkNet dependency versions to 2.9.2
Language Plugins Added diagnostics_note field to various plugin-generated file structures
Executor Components Refined transaction and class handling, updated gas price management

Sequence Diagram

sequenceDiagram
    participant Dev as Developer
    participant CI as CI Workflow
    participant Scarb as Scarb Build Tool
    participant Cairo as Cairo Compiler
    participant Dojo as Dojo Framework

    Dev->>CI: Trigger Pull Request
    CI->>Scarb: Use Scarb 2.9.1
    Scarb->>Cairo: Compile with Cairo 2.9.2
    Cairo->>Dojo: Generate Artifacts
    Dojo-->>CI: Build Successful
    CI-->>Dev: Validation Complete
Loading

The sequence diagram illustrates the high-level workflow of how the version upgrades propagate through the development and build process, ensuring compatibility and smooth transitions across the Dojo ecosystem.


🪧 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: 3

🧹 Nitpick comments (9)
crates/dojo/lang/src/inline_macros/spawn_test_world.rs (1)

101-101: Ohayo! LGTM with a small suggestion, sensei!

The addition of diagnostics_note field is consistent with the Cairo 2.9.2 upgrade. Consider adding trace logging for diagnostic notes when they're present in the future, similar to how you're logging namespaces and models.

 trace!(?namespaces, ?models, "Spawning test world from macro.");
+// Future enhancement when diagnostics_note is used:
+// if let Some(note) = &diagnostics_note {
+//     trace!(?note, "Diagnostic note present");
+// }
crates/dojo/lang/src/attribute_macros/interface.rs (1)

89-89: Ohayo! Consider future diagnostic note usage, sensei!

While the diagnostics_note addition is correct, this interface implementation might benefit from actual diagnostic notes in the future, especially for trait-specific validations.

Consider utilizing this field in future updates to provide more detailed diagnostic information about trait implementations and interface-specific validations.

bin/sozo/src/commands/test.rs (4)

125-125: Avoid reassigning the is_included variable

Ohayo, sensei! In line 125, the variable is_included is reassigned, which may cause confusion and reduce code readability. It's better to use a different variable name or combine the conditions to avoid reusing the same variable name in the same scope.

Consider combining the conditions into a single expression or using a new variable name:

-let is_included = opts.include_target_kinds.is_empty()
+let include_target_kind = opts.include_target_kinds.is_empty()
     || opts.include_target_kinds.contains(&cu.main_component().target_kind());

-let is_included = is_included
+let is_included = include_target_kind
     && (opts.include_target_names.is_empty()
         || cu
             .main_component()
             .targets
             .iter()
             .any(|t| opts.include_target_names.contains(&t.name)));

Line range hint 414-421: Update l2_gas_price to the correct values

Ohayo, sensei! There are TODO comments in lines 414 and 420 suggesting that the l2_gas_price values for eth_gas_prices and strk_gas_prices need to be updated. Accurate gas price information is crucial for proper fee calculation and transaction processing.

Would you like assistance in determining and updating the correct l2_gas_price values, or should we open a GitHub issue to address this?


Line range hint 568-573: Address the TODO regarding contract class conversions

Ohayo, sensei! In lines 568-573, there's a TODO comment expressing uncertainty about the variant to use in to_runnable_class for contract class conversions. This might impact how different contract classes are handled during execution.

Would you like me to research and propose a solution for handling the different variants, or open a GitHub issue to track this task?


Line range hint 588-599: Clarify ABI length retrieval for Sierra classes

Ohayo, sensei! In lines 592-599, there's a TODO comment about retrieving the ABI length for Sierra classes in the to_class_info function. Properly obtaining the ABI length is important for accurate class information.

Do you want assistance in determining how to retrieve the ABI length for Sierra classes, or should we open a GitHub issue to address this?

crates/katana/pool/src/validation/stateful.rs (1)

204-212: Enhanced panic handling implementation!

Added proper handling for PanicInValidate with default values for address and class_hash.

Consider adding actual address and class_hash values instead of defaults when available from the context.

crates/katana/rpc/rpc/tests/starknet.rs (1)

Line range hint 929-950: Ohayo! Improved v3 transaction testing.

The error handling has been simplified using unwrap(). While this works for tests, consider adding more descriptive error messages for better debugging.

Consider adding error context:

-        .unwrap();
+        .unwrap_or_else(|e| panic!("Failed to execute v3 transaction: {}", e));
crates/katana/cairo/Cargo.toml (1)

21-21: Consider using a tag instead of commit hash, sensei! 🎯

Using a specific commit hash (92da150d) for starknet_api might make builds less reproducible compared to using version tags.

Consider using a version tag if available:

-starknet_api = { git = "https://github.com/dojoengine/sequencer", rev = "92da150d" }
+starknet_api = { git = "https://github.com/dojoengine/sequencer", tag = "v0.9.0" }
📜 Review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between baf0ce9 and 9f0d3c4.

⛔ Files ignored due to path filters (11)
  • Cargo.lock is excluded by !**/*.lock
  • crates/benches/contracts/Scarb.lock is excluded by !**/*.lock
  • crates/dojo/core-cairo-test/Scarb.lock is excluded by !**/*.lock
  • crates/dojo/core/Scarb.lock is excluded by !**/*.lock
  • crates/dojo/lang/Scarb.lock is excluded by !**/*.lock
  • crates/torii/types-test/Scarb.lock is excluded by !**/*.lock
  • examples/game-lib/Scarb.lock is excluded by !**/*.lock
  • examples/simple/Scarb.lock is excluded by !**/*.lock
  • examples/spawn-and-move/Scarb.lock is excluded by !**/*.lock
  • spawn-and-move-db.tar.gz is excluded by !**/*.gz
  • types-test-db.tar.gz is excluded by !**/*.gz
📒 Files selected for processing (100)
  • .github/workflows/ci.yml (1 hunks)
  • .tool-versions (1 hunks)
  • Cargo.toml (4 hunks)
  • bin/sozo/benches/spawn-and-move-build.rs (1 hunks)
  • bin/sozo/src/commands/build.rs (1 hunks)
  • bin/sozo/src/commands/test.rs (6 hunks)
  • crates/benches/contracts/Scarb.toml (2 hunks)
  • crates/benches/contracts/src/models/character.cairo (1 hunks)
  • crates/dojo/core-cairo-test/Scarb.toml (1 hunks)
  • crates/dojo/core-cairo-test/src/lib.cairo (1 hunks)
  • crates/dojo/core-cairo-test/src/tests/benchmarks.cairo (12 hunks)
  • crates/dojo/core-cairo-test/src/tests/contract.cairo (1 hunks)
  • crates/dojo/core-cairo-test/src/tests/event/event.cairo (1 hunks)
  • crates/dojo/core-cairo-test/src/tests/helpers/event.cairo (1 hunks)
  • crates/dojo/core-cairo-test/src/tests/helpers/helpers.cairo (6 hunks)
  • crates/dojo/core-cairo-test/src/tests/helpers/model.cairo (1 hunks)
  • crates/dojo/core-cairo-test/src/tests/meta/introspect.cairo (6 hunks)
  • crates/dojo/core-cairo-test/src/tests/model/model.cairo (2 hunks)
  • crates/dojo/core-cairo-test/src/tests/storage/packing.cairo (6 hunks)
  • crates/dojo/core-cairo-test/src/tests/utils/hash.cairo (1 hunks)
  • crates/dojo/core-cairo-test/src/tests/utils/key.cairo (1 hunks)
  • crates/dojo/core-cairo-test/src/tests/utils/layout.cairo (4 hunks)
  • crates/dojo/core-cairo-test/src/tests/utils/misc.cairo (2 hunks)
  • crates/dojo/core-cairo-test/src/tests/world/acl.cairo (9 hunks)
  • crates/dojo/core-cairo-test/src/tests/world/contract.cairo (7 hunks)
  • crates/dojo/core-cairo-test/src/tests/world/event.cairo (16 hunks)
  • crates/dojo/core-cairo-test/src/tests/world/metadata.cairo (6 hunks)
  • crates/dojo/core-cairo-test/src/tests/world/model.cairo (17 hunks)
  • crates/dojo/core-cairo-test/src/tests/world/namespace.cairo (3 hunks)
  • crates/dojo/core-cairo-test/src/tests/world/storage.cairo (2 hunks)
  • crates/dojo/core-cairo-test/src/tests/world/world.cairo (10 hunks)
  • crates/dojo/core-cairo-test/src/utils.cairo (1 hunks)
  • crates/dojo/core-cairo-test/src/world.cairo (7 hunks)
  • crates/dojo/core/Scarb.toml (1 hunks)
  • crates/dojo/core/src/contract/components/upgradeable.cairo (2 hunks)
  • crates/dojo/core/src/contract/components/world_provider.cairo (2 hunks)
  • crates/dojo/core/src/event/component.cairo (2 hunks)
  • crates/dojo/core/src/event/event.cairo (2 hunks)
  • crates/dojo/core/src/lib.cairo (3 hunks)
  • crates/dojo/core/src/meta/introspect.cairo (2 hunks)
  • crates/dojo/core/src/meta/layout.cairo (2 hunks)
  • crates/dojo/core/src/model/component.cairo (2 hunks)
  • crates/dojo/core/src/model/definition.cairo (1 hunks)
  • crates/dojo/core/src/model/metadata.cairo (2 hunks)
  • crates/dojo/core/src/model/model.cairo (2 hunks)
  • crates/dojo/core/src/model/model_value.cairo (1 hunks)
  • crates/dojo/core/src/model/storage.cairo (4 hunks)
  • crates/dojo/core/src/storage/database.cairo (1 hunks)
  • crates/dojo/core/src/storage/entity_model.cairo (6 hunks)
  • crates/dojo/core/src/storage/layout.cairo (19 hunks)
  • crates/dojo/core/src/storage/packing.cairo (7 hunks)
  • crates/dojo/core/src/storage/storage.cairo (11 hunks)
  • crates/dojo/core/src/utils/layout.cairo (2 hunks)
  • crates/dojo/core/src/utils/misc.cairo (1 hunks)
  • crates/dojo/core/src/utils/serde.cairo (1 hunks)
  • crates/dojo/core/src/utils/snf_test.cairo (2 hunks)
  • crates/dojo/core/src/world/errors.cairo (1 hunks)
  • crates/dojo/core/src/world/iworld.cairo (8 hunks)
  • crates/dojo/core/src/world/resource.cairo (1 hunks)
  • crates/dojo/core/src/world/storage.cairo (24 hunks)
  • crates/dojo/core/src/world/world_contract.cairo (43 hunks)
  • crates/dojo/lang/Scarb.toml (1 hunks)
  • crates/dojo/lang/src/attribute_macros/contract.rs (1 hunks)
  • crates/dojo/lang/src/attribute_macros/event.rs (1 hunks)
  • crates/dojo/lang/src/attribute_macros/interface.rs (1 hunks)
  • crates/dojo/lang/src/attribute_macros/model.rs (1 hunks)
  • crates/dojo/lang/src/derive_macros/mod.rs (1 hunks)
  • crates/dojo/lang/src/inline_macros/delete.rs (1 hunks)
  • crates/dojo/lang/src/inline_macros/emit.rs (1 hunks)
  • crates/dojo/lang/src/inline_macros/get.rs (1 hunks)
  • crates/dojo/lang/src/inline_macros/get_models_test_class_hashes.rs (1 hunks)
  • crates/dojo/lang/src/inline_macros/selector_from_tag.rs (1 hunks)
  • crates/dojo/lang/src/inline_macros/set.rs (1 hunks)
  • crates/dojo/lang/src/inline_macros/spawn_test_world.rs (1 hunks)
  • crates/dojo/test-utils/src/compiler.rs (2 hunks)
  • crates/dojo/world/abigen/src/main.rs (2 hunks)
  • crates/dojo/world/src/contracts/abigen/model.rs (7 hunks)
  • crates/katana/cairo/Cargo.toml (1 hunks)
  • crates/katana/executor/Cargo.toml (1 hunks)
  • crates/katana/executor/src/implementation/blockifier/error.rs (1 hunks)
  • crates/katana/executor/src/implementation/blockifier/mod.rs (4 hunks)
  • crates/katana/executor/src/implementation/blockifier/state.rs (5 hunks)
  • crates/katana/executor/src/implementation/blockifier/utils.rs (21 hunks)
  • crates/katana/pool/src/validation/stateful.rs (3 hunks)
  • crates/katana/primitives/src/conversion/rpc.rs (2 hunks)
  • crates/katana/rpc/rpc-types/src/class.rs (2 hunks)
  • crates/katana/rpc/rpc/tests/starknet.rs (4 hunks)
  • crates/torii/types-test/Scarb.toml (1 hunks)
  • examples/game-lib/Scarb.toml (1 hunks)
  • examples/game-lib/armory/Scarb.toml (1 hunks)
  • examples/game-lib/bestiary/Scarb.toml (1 hunks)
  • examples/simple/Scarb.toml (2 hunks)
  • examples/simple/manifest_dev.json (5 hunks)
  • examples/simple/src/lib.cairo (4 hunks)
  • examples/spawn-and-move/Scarb.toml (2 hunks)
  • examples/spawn-and-move/dojo_dev.toml (1 hunks)
  • examples/spawn-and-move/src/actions.cairo (7 hunks)
  • examples/spawn-and-move/src/models.cairo (3 hunks)
  • rust-toolchain.toml (1 hunks)
  • xtask/generate-test-db/src/main.rs (1 hunks)
✅ Files skipped from review due to trivial changes (54)
  • crates/dojo/core/src/world/resource.cairo
  • rust-toolchain.toml
  • crates/dojo/core-cairo-test/src/tests/utils/key.cairo
  • .tool-versions
  • examples/game-lib/Scarb.toml
  • crates/dojo/core/src/lib.cairo
  • crates/dojo/core-cairo-test/src/tests/event/event.cairo
  • crates/dojo/core/src/utils/serde.cairo
  • crates/dojo/lang/Scarb.toml
  • crates/dojo/core-cairo-test/src/tests/utils/misc.cairo
  • crates/dojo/core/src/event/event.cairo
  • crates/dojo/core/src/utils/misc.cairo
  • crates/dojo/core-cairo-test/src/tests/model/model.cairo
  • crates/dojo/core/src/model/definition.cairo
  • crates/dojo/core/src/model/metadata.cairo
  • xtask/generate-test-db/src/main.rs
  • crates/dojo/core/src/storage/database.cairo
  • crates/dojo/core-cairo-test/src/tests/world/metadata.cairo
  • crates/dojo/core-cairo-test/src/tests/utils/hash.cairo
  • crates/dojo/core/src/world/errors.cairo
  • crates/dojo/core/src/model/model_value.cairo
  • examples/simple/src/lib.cairo
  • crates/dojo/core/src/utils/snf_test.cairo
  • crates/dojo/core/src/model/model.cairo
  • crates/dojo/core-cairo-test/src/tests/world/contract.cairo
  • crates/dojo/core-cairo-test/src/tests/storage/packing.cairo
  • examples/spawn-and-move/dojo_dev.toml
  • crates/dojo/core-cairo-test/src/tests/world/storage.cairo
  • crates/dojo/core-cairo-test/src/tests/helpers/model.cairo
  • crates/benches/contracts/src/models/character.cairo
  • crates/dojo/core-cairo-test/src/lib.cairo
  • crates/dojo/core-cairo-test/src/tests/world/world.cairo
  • crates/dojo/core-cairo-test/src/tests/world/event.cairo
  • examples/spawn-and-move/src/actions.cairo
  • crates/dojo/core-cairo-test/src/tests/world/acl.cairo
  • crates/dojo/core-cairo-test/src/world.cairo
  • crates/dojo/core-cairo-test/src/tests/world/namespace.cairo
  • crates/dojo/core/src/contract/components/upgradeable.cairo
  • crates/dojo/core-cairo-test/src/tests/benchmarks.cairo
  • crates/dojo/core/src/meta/layout.cairo
  • crates/dojo/core-cairo-test/src/tests/helpers/helpers.cairo
  • crates/dojo/core-cairo-test/src/tests/utils/layout.cairo
  • crates/dojo/core/src/model/component.cairo
  • crates/dojo/core-cairo-test/src/tests/world/model.cairo
  • examples/spawn-and-move/src/models.cairo
  • crates/dojo/core/src/storage/storage.cairo
  • crates/dojo/core/src/meta/introspect.cairo
  • crates/dojo/core/src/storage/packing.cairo
  • crates/dojo/core/src/storage/entity_model.cairo
  • crates/dojo/core/src/world/storage.cairo
  • crates/dojo/core/src/model/storage.cairo
  • crates/dojo/core-cairo-test/src/tests/meta/introspect.cairo
  • crates/dojo/core/src/world/iworld.cairo
  • crates/dojo/core/src/world/world_contract.cairo
⏰ Context from checks skipped due to timeout of 90000ms (3)
  • GitHub Check: docs
  • GitHub Check: clippy
  • GitHub Check: build
🔇 Additional comments (59)
crates/dojo/lang/src/inline_macros/selector_from_tag.rs (1)

70-70: Ohayo! LGTM, sensei!

The addition of diagnostics_note field is consistent with the Cairo 2.9.2 upgrade requirements.

crates/dojo/lang/src/inline_macros/get.rs (1)

102-102: Ohayo! LGTM, sensei!

The addition of diagnostics_note field aligns with the Cairo 2.9.2 upgrade pattern.

crates/dojo/lang/src/inline_macros/get_models_test_class_hashes.rs (1)

100-100: Ohayo! LGTM, sensei!

The addition of diagnostics_note field maintains consistency with the Cairo 2.9.2 upgrade changes.

crates/dojo/lang/src/inline_macros/delete.rs (1)

108-108: Ohayo! LGTM on the diagnostics_note addition, sensei!

The addition of diagnostics_note field aligns with Cairo 2.9.2's requirements for plugin-generated files.

crates/dojo/lang/src/inline_macros/emit.rs (1)

112-112: Consistent implementation, looking good sensei!

The diagnostics_note field addition matches the pattern across other files.

crates/dojo/lang/src/inline_macros/set.rs (1)

124-124: Implementation aligns perfectly with Cairo 2.9.2, sensei!

The diagnostics_note field is correctly added to support the new diagnostic capabilities.

crates/dojo/lang/src/attribute_macros/event.rs (1)

161-161: Ohayo! LGTM - Consistent with Cairo 2.9.2 upgrade.

The addition of diagnostics_note: None aligns with the new PluginGeneratedFile structure in Cairo 2.9.2.

crates/dojo/lang/src/derive_macros/mod.rs (1)

58-58: Ohayo sensei! LGTM - Maintaining consistency.

The addition of diagnostics_note: None matches the pattern seen in other files, ensuring consistent structure across the codebase.

crates/dojo/lang/src/attribute_macros/model.rs (1)

204-204: Ohayo! LGTM - Aligned with Cairo upgrade.

The addition of diagnostics_note: None follows the same pattern as other files in this upgrade.

crates/dojo/lang/src/attribute_macros/contract.rs (1)

155-155: Ohayo sensei! LGTM - Consistent implementation.

The addition of diagnostics_note: None completes the consistent pattern of updates across all plugin-generated files.

bin/sozo/src/commands/test.rs (2)

Line range hint 95-104: Review the fee calculation logic

Ohayo, sensei! There's a TODO comment in line 95 indicating uncertainty about the correctness of the fee calculation logic. This could affect transaction fee processing and overall system integrity.

Would you like me to help verify and correct the fee calculation logic? I can provide assistance or open a GitHub issue to track this task.


278-279: Ensure consistent use of discriminator in CrateLongId::Real

Ohayo, sensei! In lines 278-279, the discriminator is set to None when interning crates in collect_crates_ids_from_selectors. However, in collect_all_crate_ids (lines 287-290), the discriminator is derived from component.id.to_discriminator(). For consistency and to prevent potential issues with crate identification, please verify if the discriminator should be set appropriately here.

If the discriminator is necessary for distinguishing between crates, consider updating the code:

-db.intern_crate(CrateLongId::Real { name: package_name, discriminator: None })
+db.intern_crate(CrateLongId::Real { name: package_name, discriminator: Some(discriminator_value) })

Please ensure that discriminator_value is correctly obtained for each package.

crates/dojo/core/src/event/component.cairo (3)

6-8: Consistent inclusion of Event<E> improves trait implementations

Ohayo, sensei! Including Event<E> in the implementation parameters ensures consistent and explicit typing across the trait implementations. This enhances type safety and code clarity.


15-18: Trait implementations correctly updated with Event<E>

Ohayo, sensei! The addition of Event<E> in the trait implementations for IStoredResource aligns with the type definitions and improves consistency.


Line range hint 21-23: Proper extension of IEventImpl with Event<E>

Ohayo, sensei! The implementation of IEventImpl now correctly includes Event<E>, ensuring that event definitions are accurately represented.

crates/dojo/core/src/contract/components/world_provider.cairo (1)

22-23: Ohayo! Breaking change in type parameters needs verification.

The change from TContractState to HasComponent<TContractState> is a breaking change that might affect existing implementations.

Let's verify the impact:

Also applies to: 31-32

✅ Verification successful

Ohayo sensei! No breaking change detected - requirement already exists.

The change from TContractState to HasComponent<TContractState> formalizes an existing requirement. All contracts implementing WorldProvider already require HasComponent trait for component functionality.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for existing implementations that might be affected
rg -l "impl (World|Internal)Provider<\w+>" 

Length of output: 44


Script:

#!/bin/bash
# Search with broader patterns
echo "=== Searching for WorldProvider usage ==="
rg "WorldProvider" -A 2 -B 2

echo -e "\n=== Searching for component-related implementations ==="
rg "impl.*Component.*for" -A 2 -B 2

echo -e "\n=== Checking files containing Provider in their name ==="
fd "provider" --type f

Length of output: 126062


Script:

#!/bin/bash
# Search for HasComponent usage and requirements
echo "=== Searching for HasComponent trait requirements ==="
rg "HasComponent" -A 2 -B 2

echo -e "\n=== Searching for TContractState usage patterns ==="
rg "TContractState" -A 2 -B 2

Length of output: 68764

crates/dojo/core/src/utils/layout.cairo (1)

5-5: Ohayo sensei! LGTM - Syntax improvements.

The addition of trailing commas aligns with Cairo 2.9.2's syntax style and improves consistency.

Also applies to: 40-40

bin/sozo/benches/spawn-and-move-build.rs (1)

26-26: Ohayo! Good addition of version checking.

Explicitly setting ignore_cairo_version: false ensures proper version compatibility checks during compilation.

Let's verify this option is consistently set across the codebase:

✅ Verification successful

Ohayo! Version checking is properly configured across the codebase

The ignore_cairo_version: false setting is consistently used in all production and benchmark code. There's one exception in test utilities where it's set to true, but this is acceptable as test utilities often need to work with multiple versions.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for other CompileOpts usage
rg "CompileOpts\s*\{" -A 5

Length of output: 2400

crates/katana/executor/src/implementation/blockifier/error.rs (1)

34-35: Ohayo sensei! Improved error handling.

The change to use error_trace directly provides better error reporting and aligns with Cairo 2.9.2's enhanced error handling capabilities.

crates/dojo/core-cairo-test/src/tests/contract.cairo (1)

180-180: Ohayo! LGTM on the panic message formatting, sensei!

The addition of the closing parenthesis properly formats the panic message structure.

crates/dojo/world/abigen/src/main.rs (1)

26-26: Ohayo! Let's verify the model artifact path changes, sensei!

The model artifact path has been updated to use the new naming convention. Let's verify no other paths are affected.

✅ Verification successful

Ohayo! All clear on the artifact path changes, sensei!

The updated path dojo_m_ResourceMetadata.contract_class.json is the only instance that needed changing. No other files were using the old path format, and all other contract class files are following their own consistent naming patterns.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining old-style artifact paths
rg -l "dojo_resource_metadata\.contract_class\.json"

Length of output: 54


Script:

#!/bin/bash
# Search with broader patterns to catch variations
echo "=== Searching for contract class JSON files ==="
rg -i "contract_class\.json" -A 2 -B 2

echo -e "\n=== Searching for resource metadata related paths ==="
rg -i "resource.?metadata" -A 2 -B 2

echo -e "\n=== Listing all .json files in target directories ==="
fd -e json . "target/"

Length of output: 40894

crates/katana/pool/src/validation/stateful.rs (2)

169-171: Ohayo! Nice flag configuration, sensei!

Clean implementation of execution flags with explicit validation and fee check controls.


172-173: Transaction type update looks good!

Updated from AccountTransaction to Account to align with Cairo 2.9.2's transaction handling.

bin/sozo/src/commands/build.rs (1)

106-106: Ohayo! Good choice on version checking, sensei!

Explicitly setting ignore_cairo_version to false ensures proper version compatibility checks during compilation.

✅ Verification successful

Ohayo! Your version checking wisdom is spot on, sensei!

The cairo-version 2.9.2 is used across multiple core packages and examples in the ecosystem. Setting ignore_cairo_version to false is the right choice to maintain version compatibility and prevent potential issues.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Verify cairo version specifications across the project
rg -l "cairo-version.*=.*2\.9\.2" --type toml

Length of output: 211

crates/katana/executor/src/implementation/blockifier/mod.rs (2)

240-266: Structured gas price access looks clean, sensei!

The nested access to gas prices through block context is well-organized and type-safe.


104-110: Ohayo! Gas price initialization looks good but needs verification.

The initialization of gas prices with fallback to NonzeroGasPrice::MIN is a safe approach.

Let's verify the gas price handling in other parts of the codebase:

✅ Verification successful

Ohayo! Gas price initialization is verified and consistent, sensei! ✨

The fallback to NonzeroGasPrice::MIN is consistently implemented across the codebase and properly integrated with the default gas price constants. The implementation provides a robust multi-layer safety net through configuration options, default constants, and MIN value fallbacks.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other gas price initializations to ensure consistency
rg -A 3 "NonzeroGasPrice::new|NonzeroGasPrice::MIN"

Length of output: 2516


Script:

#!/bin/bash
# Search for gas price related types and constants
rg -g "*.rs" "(?i)(struct|enum|type|const).*gas.*price"

Length of output: 1228

crates/katana/rpc/rpc-types/src/class.rs (2)

9-11: Import reorganization for deprecated contract class.

Clean separation of concerns by moving entry point types to deprecated namespace.


130-130: Type update aligns with Cairo 2.9.2 changes.

The change from EntryPoint to EntryPointV0 reflects the new versioning scheme.

Let's verify the consistency of this change:

✅ Verification successful

Ohayo sensei!

EntryPoint to EntryPointV0 migration is properly implemented

The change aligns with Cairo 2.9.2's versioning scheme and is consistently applied across the codebase. No remaining instances of the old type were found.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for any remaining old EntryPoint usages
rg "Vec<EntryPoint>" --type rust

Length of output: 34


Script:

#!/bin/bash
# Search for any remaining EntryPoint usages (excluding EntryPointV0)
rg "EntryPoint[^V]" --type rust -A 2

# Search for EntryPointV0 usages to confirm adoption
rg "EntryPointV0" --type rust -A 2

# Check imports related to EntryPoint
ast-grep --pattern 'use $$$EntryPoint$$$;'

Length of output: 30319

crates/katana/primitives/src/conversion/rpc.rs (2)

7-9: Import alignment with RPC types, nice work sensei!

The imports are properly organized to match the changes in class.rs.


38-41: Function signatures updated consistently.

The change to EntryPointV0 is applied consistently across the conversion functions.

crates/dojo/test-utils/src/compiler.rs (2)

323-324: Consistent version handling in compilation units.

The ignore_cairo_version parameter is properly propagated to the compilation units generation.


174-174: Cairo version check disabled for testing.

Setting ignore_cairo_version: true allows for more flexible testing scenarios.

Let's check if this is consistently applied:

✅ Verification successful

Ohayo sensei! Here's what I found:

✓ Version check bypass is correctly isolated to test utilities

The ignore_cairo_version: true flag is exclusively used in test utilities, while all production code paths explicitly set it to false. This is the correct approach for maintaining version safety in production while allowing flexible testing scenarios.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Check for other ignore_cairo_version usages
rg "ignore_cairo_version.*=.*true" --type rust

Length of output: 48


Script:

#!/bin/bash
# Search for any mention of ignore_cairo_version
rg "ignore_cairo_version" --type rust -A 2 -B 2

# Look for struct definitions containing cairo_version
ast-grep --pattern 'struct $_ {
  $$$
  cairo_version
  $$$
}'

# Search for version-related configurations
rg "cairo.*version" --type rust -A 2 -B 2

Length of output: 9403

crates/dojo/core/src/storage/layout.cairo (1)

Line range hint 1-475: Ohayo, sensei! The layout changes look good.

The changes in this file are purely syntactical, adding trailing commas to function signatures. This aligns with modern Cairo syntax conventions and improves code consistency.

crates/katana/executor/src/implementation/blockifier/state.rs (2)

351-367: Test adaptations look good, sensei!

The tests have been properly updated to use to_runnable_class, maintaining test coverage while adapting to the new type system.


49-60: Ohayo! Important architectural change in compiled class handling.

The transition from ContractClass to RunnableCompiledClass represents a significant architectural improvement:

  • More specific type for compiled classes
  • Better alignment with Cairo 2.9.2's class handling mechanisms

Let's verify the usage of this new type across the codebase:

✅ Verification successful

Ohayo! No architectural concerns with the ContractClass to RunnableCompiledClass transition.

The change is safely contained within the blockifier executor implementation:

  • RunnableCompiledClass is just an intermediate execution-time representation
  • Main ContractClass type remains unchanged across the codebase
  • Conversion is handled cleanly via utils::to_runnable_class
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining uses of the old ContractClass type
rg "ContractClass" --type rust

# Search for RunnableCompiledClass usage to ensure consistent adoption
rg "RunnableCompiledClass" --type rust

Length of output: 42627

crates/dojo/world/src/contracts/abigen/model.rs (2)

224-224: Ohayo! Enhanced metadata structure with hash field.

The addition of metadata_hash to both ResourceMetadata and ResourceMetadataValue structs improves the metadata handling capabilities.

Also applies to: 261-261


597-606: New ensure_unique functionality added.

The ensure_unique method has been added to both ModelContract and ModelContractReader, providing consistent uniqueness validation.

Also applies to: 714-723

crates/katana/rpc/rpc/tests/starknet.rs (1)

1148-1175: Nice test coverage expansion, sensei!

The new call_contract test improves coverage by testing both legacy and standard contracts. The use of abigen! for AccountContract demonstrates proper contract interaction patterns.

examples/game-lib/armory/Scarb.toml (1)

5-8: Ohayo! LGTM - Workspace configuration looks good, sensei!

The workspace configuration changes align with the standardization efforts across the project.

examples/game-lib/bestiary/Scarb.toml (1)

5-8: LGTM - Consistent workspace setup!

The workspace configuration mirrors the changes in armory/Scarb.toml, maintaining consistency.

crates/torii/types-test/Scarb.toml (1)

2-2: LGTM - Cairo version bump to 2.9.2!

Version update aligns with the target upgrade version.

crates/benches/contracts/Scarb.toml (1)

2-2: Verify version consistency, sensei!

The Cairo and Starknet versions are set to 2.9.1, while other files in the PR use 2.9.2. This inconsistency should be addressed.

Consider updating both versions to 2.9.2 to maintain consistency:

-cairo-version = "=2.9.1"
+cairo-version = "=2.9.2"
-starknet = "=2.9.1"
+starknet = "=2.9.2"

Also applies to: 11-11

crates/dojo/core-cairo-test/Scarb.toml (1)

2-2: LGTM - Consistent version updates across dependencies!

All versions (Cairo, Starknet, and cairo_test) are properly aligned at 2.9.2, and the package version has been bumped to 1.0.5.

Also applies to: 6-6, 9-9, 13-13

crates/dojo/core/Scarb.toml (1)

2-2: Ohayo sensei! Version updates look consistent! 🎉

All dependencies are properly aligned to version 2.9.2:

  • cairo-version: 2.9.2
  • starknet: 2.9.2
  • cairo_test: 2.9.2

Also applies to: 9-9, 14-14

examples/simple/Scarb.toml (1)

2-2: Versions in sync with core, sensei! ✨

Example project dependencies properly aligned to 2.9.2.

Also applies to: 14-14

examples/spawn-and-move/Scarb.toml (1)

2-2: Another perfect version alignment, sensei! 🌟

All dependencies properly updated to 2.9.2.

Also applies to: 19-19

crates/katana/cairo/Cargo.toml (1)

Line range hint 12-17: Ohayo! Consider updating cairo dependencies, sensei! 🤔

The cairo-lang dependencies are still at version 2.7.0 while the rest of the project is moving to 2.9.2. This might cause compatibility issues.

Could you verify if these dependencies need to be updated as well?

crates/dojo/core-cairo-test/src/utils.cairo (1)

52-52: Clean formatting update, sensei! ✨

Removing the trailing comma in the assert macro aligns with Cairo 2.9.2 style guidelines.

Cargo.toml (1)

148-169: Ohayo sensei! Let's verify the Cairo 2.9.2 upgrade compatibility.

The upgrade from Cairo 2.8.4 to 2.9.2 looks good. However, we should verify:

  1. Breaking changes in Cairo 2.9.2
  2. Compatibility between scarb revision and Cairo version
  3. Impact of switching starknet_api to git dependency

Also applies to: 213-214, 223-224

✅ Verification successful

Ohayo sensei! The Cairo 2.9.2 upgrade looks safe to proceed!

Our thorough investigation shows no version-specific code patterns or compatibility issues. The coordinated update of all cairo-lang-* packages to 2.9.2 maintains consistency across the ecosystem. However, since this is a minor version bump, please ensure to:

  • Run the test suite after the upgrade
  • Verify any Cairo VM-specific functionality
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for breaking changes in Cairo 2.9.2

# Check the changelog for breaking changes
curl -s https://raw.githubusercontent.com/starkware-libs/cairo/v2.9.2/CHANGELOG.md | grep -A 10 "## \[2.9"

# Verify scarb compatibility
curl -s "https://api.github.com/repos/dojoengine/scarb/commits/72b5db6b009fda6a83e2740d2a10b529b02d792c" | jq -r '.files[].filename' | grep -i "cairo"

# Check starknet_api changes
curl -s "https://api.github.com/repos/dojoengine/sequencer/commits/92da150d" | jq -r '.files[].filename' | grep -i "starknet_api"

Length of output: 385


Script:

#!/bin/bash
# Search for Cairo version references and potential compatibility issues
echo "=== Searching for Cairo version references ==="
rg -i "cairo.*2\.(8|9)" --type rust -C 2

echo -e "\n=== Checking for compatibility configurations ==="
fd "\.toml$" --exec cat {} \; | rg -i "cairo.*compatibility"

echo -e "\n=== Looking for version-specific imports or features ==="
rg -i "cairo.*feature" --type rust -C 2

echo -e "\n=== Checking for any migration guides or documentation ==="
fd "README|CHANGELOG|UPGRADE" --exec cat {} \; | rg -i -A 5 "migration|upgrade|breaking.?change"

Length of output: 1907


Script:

#!/bin/bash
# Check for version-specific code patterns and test configurations

echo "=== Checking for Cairo version-specific test configurations ==="
fd "test" -e rs -e toml --exec cat {} \; | rg -i "cairo.*2\.(8|9)" -C 3

echo -e "\n=== Looking for Cairo compiler version requirements ==="
rg -i "requires.*cairo" -C 3

echo -e "\n=== Searching for Cairo version-specific APIs or features ==="
ast-grep --pattern 'cairo_lang_$_' -l rust

echo -e "\n=== Checking for any version pins in dependency files ==="
fd Cargo.lock -x cat {} \; | rg -i "cairo-lang.*2\.(8|9)"

Length of output: 747

examples/simple/manifest_dev.json (1)

3-4: LGTM! Contract hashes updated for Cairo 2.9.2.

The updates to contract addresses and class hashes are expected due to the Cairo version upgrade. All references have been consistently updated across the manifest.

Also applies to: 1255-1256, 1513-1514, 1689-1690, 1950-1950, 1956-1956, 1964-1964, 1970-1970

crates/katana/executor/src/implementation/blockifier/utils.rs (6)

524-533: Verify if to_api_resource_bounds implementation is up-to-date with Cairo 2.9.2.

The function to_api_resource_bounds has a comment indicating it's for pre-0.13.3 versions:

// Pre 0.13.3. Only L1 gas. L2 bounds are signed but never used.
fn to_api_resource_bounds(
    resource_bounds: katana_primitives::fee::ResourceBoundsMapping,
) -> ValidResourceBounds {
    ValidResourceBounds::L1Gas(ResourceBounds {
        max_amount: resource_bounds.l1_gas.max_amount.into(),
        max_price_per_unit: resource_bounds.l1_gas.max_price_per_unit.into(),
    })
}

Since the project is upgrading to Cairo 2.9.2, please check if this implementation needs to be updated to handle L2 gas or other changes in resource bounds in the newer version.


95-105: ⚠️ Potential issue

Ohayo, sensei! Please clarify the gas price selection logic and resolve the TODO.

The current implementation selects the L2 gas price based on the fee_type, but there is a TODO comment indicating uncertainty about its correctness:

// TODO: i dont know if this is correct
let (unit, gas_price) = match fee_type {
    FeeType::Eth => (
        PriceUnit::Wei,
        block_context.block_info().gas_prices.eth_gas_prices.l2_gas_price.get().0,
    ),
    FeeType::Strk => (
        PriceUnit::Fri,
        block_context.block_info().gas_prices.strk_gas_prices.l2_gas_price.get().0,
    ),
};

Please verify that the gas price and unit are correctly determined for both FeeType::Eth and FeeType::Strk, ensuring they align with the expected fee calculation logic after the upgrade to Cairo 2.9.2. Once confirmed, remove the TODO comment.


720-729: Ensure correct mapping in From<ExecutionFlags> implementation.

The From implementation converts ExecutionFlags into BlockifierExecutionFlags:

impl From<ExecutionFlags> for BlockifierExecutionFlags {
    fn from(value: ExecutionFlags) -> Self {
        Self {
            only_query: false,
            charge_fee: value.fee(),
            nonce_check: value.nonce_check(),
            validate: value.account_validation(),
        }
    }
}

Please verify that all fields in ExecutionFlags are correctly and completely mapped to the corresponding fields in BlockifierExecutionFlags, ensuring no functionality is lost in the conversion.

✅ Verification successful

Ohayo sensei! The From<ExecutionFlags> implementation is correct and complete.

The mapping preserves all functionality with proper field correspondence:

  • fee()charge_fee
  • nonce_check()nonce_check
  • account_validation()validate

The hardcoded only_query: false is appropriate as it's not part of the original flags.

🏁 Scripts executed

The following scripts were executed for the analysis:

Error: No shell scripts found


Script:

#!/bin/bash
# Find struct definitions and their fields
ast-grep --pattern 'struct ExecutionFlags {
  $$$
}'

ast-grep --pattern 'struct BlockifierExecutionFlags {
  $$$
}'

# Search for the implementation of methods used in conversion
rg "fn fee|fn nonce_check|fn account_validation" -A 2

Length of output: 1597


Script:

#!/bin/bash
# View the files containing the structs
cat crates/katana/executor/src/abstraction/mod.rs
cat crates/katana/executor/src/implementation/blockifier/utils.rs

# Backup search for struct definitions
rg "struct (ExecutionFlags|BlockifierExecutionFlags)" --type rust

Length of output: 46025


565-599: ⚠️ Potential issue

Address the TODO comments regarding contract class conversions.

The functions to_runnable_class and to_class_info contain TODO comments expressing uncertainty about the variant to use and whether the return type should change to handle error cases in contract class conversions:

// TODO: @kariy not sure of the variant that must be used in this case. Should we change the
// return type to include this case of error for contract class conversions?
pub fn to_runnable_class(
    class: class::CompiledClass,
) -> Result<RunnableCompiledClass, ProgramError> {
    match class {
        class::CompiledClass::Legacy(class) => {
            Ok(RunnableCompiledClass::V0(CompiledClassV0::try_from(class)?))
        }
        class::CompiledClass::Class(casm) => {
            Ok(RunnableCompiledClass::V1(CompiledClassV1::try_from(casm)?))
        }
    }
}

pub fn to_class_info(class: class::CompiledClass) -> Result<ClassInfo, ProgramError> {
    // TODO: @kariy not sure of the variant that must be used in this case. Should we change the
    // return type to include this case of error for contract class conversions?
    match class {
        class::CompiledClass::Legacy(class) => {
            // ...
        }
        class::CompiledClass::Class(class) => {
            // ...
        }
    }
}

Please consult with the team (e.g., @kariy) to resolve these uncertainties and update the code accordingly.


628-633: Confirm the assignment of l1_gas and l1_data_gas.

In both data_availability and total_gas_consumed, the fields l1_gas and l1_data_gas are assigned the same value:

data_availability: L1Gas {
    l1_gas: exec_info.receipt.da_gas.l1_data_gas.0 as u128,
    l1_data_gas: exec_info.receipt.da_gas.l1_data_gas.0 as u128,
},
total_gas_consumed: L1Gas {
    l1_gas: exec_info.receipt.gas.l1_data_gas.0 as u128,
    l1_data_gas: exec_info.receipt.gas.l1_data_gas.0 as u128,
},

Please verify that this is intentional and consistent with the gas calculation methodology in Cairo 2.9.2.


87-90: Verify fee calculation logic after upgrading to Cairo 2.9.2.

The fee is recalculated when info.receipt.fee == Fee(0):

let fee = if info.receipt.fee == Fee(0) {
    get_fee_by_gas_vector(block_context.block_info(), info.receipt.gas, &fee_type)
} else {
    info.receipt.fee
};

With the upgrade to Cairo 2.9.2, please ensure that this condition is appropriate and that the fee calculation accurately reflects the new transaction fee mechanics. Adjust the logic if necessary to align with the latest standards.

✅ Verification successful

Ohayo sensei!

Fee calculation logic is correct and compatible with Cairo 2.9.2

The current fee calculation implementation follows Starknet's standard fee model and remains valid after the Cairo 2.9.2 upgrade. The zero-fee check is a proper fallback mechanism that correctly utilizes block context gas prices for both ETH and STRK fee types.

🏁 Scripts executed

The following scripts were executed for the analysis:

Error: No shell scripts found


Script:

#!/bin/bash
# Find implementation of get_fee_by_gas_vector
ast-grep --pattern 'fn get_fee_by_gas_vector'

# Search for fee-related test files
fd test.*rs --exec rg -l "fee.*calculation|get_fee_by_gas"

# Search for Cairo version or upgrade related changes
rg -i "cairo.*2\.9\.2|upgrade.*cairo" -g "*.{rs,toml}"

# Look for fee-related structs and implementations
ast-grep --pattern 'struct Fee'

Length of output: 3174


Script:

#!/bin/bash
# Search for fee-related code in blockifier directory
rg -l "Fee" --type rust crates/katana/executor/src/implementation/blockifier/

# Look for fee calculation implementation
ast-grep --pattern 'fn get_fee_by_gas_vector'

# Search for transaction fee related constants or configurations
rg "fee.*type|gas.*price" crates/katana/executor/src/

# Find any fee-related imports or uses
rg "use.*fee|use.*gas" crates/katana/executor/src/implementation/blockifier/

Length of output: 7934

crates/katana/executor/Cargo.toml (2)

19-20: Dependencies look good.

The optional dependencies parking_lot and starknet are correctly re-added:

parking_lot = { workspace = true, optional = true }
starknet = { workspace = true, optional = true }

10-10: Confirm the optional katana-cairo dependency.

The katana-cairo dependency is added as optional:

katana-cairo = { workspace = true, optional = true }

Please verify that all necessary features are included when this dependency is not enabled, and that optionality does not introduce issues in dependent code.

crates/dojo/core-cairo-test/src/tests/helpers/event.cairo (1)

68-78: Improved readability with updated formatting.

The addition of a trailing comma and adjustment of the .span() method improves the readability of the namespace_def definition:

let namespace_def = NamespaceDef {
    namespace: "dojo",
    resources: [
        TestResource::Event(old_foo_event_bad_layout_type::TEST_CLASS_HASH.try_into().unwrap()),
        TestResource::Event(e_FooEventMemberRemoved::TEST_CLASS_HASH.try_into().unwrap()),
        TestResource::Event(
            e_FooEventMemberAddedButRemoved::TEST_CLASS_HASH.try_into().unwrap(),
        ),
        TestResource::Event(e_FooEventMemberAddedButMoved::TEST_CLASS_HASH.try_into().unwrap()),
        TestResource::Event(e_FooEventMemberAdded::TEST_CLASS_HASH.try_into().unwrap()),
    ]
        .span(),
};

These changes are syntactically correct and align with standard formatting practices in Rust.

Comment on lines +119 to +130
eth_gas_prices: GasPriceVector {
l1_gas_price: eth_l1_gas_price,
l1_data_gas_price: eth_l1_data_gas_price,
// TODO: update to use the correct value
l2_gas_price: eth_l1_gas_price,
},
strk_gas_prices: GasPriceVector {
l1_gas_price: strk_l1_gas_price,
l1_data_gas_price: strk_l1_data_gas_price,
// TODO: update to use the correct value
l2_gas_price: strk_l1_gas_price,
},
Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

Ohayo sensei!

The L2 gas price TODO needs proper tracking and documentation

This temporary implementation using L1 gas price for L2 appears in multiple files within the blockifier implementation. Consider:

  • Adding a tracking issue to document the rationale and future plans
  • Updating the TODO comments with a reference to the tracking issue
🔗 Analysis chain

Consider documenting the L2 gas price TODO.

The L2 gas price is temporarily using L1 gas price. This needs to be updated in the future.

Let's check if there are any related TODOs:

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for related TODOs about L2 gas prices
rg -l "TODO.*[Ll]2.*gas.*price"

Length of output: 33


Script:

#!/bin/bash
# Try different patterns to find L2 gas price related TODOs
echo "=== Searching with broader patterns ==="
rg -l "L2 gas"

echo -e "\n=== Searching in the specific file with context ==="
rg -C 2 "TODO" crates/katana/executor/src/implementation/blockifier/mod.rs

echo -e "\n=== Searching for exact comment text ==="
rg "TODO: update to use the correct value"

Length of output: 1959

@@ -114,7 +114,7 @@ jobs:
- uses: actions/checkout@v3
- uses: software-mansion/setup-scarb@v1
with:
scarb-version: "2.8.4"
scarb-version: "2.9.1"
Copy link

Choose a reason for hiding this comment

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

🛠️ Refactor suggestion

Heads up sensei! Version mismatch detected.

The Scarb version (2.9.1) in the CI workflow is behind the Cairo version (2.9.2) used in dependencies. Consider updating to 2.9.2 for consistency.

Apply this diff to align versions:

-          scarb-version: "2.9.1"
+          scarb-version: "2.9.2"
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
scarb-version: "2.9.1"
scarb-version: "2.9.2"

thiserror.workspace = true
tracing.workspace = true

blockifier = { git = "https://github.com/dojoengine/sequencer", tag = "v0.8.0-rc3.2", features = [ "testing" ], optional = true }
katana-cairo = { workspace = true, optional = true }
blockifier = { git = "https://github.com/dojoengine/sequencer", rev = "92da150d", features = [ "testing" ], optional = true }
Copy link

Choose a reason for hiding this comment

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

💡 Codebase verification

Ohayo sensei! The blockifier dependency needs attention!

The specified git revision 92da150d does not exist in the dojoengine/sequencer repository. This will cause build failures and needs to be updated to a valid commit hash.

  • Update the blockifier dependency in crates/katana/executor/Cargo.toml to use a valid and verified commit hash from the sequencer repository
🔗 Analysis chain

Verify the blockifier dependency revision and features.

The blockifier dependency is specified with a git revision and features:

blockifier = { git = "https://github.com/dojoengine/sequencer", rev = "92da150d", features = [ "testing" ], optional = true }

Ensure that this commit hash corresponds to the intended version compatible with Cairo 2.9.2, and that the correct features are enabled for your use case.

🏁 Scripts executed

The following scripts were executed for the analysis:

Error: No shell scripts found


Script:

#!/bin/bash
# Check repository root Cargo.toml for Cairo version
echo "=== Checking root Cargo.toml for Cairo version ==="
rg -A 5 "cairo" Cargo.toml || true

# Search for Cairo version specifications across the codebase
echo -e "\n=== Searching for Cairo version specifications ==="
rg -i "cairo.*[0-9]+\.[0-9]+\.[0-9]+" || true

# Look for blockifier features
echo -e "\n=== Checking blockifier features ==="
rg -A 5 "\[features\]" crates/katana/executor/Cargo.toml || true

# Examine the commit message and content
echo -e "\n=== Checking commit information ==="
git show --no-patch 92da150d || true

Length of output: 8264


Script:

#!/bin/bash
# Check if the repository exists and examine the commit
echo "=== Checking remote repository ==="
git ls-remote https://github.com/dojoengine/sequencer 92da150d || true

# Try to find blockifier dependency declarations
echo -e "\n=== Searching for blockifier dependency declarations ==="
rg -l "blockifier.*=.*" || true

# Look for testing feature usage
echo -e "\n=== Searching for testing feature usage ==="
rg -A 5 "testing.*feature" || true

Length of output: 599

Copy link

codecov bot commented Jan 8, 2025

Codecov Report

Attention: Patch coverage is 63.65915% with 145 lines in your changes missing coverage. Please review.

Project coverage is 55.51%. Comparing base (baf0ce9) to head (9f0d3c4).

Files with missing lines Patch % Lines
bin/sozo/src/commands/test.rs 0.00% 70 Missing ⚠️
crates/dojo/world/src/contracts/abigen/model.rs 0.00% 28 Missing ⚠️
...na/executor/src/implementation/blockifier/utils.rs 86.13% 28 Missing ⚠️
crates/dojo/test-utils/src/compiler.rs 0.00% 3 Missing ⚠️
...na/executor/src/implementation/blockifier/error.rs 0.00% 2 Missing ⚠️
crates/dojo/lang/src/attribute_macros/contract.rs 0.00% 1 Missing ⚠️
crates/dojo/lang/src/attribute_macros/event.rs 0.00% 1 Missing ⚠️
crates/dojo/lang/src/attribute_macros/interface.rs 0.00% 1 Missing ⚠️
crates/dojo/lang/src/attribute_macros/model.rs 0.00% 1 Missing ⚠️
crates/dojo/lang/src/derive_macros/mod.rs 0.00% 1 Missing ⚠️
... and 9 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2879      +/-   ##
==========================================
- Coverage   55.77%   55.51%   -0.26%     
==========================================
  Files         446      440       -6     
  Lines       57794    56945     -849     
==========================================
- Hits        32234    31613     -621     
+ Misses      25560    25332     -228     

☔ 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.

2 participants