Skip to content

Conversation

kariy
Copy link
Member

@kariy kariy commented Jul 30, 2025

Updates all Starknet RPC client to RPC v0.9.0-rc.2. This upgrade requires using starknet crate version 0.17.0-rc.2.

Upstream dependencies whose starknet version that has been updated to 0.17.0-rc.2:

  • slot
  • katana-runner
  • cainome

@kariy kariy marked this pull request as ready for review August 7, 2025 21:31
Copy link
Contributor

coderabbitai bot commented Aug 7, 2025

Walkthrough

The changes consistently update the default block tag used across the codebase from Pending to PreConfirmed for blockchain state queries, contract interactions, and account operations. Several dependency versions and workspace configurations are updated, along with adjustments to provider trait signatures and workflow scripts. No new features or major logic changes are introduced.

Changes

Cohort / File(s) Change Summary
Workflow Update
.github/workflows/test.yml
Updated Katana binary version from v1.6.2 to v1.7.0-alpha.0 for integration tests.
Dependency and Workspace Config
Cargo.toml
Reordered workspace members and dependencies. Updated dependencies: switched cainome and cainome-cairo-serde to fixed revisions, katana-runner and slot to branch tracking, upgraded starknet and starknet-crypto, removed several [patch.crates-io] overrides.
Sozo Command Block Tag
bin/sozo/src/commands/call.rs,
bin/sozo/src/commands/events.rs,
bin/sozo/src/commands/model.rs
Changed the default block tag used in command operations from Pending to PreConfirmed for calls, events, and model queries.
Sozo Account Options
bin/sozo/src/commands/options/account/mod.rs
Updated the block tag for account creation from Pending to PreConfirmed.
Provider Trait and Types
bin/sozo/src/commands/options/account/provider.rs
Changed provider trait method signatures and return types from "MaybePending" to "MaybePreConfirmed" variants; updated trait bounds and message types accordingly.
Dojo Utils Block Tag
crates/dojo/utils/src/tx/declarer.rs,
crates/dojo/utils/src/tx/deployer.rs,
crates/dojo/utils/src/tx/mod.rs,
crates/dojo/utils/src/tx/waiter.rs
Replaced all uses of Pending block tag with PreConfirmed in contract declaration, deployment, block ID parsing, account retrieval, transaction waiting logic, and related tests.
Dojo World Contract Defaults
crates/dojo/world/src/contracts/abigen/model.rs,
crates/dojo/world/src/contracts/abigen/world.rs
Changed default block tag in contract and contract reader constructors from Pending to PreConfirmed.
World Contract Deployment Check
crates/dojo/world/src/diff/mod.rs,
crates/dojo/world/src/remote/events_to_remote.rs
Updated contract class hash queries to use PreConfirmed block tag instead of Pending when checking deployment status.
Sozo Model Ops
crates/sozo/ops/src/model.rs
Set block tag to PreConfirmed for model class hash and contract address reads.
Balance Verification Script
scripts/verify_db_balances/src/main.rs
Changed block tag from Pending to PreConfirmed in ERC20 and ERC721 balance queries.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant CLI/Script
    participant Provider
    participant StarknetNode

    User->>CLI/Script: Issue command/query (e.g., call, deploy, get balance)
    CLI/Script->>Provider: Prepare request with BlockTag::PreConfirmed
    Provider->>StarknetNode: Query state at PreConfirmed block
    StarknetNode-->>Provider: Return result for PreConfirmed block
    Provider-->>CLI/Script: Deliver result
    CLI/Script-->>User: Output result
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~15–20 minutes

Suggested reviewers

  • glihm

Note

🔌 MCP (Model Context Protocol) integration is now available in Early Access!

Pro users can now connect to remote MCP servers under the Integrations page to get reviews and chat conversations that understand additional development context.


📜 Recent review details

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

📥 Commits

Reviewing files that changed from the base of the PR and between fe11210 and 4d609a0.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (17)
  • .github/workflows/test.yml (1 hunks)
  • Cargo.toml (8 hunks)
  • bin/sozo/src/commands/call.rs (1 hunks)
  • bin/sozo/src/commands/events.rs (1 hunks)
  • bin/sozo/src/commands/model.rs (3 hunks)
  • bin/sozo/src/commands/options/account/mod.rs (1 hunks)
  • bin/sozo/src/commands/options/account/provider.rs (8 hunks)
  • crates/dojo/utils/src/tx/declarer.rs (1 hunks)
  • crates/dojo/utils/src/tx/deployer.rs (1 hunks)
  • crates/dojo/utils/src/tx/mod.rs (2 hunks)
  • crates/dojo/utils/src/tx/waiter.rs (3 hunks)
  • crates/dojo/world/src/contracts/abigen/model.rs (2 hunks)
  • crates/dojo/world/src/contracts/abigen/world.rs (2 hunks)
  • crates/dojo/world/src/diff/mod.rs (1 hunks)
  • crates/dojo/world/src/remote/events_to_remote.rs (1 hunks)
  • crates/sozo/ops/src/model.rs (2 hunks)
  • scripts/verify_db_balances/src/main.rs (2 hunks)
🧰 Additional context used
🧠 Learnings (3)
📚 Learning: 2024-11-07T14:43:23.530Z
Learnt from: glihm
PR: dojoengine/dojo#2650
File: crates/dojo/utils/src/tx/mod.rs:201-272
Timestamp: 2024-11-07T14:43:23.530Z
Learning: In `crates/dojo/utils/src/tx/mod.rs`, fee token configurations are verified when the `fee_config` is built, making additional validations in the `send_with_cfg` methods redundant.

Applied to files:

  • crates/dojo/utils/src/tx/declarer.rs
  • crates/dojo/world/src/remote/events_to_remote.rs
  • crates/dojo/world/src/diff/mod.rs
  • crates/dojo/utils/src/tx/deployer.rs
  • scripts/verify_db_balances/src/main.rs
  • crates/dojo/utils/src/tx/waiter.rs
  • crates/dojo/utils/src/tx/mod.rs
  • bin/sozo/src/commands/options/account/provider.rs
📚 Learning: 2024-11-07T13:57:57.616Z
Learnt from: glihm
PR: dojoengine/dojo#2650
File: bin/sozo/src/commands/migrate.rs:64-65
Timestamp: 2024-11-07T13:57:57.616Z
Learning: In the codebase, the use of `into()` and `try_into()` for converting `TransactionOptions` is intentional. Conversions that may fail use `try_into()`, while those that cannot fail use `into()`. This approach is appropriate and should be preserved.

Examples:
- `try_into()` is used in `bin/sozo/src/commands/migrate.rs` and `bin/sozo/src/commands/execute.rs` where conversions can fail.
- `into()` is used in `bin/sozo/src/commands/register.rs` and `bin/sozo/src/commands/auth.rs` where conversions are infallible.

Applied to files:

  • bin/sozo/src/commands/options/account/mod.rs
  • crates/dojo/utils/src/tx/waiter.rs
  • Cargo.toml
  • bin/sozo/src/commands/options/account/provider.rs
📚 Learning: 2024-11-05T04:30:12.852Z
Learnt from: glihm
PR: dojoengine/dojo#2633
File: crates/dojo/world/src/contracts/abigen/world.rs:3809-0
Timestamp: 2024-11-05T04:30:12.852Z
Learning: Code in `crates/dojo/world/src/contracts/abigen/` is auto-generated and should be excluded from code reviews.

Applied to files:

  • crates/dojo/world/src/remote/events_to_remote.rs
  • crates/dojo/world/src/diff/mod.rs
  • crates/dojo/world/src/contracts/abigen/model.rs
  • Cargo.toml
  • crates/dojo/world/src/contracts/abigen/world.rs
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: fmt
🔇 Additional comments (28)
.github/workflows/test.yml (1)

77-77: Ohayo! LGTM on the Katana version bump, sensei!

The update from v1.6.2 to v1.7.0-alpha.0 aligns perfectly with the JSON-RPC spec v0.9.0-rc.2 upgrade objective. The URL and version string are consistently updated.

crates/sozo/ops/src/model.rs (2)

20-20: Ohayo sensei! Block tag update looks solid!

The change from BlockTag::Pending to BlockTag::PreConfirmed is consistent with the JSON-RPC spec v0.9.0-rc.2 upgrade across the codebase.


38-38: Consistent block tag update here too, sensei!

Both model operations functions now use the updated PreConfirmed block tag, maintaining consistency across the model reading operations.

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

111-111: Ohayo! Default block tag update is on point, sensei!

The fallback block ID now correctly defaults to PreConfirmed instead of Pending, ensuring consistency with the JSON-RPC v0.9.0-rc.2 update across the codebase.

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

179-179: Ohayo sensei! Event processing block tag is properly updated!

The fallback to BlockTag::PreConfirmed when no block number is available maintains consistency with the JSON-RPC spec v0.9.0-rc.2 update pattern throughout the codebase.

crates/dojo/world/src/diff/mod.rs (1)

173-173: Ohayo! World deployment check is updated properly, sensei!

The block tag update from Pending to PreConfirmed in the world deployment check aligns perfectly with the JSON-RPC v0.9.0-rc.2 specification update. The deployment detection logic remains intact.

bin/sozo/src/commands/options/account/mod.rs (1)

135-135: Ohayo sensei! LGTM on the block tag update.

This change correctly updates the account's block ID to use PreConfirmed instead of Pending, maintaining consistency with the JSON-RPC spec v0.9.0-rc.2 migration across the codebase.

scripts/verify_db_balances/src/main.rs (1)

33-33: Ohayo sensei! Block tag updates look solid.

Both ERC20 and ERC721 balance queries correctly updated to use PreConfirmed instead of Pending, maintaining consistency with the JSON-RPC spec migration across the codebase.

Also applies to: 53-53

bin/sozo/src/commands/model.rs (3)

167-167: Ohayo sensei! Default block tag updates are consistent.

The Layout subcommand correctly updates its fallback block tag to PreConfirmed, maintaining consistency with the JSON-RPC spec migration.


184-184: Schema subcommand block tag update looks good.

Consistent with other changes, the default block tag is properly updated to PreConfirmed while preserving the existing conditional logic.


202-202: Get subcommand follows the same pattern, sensei.

The block tag update to PreConfirmed maintains consistency across all model subcommands and aligns with the broader codebase migration.

crates/dojo/utils/src/tx/deployer.rs (1)

108-108: Ohayo sensei! Deployment check block tag update approved.

The is_deployed function correctly updates to use PreConfirmed instead of Pending for contract deployment verification, maintaining consistency with the JSON-RPC spec migration while preserving all existing logic and error handling.

crates/dojo/world/src/remote/events_to_remote.rs (1)

49-50: Ohayo sensei! World contract existence check updated properly.

The block tag change to PreConfirmed for verifying world contract existence maintains consistency with the JSON-RPC spec migration while preserving all existing control flow and error handling logic.

crates/dojo/utils/src/tx/declarer.rs (1)

138-138: Ohayo sensei! LGTM on the block tag update.

This change from Pending to PreConfirmed aligns perfectly with the JSON-RPC spec bump to v0.9.0-rc.2. The function logic remains sound - we're still checking if a class is declared, just at a different block state for consistency across the codebase.

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

1-840: Ohayo sensei! Skipping review of auto-generated code.

This file is auto-generated by cainome (as indicated in the header), and per our established learnings, auto-generated code in crates/dojo/world/src/contracts/abigen/ should be excluded from code reviews.

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

15-22: Ohayo sensei – auto-generated file, skipping detailed review

crates/dojo/world/src/contracts/abigen/ is produced by code-gen tools, so we purposely avoid line-level comments here.
No manual action required on this diff.

Also applies to: 44-51

crates/dojo/utils/src/tx/mod.rs (2)

194-195: LGTM! Ohayo sensei!

The string mapping update from "pending" to "preconfirmed" correctly aligns with the JSON-RPC v0.9.0-rc.2 specification changes.


260-260: Consistent block tag update!

The change to use BlockTag::PreConfirmed for predeployed accounts is consistent with the broader migration across the codebase.

crates/dojo/utils/src/tx/waiter.rs (3)

138-138: Perfect migration to PreConfirmed semantics, sensei!

The receipt block handling correctly updates to use PreConfirmed while maintaining the same evaluation logic.


210-218: Solid transaction status handling update!

The polling logic now correctly includes PreConfirmed status alongside the existing statuses, maintaining proper transaction flow.


354-354: Test helper properly updated!

The mock receipt function correctly uses PreConfirmed to align with the updated semantics.

Cargo.toml (3)

88-89: Nice katana-runner branch update, sensei!

The switch to "rpc/v0.9" branch properly aligns with the JSON-RPC specification upgrade.


244-245: Critical starknet dependency upgrade!

Ohayo! The upgrade to starknet 0.17.0-rc.2 and starknet-crypto 0.7.4 provides the necessary types and functionality for the PreConfirmed block semantics migration.


226-226: Consistent slot dependency update!

The branch change to "feat/rpc0.9" maintains compatibility with the JSON-RPC specification changes.

bin/sozo/src/commands/options/account/provider.rs (4)

41-41: Provider API signature properly updated, sensei!

Ohayo! The return type change to MaybePreConfirmedBlockWithTxHashes correctly aligns with the starknet 0.17.0-rc.2 API.


54-54: Consistent MaybePreConfirmed type migration!

All the block-related method signatures are correctly updated to use the new PreConfirmed variants while maintaining the same delegation logic.

Also applies to: 67-67, 80-80


110-110: Message handling types updated correctly!

The changes from Vec<MessageWithStatus> to Vec<MessageStatus> and FeeEstimate to MessageFeeEstimate properly reflect the updated starknet API.

Also applies to: 257-257


432-432: Trait bound update for confirmed blocks!

The constraint change to AsRef<ConfirmedBlockId> for trace_block_transactions correctly restricts to confirmed blocks only.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/rpc0.9

🪧 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.
    • 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.
  • 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.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for 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.

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.

@kariy kariy merged commit 451951f into main Aug 13, 2025
10 checks passed
@kariy kariy deleted the feat/rpc0.9 branch August 13, 2025 07:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant