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

Rename all remaining FieldElements to Felt for consistency #2433

Merged
merged 2 commits into from
Sep 16, 2024

Conversation

kariy
Copy link
Member

@kariy kariy commented Sep 16, 2024

Summary by CodeRabbit

  • New Features

    • Standardized the use of the Felt type across various components for improved consistency and performance.
  • Bug Fixes

    • Updated logic in multiple methods to handle cases where hash or nonce values are zero, returning None instead of zero.
  • Documentation

    • Enhanced clarity in the codebase by replacing FieldElement with Felt, reflecting the latest updates in the underlying data types.
  • Tests

    • Adjusted test cases to utilize the new Felt type, ensuring compatibility with recent changes.

Copy link

coderabbitai bot commented Sep 16, 2024

Walkthrough

Ohayo, sensei! This pull request primarily focuses on updating the codebase by replacing the FieldElement type from the katana_primitives crate with the Felt type. This change is applied across multiple files, affecting various structs and functions related to account management, transaction handling, and error reporting. The updates aim to standardize the use of the Felt type throughout the project.

Changes

Files Change Summary
bin/saya/src/args/mod.rs Replaced FieldElement with Felt in StarknetAccountData initialization.
bin/saya/src/args/proof.rs Updated ProofOptions struct to use Felt for world_address and fact_registry_address.
bin/saya/src/args/starknet_account.rs Changed StarknetAccountOptions struct to use Felt for signer_address and signer_key.
bin/scheduler/src/main.rs Updated CliInput struct to use Felt for world parameter.
crates/katana/controller/src/lib.rs Replaced FieldElement with Felt in add_controller_account_inner function and constants.
crates/katana/core/src/backend/mod.rs Updated Header struct to use Felt instead of FieldElement.
crates/katana/core/src/backend/storage.rs Replaced FieldElement with Felt in Genesis and Header structs.
crates/katana/core/src/service/messaging/ethereum.rs Updated various functions to use Felt instead of FieldElement.
crates/katana/core/src/service/mod.rs Changed TransactionMiner struct to use Felt for the rx field.
crates/katana/executor/benches/utils.rs Updated import statement to use Felt and modified tx() function accordingly.
crates/katana/executor/src/abstraction/error.rs Updated ExecutionError enum to use Felt instead of FieldElement.
crates/katana/executor/src/abstraction/executor.rs Changed return type of call method in ExecutorExt trait from FieldElement to Felt.
crates/katana/executor/src/abstraction/mod.rs Replaced FieldElement with Felt in EntryPointCall struct.
crates/katana/executor/src/implementation/blockifier/mod.rs Updated call method return type in ExecutorExt implementation to use Felt.
crates/katana/executor/src/implementation/blockifier/state.rs Replaced FieldElement with Felt in CachedState implementation.
crates/katana/executor/src/implementation/blockifier/utils.rs Updated return type of call function to Result<Vec<Felt>, ExecutionError>.
crates/katana/executor/src/implementation/noop.rs Changed call function to use Felt instead of FieldElement.
crates/katana/executor/tests/executor.rs Updated tests to use Felt instead of FieldElement.
crates/katana/executor/tests/fixtures/mod.rs Various updates to use Felt type.

Possibly related issues

Possibly related PRs


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 generate interesting stats about this repository and render them as a table.
    -- @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 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

codecov bot commented Sep 16, 2024

Codecov Report

Attention: Patch coverage is 83.96226% with 34 lines in your changes missing coverage. Please review.

Project coverage is 67.88%. Comparing base (069bc1a) to head (3b49bc9).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
crates/saya/core/src/lib.rs 20.00% 4 Missing ⚠️
crates/saya/core/src/prover/extract.rs 0.00% 4 Missing ⚠️
crates/saya/core/src/prover/scheduler.rs 0.00% 4 Missing ⚠️
...na/executor/src/implementation/blockifier/utils.rs 40.00% 3 Missing ⚠️
crates/katana/rpc/rpc-types/src/message.rs 0.00% 3 Missing ⚠️
crates/katana/rpc/rpc-types/src/transaction.rs 25.00% 3 Missing ⚠️
bin/saya/src/args/proof.rs 0.00% 2 Missing ⚠️
bin/saya/src/args/starknet_account.rs 0.00% 1 Missing ⚠️
bin/scheduler/src/main.rs 0.00% 1 Missing ⚠️
crates/katana/controller/src/lib.rs 75.00% 1 Missing ⚠️
... and 8 more
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2433      +/-   ##
==========================================
- Coverage   67.89%   67.88%   -0.01%     
==========================================
  Files         364      364              
  Lines       47927    47911      -16     
==========================================
- Hits        32539    32525      -14     
+ Misses      15388    15386       -2     

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

Copy link
Collaborator

@glihm glihm left a comment

Choose a reason for hiding this comment

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

Thanks for the cleanup and homogenization.

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