Skip to content

Update to Starknet 0.14#802

Merged
FabijanC merged 66 commits intomainfrom
starknet-0.14
Jul 14, 2025
Merged

Update to Starknet 0.14#802
FabijanC merged 66 commits intomainfrom
starknet-0.14

Conversation

@FabijanC
Copy link
Copy Markdown
Contributor

@FabijanC FabijanC commented Jun 20, 2025

Usage related changes

  • Close Starknet 0.14 adaptation #792
  • Released v0.5.0-rc.0 and v0.5.0-rc.1
    • Re-enabled publishing to crates.io
  • Support only JSON-RPC API v0.9.0-rc.2
    • Not using new RPC errors: REPLACEMENT_TRANSACTION_UNDERPRICED (code 64) nor FEE_BELOW_MINIMUM (code 65).
  • Increment required Rust version: 1.86
  • Replace pending block with pre-confirmed (not applicable to the default mode --block-generation-on transaction)
    • Contains pre-confirmed transactions with PRE_CONFIRMED status, unlike the transactions in pending block which were ACCEPTED_ON_L2.
  • Transaction replacement via higher fee not possible.
  • In --block-generation-on demand or <INTERVAL> (i.e. if storing txs in a pre-confirmed block before mining), invoke and deploy-account transactions do not perform strict nonce checks.
    • This means that if nonce n is expected, you may send any integer >= n.
  • Modify block ID deserialization error message.
  • Use hardcoded value for tip in fee estimation: 0 fri.

Development related changes

  • Partly reduce dependence on starknet-rs types.
    • Still depend on starknet-rs BlockId, use the existing wrapper with custom deserialization
    • Updated deserialization to map pre_confirmed to the Pending variant of the ImportedBlockId (starknet-rs BlockId) enum.
  • Expand testing: nonce increment, receipt properties
  • Improve spec test error message.
  • Regarding the mention of fee estimation mismatch:
    • Caused one failing test - the test was modified to pass - using an experimantally confirmed value.
    • Pending resolution on Slack, consider opening a GitHub issue.
  • Modify conversion of PatriciaKey, ContractAddress, StorageKey to use From instead of TryFrom.

Checklist:

  • Check nonce supersession and new RPC errors.
  • Checked out the contribution guidelines
  • Applied formatting - ./scripts/format.sh
  • No linter errors - ./scripts/clippy_check.sh
  • No unused dependencies - ./scripts/check_unused_deps.sh
  • No spelling errors - ./scripts/check_spelling.sh
  • Performed code self-review
  • Rebased to the latest commit of the target branch (or merged it into my branch)
    • Once you make the PR reviewable, please avoid force-pushing
  • Updated the docs if needed - ./website/README.md
  • Linked the issues resolvable by this PR - linking info
  • Updated the tests if needed; all passing - execution info

Summary by CodeRabbit

  • New Features

    • Introduced the "pre_confirmed" block tag, replacing the previous "pending" concept throughout the application and API.
    • Added stricter nonce validation for transactions, aligning with updated Starknet 0.14 behavior.
    • Enhanced transaction and message status responses with new execution and finality status fields.
    • Included a minimal tip in fee estimations.
  • Improvements

    • Updated to Rust 1.86.0 and upgraded multiple dependencies for better compatibility and performance.
    • Enhanced error messages and test coverage for block and transaction handling.
    • Improved documentation to reflect new block tag terminology and behaviors.
  • Bug Fixes

    • Corrected block tag handling in API endpoints, documentation, and test cases to ensure consistency with the new "pre_confirmed" state.
  • Chores

    • Updated CI configuration, Dockerfile, and .gitignore for improved development workflow and build consistency.
    • Refactored codebase and tests to adopt the "pre_confirmed" terminology.
  • Documentation

    • Revised user documentation and API schema to reference "pre_confirmed" blocks instead of "pending".

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Jun 20, 2025

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

This pull request implements a comprehensive adaptation of the codebase to Starknet 0.14. Key changes include updating all references to the "pending" block/state/transaction concept to "pre_confirmed", introducing corresponding data structures and status enums, and enforcing stricter nonce validation consistent with Starknet 0.14 semantics. The update also bumps core dependency versions (e.g., starknet_api, blockifier, cairo-vm, cairo-lang-*), aligns constants and configuration values with Starknet 0.14, and updates the JSON-RPC API, error handling, and test expectations. Documentation and API schemas are revised to reflect the new "pre_confirmed" terminology. Additional test coverage is added for nonce handling and block status transitions.


Assessment against linked issues

Objective Addressed Explanation
Update all "pending" block/state/transaction concepts to "pre_confirmed" (structs, enums, API, docs) (#792)
Enforce Starknet 0.14 nonce semantics: strict nonce checks for declare/invoke/deploy, block generation modes (#792)
Update core dependencies, constants, and configuration to match Starknet 0.14 (#792)
Update JSON-RPC API, error handling, and test cases for "pre_confirmed" and new statuses (#792)

Assessment against linked issues: Out-of-scope changes

Code Change Explanation
Addition of MINIMAL_TIP constant in tests/integration/common/constants.rs This is a test utility for fee calculations and is not directly required for Starknet 0.14 adaptation, though it is used in related test updates.
Improved error message in crates/starknet-devnet-server/src/api/json_rpc/spec_reader/data_generator.rs Enhanced error context for schema generation is unrelated to the Starknet 0.14 adaptation objectives.
Removal of Serialize derive from EventFilter and GetStorageInput structs Serialization trait removal is not explicitly required by Starknet 0.14 adaptation.
Refactoring of test loop indices and error messages in crates/starknet-devnet-server/src/api/json_rpc/spec_reader/mod.rs Test loop improvements and error detail enhancements are not part of the adaptation objective.

Possibly related PRs

  • 0xSpaceShard/starknet-devnet#787: Refactors the get_events function and event retrieval logic, which overlaps with this PR's changes to block status handling in event queries, though the focus differs (forking/event pagination vs. block status semantics).

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

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.

@FabijanC FabijanC merged commit ce85ab2 into main Jul 14, 2025
2 checks passed
@FabijanC FabijanC deleted the starknet-0.14 branch July 14, 2025 12:33
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.

Starknet 0.14 adaptation

1 participant