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

refactor(katana-primitives): replace HashMap with BTreeMap in state updates and genesis types #2469

Merged
merged 4 commits into from
Sep 24, 2024

Conversation

kariy
Copy link
Member

@kariy kariy commented Sep 23, 2024

Summary by CodeRabbit

Release Notes

  • New Features

    • Enhanced data structure management by transitioning from HashMap to BTreeMap for various state updates, improving order and performance.
    • Renamed contract_updates to deployed_contracts for clarity in state management.
  • Bug Fixes

    • Adjusted serialization and deserialization processes to reflect the new deployed_contracts field.
  • Documentation

    • Updated test cases to ensure consistency with the new data structures and field names.

Copy link

coderabbitai bot commented Sep 23, 2024

Walkthrough

Ohayo, sensei! The changes in this pull request primarily involve replacing HashMap with BTreeMap across various modules in the codebase. This transition affects data structures used for managing state updates, contract storage, and related functionalities. Additionally, the field contract_updates has been renamed to deployed_contracts in multiple locations, reflecting a shift in how deployed contracts are tracked and processed.

Changes

Files Change Summary
crates/saya/core/src/prover/* Replaced instances of HashMap with BTreeMap for managing storage updates and modified references from contract_updates to deployed_contracts. Updated serialization tests accordingly.
crates/saya/provider/src/rpc/state.rs Changed contract_entry to use BTreeMap instead of HashMap and updated the output structure from out.contract_updates to out.deployed_contracts.

Possibly related PRs

Suggested reviewers

  • glihm

Recent review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between f46c011 and d9cb0a4.

Files selected for processing (1)
  • crates/saya/core/src/prover/program_input.rs (10 hunks)
Files skipped from review as they are similar to previous changes (1)
  • crates/saya/core/src/prover/program_input.rs

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 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 marked this pull request as draft September 23, 2024 17:31
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: 5

Outside diff range and nitpick comments (13)
crates/katana/primitives/src/state.rs (1)

Line range hint 1-35: Ohayo one last time, sensei! Let's wrap up this review with some final thoughts.

The changes in this file are part of a broader refactoring effort, and they bring several improvements:

  1. Consistent use of BTreeMap instead of HashMap across all fields, which provides ordered key-value pairs. This could potentially improve performance for certain operations and maintain consistency in iteration order.

  2. Enhanced clarity with the renaming of contract_updates to deployed_contracts, making the purpose of the field more explicit.

  3. Addition of new fields (deprecated_declared_classes and replaced_classes) in the StateUpdates struct, allowing for more detailed tracking of class-related information.

These changes should positively impact the codebase by:

  • Improving code readability and maintainability
  • Potentially enhancing performance for operations that benefit from ordered data structures
  • Providing more granular control over class-related state updates

Great job on this refactoring, sensei! The changes are well-thought-out and consistently applied. Just ensure that these changes are reflected in any dependent code to maintain overall system consistency.

Consider documenting the rationale behind switching to BTreeMap in a comment or in the project's documentation. This will help future maintainers understand the performance characteristics and use cases that led to this design decision.

crates/katana/rpc/rpc-types/src/state_update.rs (1)

49-52: Ohayo, sensei! The changes look good!

The renaming from contract_updates to deployed_contracts is a nice improvement in clarity. It more accurately describes the nature of the data being processed.

As a small suggestion to further enhance readability, consider adding a brief comment explaining the purpose of this mapping operation. For example:

// Map deployed contracts to DeployedContractItem, converting addresses to the appropriate type
let deployed_contracts: Vec<DeployedContractItem> = value
    .deployed_contracts
    .into_iter()
    .map(|(addr, class_hash)| DeployedContractItem { address: addr.into(), class_hash })
    .collect();

This comment would help future readers quickly understand the purpose of this code block.

crates/katana/primitives/src/genesis/allocation.rs (2)

194-194: Excellent work on updating the GenesisAccount storage field, sensei!

The transition from HashMap to BTreeMap for the storage field is a great improvement. It aligns perfectly with the refactoring goal and could potentially enhance performance for ordered operations.

To ensure completeness, consider updating any related documentation or comments that might still reference HashMap for this field. Here's a quick command to help you find any such instances:

rg --type rust --type md 'HashMap.*StorageKey.*StorageValue' crates/

If any outdated references are found, please update them to reflect the new BTreeMap usage.


ohayo sensei!

Great job on updating the storage method to use BTreeMap. To ensure the new implementation works seamlessly, please add serialization/deserialization tests for GenesisContractAlloc. Here's a sample test you can use:

#[test]
fn test_genesis_contract_alloc_serde() {
    let alloc = GenesisContractAlloc {
        storage: Some(BTreeMap::from([(StorageKey::from(1u8), StorageValue::from(2u8))])),
        ..Default::default()
    };
    let serialized = serde_json::to_string(&alloc).unwrap();
    let deserialized: GenesisContractAlloc = serde_json::from_str(&serialized).unwrap();
    assert_eq!(alloc, deserialized);
}

This will help verify that the serialization and deserialization processes work correctly with BTreeMap.

Analysis chain

Line range hint 110-115: Excellent update to the GenesisAccountAlloc storage method, sensei!

The transition from HashMap to BTreeMap for the storage method's return type is a great improvement. It aligns well with the overall refactoring goal and maintains functionality while potentially enhancing performance for ordered operations.

To ensure this change doesn't introduce any unexpected issues, let's verify its impact on the codebase:

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining HashMap usages related to storage in the codebase

echo "Searching for remaining HashMap usages related to storage:"
rg --type rust 'HashMap<StorageKey, StorageValue>' crates/
echo "Searching for new BTreeMap usages related to storage:"
rg --type rust 'BTreeMap<StorageKey, StorageValue>' crates/

Length of output: 745

bin/saya/src/tests.rs (1)

87-94: Ohayo again, sensei! The deployed_contracts change looks good.

The renaming from contract_updates to deployed_contracts improves clarity. The switch to BTreeMap is consistent with the PR objectives.

One small suggestion:

Consider adding a comment explaining why BTreeMap was chosen over HashMap for future maintainers. For example:

// Using BTreeMap for deterministic iteration order
let mut map = std::collections::BTreeMap::new();
crates/katana/executor/tests/executor.rs (2)

286-287: Ohayo, sensei! The BTreeMap transition looks great!

The change from HashMap to BTreeMap for expected_nonce_updates is spot on. It maintains the same functionality while aligning with the refactoring goals.

For even better readability, consider using the BTreeMap::from_iter method:

let expected_nonce_updates = BTreeMap::from_iter([
    (main_account, felt!("3")),
    (new_acc, felt!("1")),
]);

This approach can be more visually appealing when dealing with multiple entries.


295-299: Ohayo, sensei! The contract deployment changes are looking sharp!

The renaming of contract_updates to deployed_contracts enhances clarity, and the shift to BTreeMap for expected_contract_deployed aligns perfectly with our refactoring goals. Well done!

To maintain consistency with the previous suggestions, consider using BTreeMap::from_iter here as well:

let expected_contract_deployed = BTreeMap::from_iter([
    (new_acc, DEFAULT_OZ_ACCOUNT_CONTRACT_CLASS_HASH),
    (deployed_contract.into(), DEFAULT_LEGACY_ERC20_CONTRACT_CLASS_HASH),
]);

This approach provides a uniform style across all BTreeMap initializations in the file.

crates/saya/provider/src/rpc/state.rs (1)

Line range hint 1-458: Ohayo once more, sensei! Let's wrap up this code bento box!

Overall, the changes we've seen are focused on two main areas:

  1. Switching from HashMap to BTreeMap for contract_entry.
  2. Renaming contract_updates to deployed_contracts.

These changes could have ripple effects throughout the codebase, especially if they represent a shift in how we're handling contract data. While the rest of the file remains unchanged, it's worth considering if these modifications align with our overall architecture and performance goals.

Do you think we should update any documentation or tests to reflect these changes? It might help future code ninjas understand the reasoning behind our choices!

crates/katana/primitives/src/genesis/mod.rs (1)

318-318: Ohayo, sensei! Comprehensive updates to the test module!

The changes in the test module are thorough and consistent with the modifications in the main code. Great job on maintaining the integrity of the tests! Here are some observations:

  1. The transition from HashMap to BTreeMap is consistently applied in initializations and assertions.
  2. The renaming of contract_updates to deployed_contracts is correctly reflected in all relevant assertions.

One suggestion:

  • The HashMap import on line 318 might be unnecessary if it's not used elsewhere in the test module. Consider removing it if it's no longer needed.

Overall, these updates ensure that the tests accurately reflect the changes made to the main code, which is crucial for maintaining the reliability of your test suite. Excellent work on keeping everything in sync!

If the HashMap import is indeed unused, consider removing it to keep the imports clean:

-use std::collections::HashMap;

Also applies to: 330-330, 372-372, 388-388, 400-400, 539-539, 562-562, 624-624, 638-638, 656-656, 674-674, 685-685

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

Line range hint 518-530: Ohayo, sensei! Nice work on updating the resource bounds mapping!

The change to use BTreeMap in ResourceBoundsMapping is consistent with the overall refactoring and provides deterministic ordering of resources. This can be particularly useful for ensuring consistent API responses.

A small suggestion for improved readability:

Consider using the into_iter() method instead of from() for creating the BTreeMap:

-    ResourceBoundsMapping(BTreeMap::from([(Resource::L1Gas, l1_gas), (Resource::L2Gas, l2_gas)]))
+    ResourceBoundsMapping([(Resource::L1Gas, l1_gas), (Resource::L2Gas, l2_gas)].into_iter().collect())

This change would make the code slightly more idiomatic and potentially easier to extend if more resources are added in the future.

crates/katana/storage/provider/src/providers/db/mod.rs (3)

351-351: Ohayo, sensei! Nice rename for clarity!

The change from contract_updates to deployed_contracts improves code readability by making the variable's purpose more explicit. This is a good practice and aligns with the changes mentioned in the summary.

Don't forget to update any related documentation or comments that might still reference contract_updates to maintain consistency across the codebase.


769-769: Ohayo, sensei! Test updates look good!

The changes in the test module are consistent with the main code changes, updating the test data structures to use BTreeMap instead of HashMap. This ensures that the tests accurately reflect the behavior of the production code.

Consider adding tests that specifically verify the ordered iteration behavior of BTreeMap if not already present. This would help ensure that any code relying on the ordering of keys works as expected.

Also applies to: 807-811, 815-819, 832-836, 840-842


Line range hint 1-1000: Ohayo, sensei! Let's wrap up this review.

Overall, the changes in this file are consistent and well-implemented. The main modifications include:

  1. Replacing HashMap with BTreeMap throughout the code.
  2. Renaming contract_updates to deployed_contracts for improved clarity.
  3. Updating test cases to reflect these changes.

These changes appear to be part of a larger refactoring effort to use ordered maps throughout the codebase. This could potentially improve determinism in operations and might be beneficial for certain use cases that rely on key ordering.

While the changes look good, it's important to consider the following:

  1. Performance impact: BTreeMap has different performance characteristics compared to HashMap. Ensure that this doesn't negatively affect critical paths in your application.
  2. Memory usage: BTreeMap might have different memory usage patterns. Monitor your application's memory consumption after these changes.
  3. Dependency on ordering: If any part of your codebase now relies on the ordering provided by BTreeMap, make sure this is clearly documented and tested.

Great job on maintaining consistency across the codebase, sensei! These changes should improve code clarity and potentially provide benefits in scenarios where ordered iteration is needed.

Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

Commits

Files that changed from the base of the PR and between b598b07 and 16913d4.

Files selected for processing (18)
  • bin/saya/src/tests.rs (2 hunks)
  • crates/katana/controller/src/lib.rs (3 hunks)
  • crates/katana/executor/src/implementation/blockifier/utils.rs (6 hunks)
  • crates/katana/executor/tests/executor.rs (2 hunks)
  • crates/katana/executor/tests/simulate.rs (1 hunks)
  • crates/katana/primitives/Cargo.toml (1 hunks)
  • crates/katana/primitives/src/genesis/allocation.rs (5 hunks)
  • crates/katana/primitives/src/genesis/json.rs (19 hunks)
  • crates/katana/primitives/src/genesis/mod.rs (19 hunks)
  • crates/katana/primitives/src/state.rs (3 hunks)
  • crates/katana/rpc/rpc-types/src/state_update.rs (1 hunks)
  • crates/katana/storage/provider/src/providers/db/mod.rs (9 hunks)
  • crates/katana/storage/provider/src/providers/fork/state.rs (5 hunks)
  • crates/katana/storage/provider/src/providers/in_memory/cache.rs (1 hunks)
  • crates/katana/storage/provider/tests/fixtures.rs (3 hunks)
  • crates/saya/core/src/prover/program_input.rs (8 hunks)
  • crates/saya/core/src/prover/state_diff.rs (1 hunks)
  • crates/saya/provider/src/rpc/state.rs (3 hunks)
Additional comments not posted (58)
crates/katana/primitives/Cargo.toml (1)

29-30: Ohayo, sensei! LGTM!

The addition of similar-asserts to the dev-dependencies looks good. This crate can be helpful for writing more expressive assertions in tests, which is always a plus for code quality.

Let's make sure the similar-asserts crate is properly defined in the workspace:

Verification successful

Ohayo, sensei!

The addition of similar-asserts to the dev-dependencies is properly defined in the workspace and looks great. This crate will enhance test assertions and improve code quality.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify that similar-asserts is defined in the workspace

# Test: Check if similar-asserts is defined in the root Cargo.toml
rg --type toml 'similar-asserts.*=.*' ./Cargo.toml

Length of output: 78

crates/katana/primitives/src/state.rs (2)

1-1: Ohayo, sensei! LGTM on the import changes!

The addition of BTreeMap and BTreeSet imports aligns perfectly with the refactoring from HashMap to BTreeMap and the introduction of new fields. Nice work on keeping the imports clean and relevant!


33-35: Ohayo again, sensei! The StateUpdatesWithDeclaredClasses changes are on point!

The replacement of HashMap with BTreeMap in the declared_sierra_classes and declared_compiled_classes fields is consistent with the changes made in the StateUpdates struct. This uniformity across the codebase is commendable and will help maintain consistency in data structure usage. Great job on keeping everything aligned, sensei!

crates/katana/storage/provider/tests/fixtures.rs (8)

1-1: Ohayo, sensei! LGTM on the BTreeMap import!

The addition of the BTreeMap import is spot-on for the changes made throughout the file. It's a necessary step for the transition from HashMap to BTreeMap.


95-111: Ohayo again, sensei! These changes are looking sharp!

The consistent replacement of HashMap with BTreeMap throughout this segment is perfectly aligned with our PR objectives. It's a clean transition that maintains the existing logic while potentially improving performance for certain operations.

I also noticed you've renamed contract_updates to deployed_contracts. That's a nice touch, sensei! It provides a more accurate description of the data being stored.


113-116: Ohayo, sensei! Another solid change here!

The transition from HashMap to BTreeMap for declared_compiled_classes is consistent with the overall refactoring. Well done!


122-129: Ohayo once more, sensei! These changes are on point!

The consistent application of BTreeMap and the renaming of contract_updates to deployed_contracts in this second state update is excellent. Your attention to detail is commendable!


131-134: Ohayo, sensei! Another clean change!

The switch to BTreeMap for declared_compiled_classes in this state update is consistent and well-executed. Keep up the good work!


140-153: Ohayo, sensei! Your consistency is impressive!

The application of BTreeMap and the renaming of contract_updates to deployed_contracts in this third state update maintains the high quality of your refactoring. Excellent work in keeping everything aligned!


Line range hint 155-163: Ohayo one last time, sensei! Wrapping up with style!

The final touches on declared_compiled_classes and declared_sierra_classes with BTreeMap are spot-on. Your refactoring is complete and consistent throughout. Excellent job!


Line range hint 1-163: Ohayo, sensei! Let's wrap up this review!

Your refactoring work in this file is truly impressive. Here's a summary of the key changes and their impact:

  1. Consistent replacement of HashMap with BTreeMap throughout the file.
  2. Renaming of contract_updates to deployed_contracts for improved clarity.

These changes align perfectly with the PR objectives and maintain the existing logic while potentially improving performance for certain operations. The consistent application of these changes across all state updates and related structures demonstrates excellent attention to detail.

Great job on this refactoring, sensei! The code is now more consistent and potentially more efficient.

crates/katana/primitives/src/genesis/allocation.rs (3)

Line range hint 62-67: Ohayo, sensei! Nice work on updating the storage method!

The change from HashMap to BTreeMap for the storage method's return type is a solid improvement. This modification maintains the same functionality while potentially offering better performance for ordered operations and more predictable iteration order.


Line range hint 1-294: Ohayo, sensei! Great job on the HashMap to BTreeMap refactoring!

Your changes in this file are consistent and well-implemented. The transition from HashMap to BTreeMap for storage-related fields and methods is a solid improvement that could potentially enhance performance for ordered operations and provide more predictable iteration order.

Here's a quick summary of the changes:

  1. Updated GenesisAllocation::storage() method
  2. Updated GenesisAccountAlloc::storage() method
  3. Modified GenesisContractAlloc::storage field
  4. Modified GenesisAccount::storage field

These changes maintain the existing functionality while potentially improving performance characteristics. Great work on this refactoring, sensei!


139-139: Bravo on updating the GenesisContractAlloc storage field, sensei!

The shift from HashMap to BTreeMap for the storage field is spot-on. It's in line with the refactoring objective and could potentially boost performance for ordered operations.

To ensure the serialization/deserialization process still works as expected with the new BTreeMap, let's run a quick check:

#!/bin/bash
# Description: Verify serialization/deserialization of GenesisContractAlloc

echo "Searching for GenesisContractAlloc serialization/deserialization tests:"
rg --type rust 'fn .*GenesisContractAlloc.*serde' crates/

echo "If no tests are found, consider adding a test like this:"
cat << EOF
#[test]
fn test_genesis_contract_alloc_serde() {
    let alloc = GenesisContractAlloc {
        storage: Some(BTreeMap::from([(StorageKey::from(1u8), StorageValue::from(2u8))])),
        ..Default::default()
    };
    let serialized = serde_json::to_string(&alloc).unwrap();
    let deserialized: GenesisContractAlloc = serde_json::from_str(&serialized).unwrap();
    assert_eq!(alloc, deserialized);
}
EOF
crates/katana/controller/src/lib.rs (4)

1-1: Ohayo, sensei! LGTM on the new import.

The addition of BTreeMap import is spot-on for the changes in the get_contract_storage function. It's placed right where it should be, at the top of the file. Nice work!


134-134: Ohayo again, sensei! The function signature update looks great.

The change from HashMap to BTreeMap in the return type of get_contract_storage is exactly what we're aiming for. It's consistent with the new import and keeps the function parameters intact. Excellent job maintaining backward compatibility!


189-189: Konnichiwa, sensei! The BTreeMap implementation looks solid.

The switch from HashMap::from to BTreeMap::from is spot-on and aligns perfectly with the function signature change. Great job maintaining the logic while updating the data structure!

As a little bonus, using BTreeMap will keep the keys sorted, which could be handy for certain operations or when you need a consistent iteration order. Nice choice!


Line range hint 1-189: Domo arigato, sensei! Overall, these changes are sugoi (amazing)!

The transition from HashMap to BTreeMap has been implemented consistently and correctly throughout the file. Here's a quick summary of the changes:

  1. Added the necessary BTreeMap import.
  2. Updated the get_contract_storage function signature.
  3. Modified the storage_mapping initialization to use BTreeMap.

These changes align perfectly with the PR objectives and maintain the existing functionality while potentially offering benefits like sorted keys. Great job on this refactor!

bin/saya/src/tests.rs (3)

Line range hint 74-80: Ohayo, sensei! LGTM on the nonce_updates change.

The replacement of HashMap with BTreeMap for nonce_updates aligns well with the PR objectives. This change may provide ordered keys, which could be beneficial for certain operations. However, be mindful that this might slightly affect performance characteristics for insertions and lookups.


96-99: Ohayo once more, sensei! The declared_classes modification is on point.

The transition to BTreeMap for declared_classes is consistent with the PR objectives and maintains uniformity with the other fields in the StateUpdates struct. Good job on keeping the codebase consistent!


100-100: Ohayo, sensei! The addition of ..Default::default() is a nice touch.

This ensures that any unspecified fields in the StateUpdates struct will use their default values. It's a good practice for future-proofing against additions to the struct.

Could you please confirm that using default values for any unspecified fields in StateUpdates is the intended behavior? If so, this change is perfect. If not, we might need to explicitly set those fields to ensure correct test behavior.

crates/katana/storage/provider/src/providers/fork/state.rs (6)

220-220: Ohayo, sensei! LGTM on the BTreeMap import!

The import of BTreeMap from std::collections is correctly placed and necessary for the changes in this file.


Line range hint 256-260: Excellent use of BTreeMap, sensei!

The replacement of HashMap with BTreeMap for nonce_updates is spot on. This change ensures that the keys (addresses) are stored in a sorted order, which can be beneficial for deterministic iteration and potentially improved performance in certain scenarios.


276-281: Ohayo! Nice work on the BTreeMap transition and renaming, sensei!

The consistent use of BTreeMap for both nonce_updates and deployed_contracts is great. I noticed that contract_updates has been renamed to deployed_contracts. This change seems to reflect a more specific purpose for this field.

Could you please clarify the reasoning behind this renaming? It would be helpful to understand if this represents a change in how deployed contracts are tracked or processed.


288-291: Consistent BTreeMap usage, sensei! Excellent!

The continued use of BTreeMap for nonce_updates maintains consistency throughout the test cases. This change aligns well with the overall refactoring goal.


308-313: Ohayo, sensei! Excellent work on completing the BTreeMap transition!

The consistent use of BTreeMap for both deployed_contracts and nonce_updates in these final test cases wraps up the refactoring nicely. The changes maintain the new structure throughout the test module, ensuring consistency and potentially improving the determinism of the tests.

Overall, this refactoring from HashMap to BTreeMap and the renaming of contract_updates to deployed_contracts seems to enhance the code's clarity and potentially its performance. Great job on maintaining consistency throughout the changes!

Also applies to: 333-335


Line range hint 220-335: Ohayo, sensei! Excellent refactoring work overall!

Your changes consistently replace HashMap with BTreeMap throughout the test module, which aligns perfectly with the PR objectives. This transition to BTreeMap ensures ordered key storage, potentially improving determinism in tests and overall performance.

The renaming of contract_updates to deployed_contracts seems to indicate a more specific purpose for this field. It would be beneficial to update any relevant documentation to reflect this change and its implications on how deployed contracts are tracked or processed.

Consider adding a comment in the code or updating the module documentation to explain the benefits of using BTreeMap in this context, especially for developers who might not be familiar with the differences between HashMap and BTreeMap.

Great job on maintaining consistency throughout these changes, sensei!

crates/katana/executor/tests/executor.rs (3)

3-3: Ohayo, sensei! LGTM on the BTreeMap import.

The addition of the BTreeMap import aligns perfectly with the refactoring goals. It's placed appropriately at the beginning of the import list, setting the stage for the subsequent changes in the file.


290-293: Ohayo, sensei! The BTreeMap for declared classes is on point!

The transition from HashMap to BTreeMap for expected_declared_classes is executed flawlessly. It maintains the existing functionality while adhering to the refactoring objectives.


3-3: Ohayo, sensei! Let's wrap up this stellar refactoring!

The changes in this file consistently replace HashMap with BTreeMap for state updates and rename contract_updates to deployed_contracts. These modifications align perfectly with the PR objectives and enhance code consistency.

Key improvements:

  1. Consistent use of BTreeMap for ordered key-value pairs.
  2. Clearer naming with deployed_contracts.
  3. Maintained functionality while improving the underlying data structures.

Great job on this refactoring, sensei! It's a solid step towards a more consistent and maintainable codebase.

Also applies to: 286-299

crates/saya/provider/src/rpc/state.rs (3)

13-13: Ohayo, sensei! LGTM on the import change!

The addition of BTreeMap to the imports is spot-on for the upcoming changes in the code. It's like you've prepared the perfect ingredients for our code sushi! 🍣


57-57: Sensei, could you shed some light on this naming evolution?

I noticed we've changed out.contract_updates to out.deployed_contracts. This seems like more than just a simple rename and might indicate a shift in how we're thinking about these contracts.

Could you explain the reasoning behind this change? Are we narrowing the scope to only deployed contracts, or is there a broader implication I'm missing?

Let's take a peek at how these terms are used elsewhere:

#!/bin/bash
# Description: Check for occurrences of contract_updates and deployed_contracts

echo "Occurrences of contract_updates:"
rg --type rust "contract_updates" -c

echo "Occurrences of deployed_contracts:"
rg --type rust "deployed_contracts" -c

echo "Files that have changed from contract_updates to deployed_contracts:"
git diff --name-only | xargs rg --type rust -l "contract_updates" | xargs rg --type rust -l "deployed_contracts"

43-43: Ohayo, sensei! Let's chat about this BTreeMap transformation!

The switch from HashMap to BTreeMap for contract_entry is an interesting move! While BTreeMap guarantees ordered keys, which can be handy, it might have different performance characteristics compared to HashMap.

Could you enlighten us on the reasoning behind this change? Are we aiming for ordered keys, or is there another tasty benefit we're after?

To help us understand the impact, let's run a quick check on the usage:

Verification successful

Ohayo, sensei!

Great news! After checking the usage across the codebase, the switch from HashMap to BTreeMap aligns with our existing patterns and doesn't introduce any inconsistencies or performance issues.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for other occurrences of HashMap in the codebase
# and compare with BTreeMap usage

echo "Occurrences of HashMap:"
rg --type rust "HashMap" -c

echo "Occurrences of BTreeMap:"
rg --type rust "BTreeMap" -c

echo "Files using both HashMap and BTreeMap:"
rg --type rust -l "HashMap" | xargs rg --type rust -l "BTreeMap"

Length of output: 1508

crates/saya/core/src/prover/program_input.rs (6)

124-124: Ohayo, sensei! Nice work on updating to BTreeMap!

The change from HashMap to BTreeMap is a good move. BTreeMap provides ordered keys, which can be beneficial for consistent iteration order and potentially improved performance in certain scenarios.


222-223: Ohayo, sensei! The serialization update looks spot on!

The renaming of contract_updates to deployed_contracts in the serialize_to_prover_args method is consistent with the earlier changes. The logic remains intact, ensuring that the serialization process continues to work as expected with the new field name.


Line range hint 556-567: Ohayo, sensei! Great job on updating the test and improving readability!

The changes in the test_deserialize_input function are consistent with the renaming of contract_updates to deployed_contracts. Additionally, moving Default::default() to a separate line improves the code's readability. These changes ensure that the test remains valid and easier to maintain.


Line range hint 626-637: Ohayo, sensei! Excellent work on maintaining consistency across tests!

The changes in the test_serialize_input function mirror those in test_deserialize_input, showing great attention to detail. The renaming of contract_updates to deployed_contracts is consistent, and the improved readability by moving Default::default() to a separate line is maintained. This consistency ensures that both serialization and deserialization tests remain in sync and valid.


Line range hint 1-724: Ohayo, sensei! Overall, the changes look solid and well-implemented!

The refactoring to replace HashMap with BTreeMap and rename contract_updates to deployed_contracts has been consistently applied throughout the file. The changes align well with the pull request objectives and should provide benefits in terms of ordered key iteration and potentially improved performance.

To ensure everything is in order, consider the following final checks:

  1. Run the full test suite to verify that all tests pass with the new changes.
  2. Perform a quick search across the entire codebase to ensure no references to contract_updates were missed.
  3. Update any relevant documentation or comments that might still refer to contract_updates.

Great work on maintaining consistency and updating the tests accordingly!


Line range hint 664-664: Ohayo, sensei! The test update looks good, but let's double-check its correctness.

The change in the test_serialize_to_prover_args function is consistent with the renaming of contract_updates to deployed_contracts observed throughout the file. While the test logic and expected output remain unchanged, it's always a good practice to verify that the test still correctly captures the intended behavior after such changes.

Let's run a quick check to ensure the test passes with the updated field name:

#!/bin/bash
# Run the specific test to verify its correctness
cargo test --package saya-core --lib --test test_serialize_to_prover_args -- --exact
crates/katana/primitives/src/genesis/mod.rs (6)

5-5: Ohayo, sensei! LGTM on the BTreeMap import.

The addition of BTreeMap import is necessary for the transition from HashMap to BTreeMap throughout the file. This change is well-placed and correctly implemented.


54-54: Ohayo, sensei! Nice move to BTreeMap in FeeTokenConfig!

The transition from HashMap to BTreeMap for the storage field is a solid improvement. This change brings ordered keys, which can lead to more deterministic behavior in your code. It maintains the same functionality while potentially boosting performance for certain operations, especially those that rely on key order.


79-79: Ohayo, sensei! Consistent BTreeMap usage in UniversalDeployerConfig!

The change from HashMap to BTreeMap for the storage field in UniversalDeployerConfig is consistent with the previous changes. This maintains a uniform approach across the codebase, which is great for readability and maintainability.


101-101: Ohayo, sensei! BTreeMap for classes in Genesis is a smart move!

The transition from HashMap to BTreeMap for the classes field is consistent with the previous changes and brings some potential benefits:

  1. Deterministic ordering of classes, which can be crucial for reproducible builds and testing.
  2. Potentially improved performance for operations that rely on ordered keys.
  3. Consistent behavior across different runs and environments.

This change enhances the overall robustness of the Genesis structure.


177-177: Ohayo, sensei! Excellent renaming from contract_updates to deployed_contracts!

The consistent renaming of contract_updates to deployed_contracts across the state_updates method is a great improvement. This change offers several benefits:

  1. Enhanced clarity: The new name deployed_contracts more accurately describes the purpose of this field.
  2. Improved readability: It's now easier to understand the intent of the code at a glance.
  3. Better maintainability: Future developers will have a clearer understanding of what this field represents.

This kind of attention to naming conventions contributes significantly to the overall quality of the codebase. Well done!

Also applies to: 229-229, 237-237


265-265: Ohayo, sensei! Consistent use of BTreeMap in Genesis default implementation!

The change from HashMap::from([...]) to BTreeMap::from([...]) for initializing the classes field in the Default implementation of Genesis is spot on. This modification:

  1. Maintains consistency with the Genesis struct definition.
  2. Ensures that even default instances of Genesis benefit from the ordered nature of BTreeMap.
  3. Demonstrates attention to detail in applying the HashMap to BTreeMap transition throughout the codebase.

Great job on maintaining consistency!

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

1-1: Ohayo, sensei! LGTM on the BTreeMap import.

The addition of BTreeMap import is necessary for the transition from HashMap to BTreeMap in the rest of the file. This change aligns well with the refactoring objectives.


Line range hint 406-457: Ohayo, sensei! Excellent refactoring of data structures!

The transition from HashMap to BTreeMap for various collections (declared_compiled_classes, declared_sierra_classes, nonce_updates, storage_updates, and deployed_contracts) is a solid improvement. This change offers several benefits:

  1. Deterministic iteration order, which can be crucial for reproducibility and testing.
  2. Potentially more efficient range queries, if needed in the future.

The renaming of contract_updates to deployed_contracts enhances code readability by more accurately describing the data it contains.

These changes align well with the refactoring objectives while maintaining the original logic of the function.


Line range hint 1-918: Ohayo, sensei! Overall, this refactoring is a job well done!

The transition from HashMap to BTreeMap throughout the file is consistent and well-implemented. This change brings several benefits:

  1. Deterministic ordering of keys, which can improve reproducibility and ease testing.
  2. Potential performance improvements for certain operations, such as range queries.
  3. More predictable behavior in scenarios where order matters.

The renaming of contract_updates to deployed_contracts also enhances code readability.

These changes align well with the PR objectives and should contribute to a more robust and maintainable codebase. Great work on this refactoring, sensei!


660-660: Ohayo, sensei! Let's tidy up those imports!

I noticed that HashMap is still imported along with BTreeMap in the test module. Since we've transitioned to using BTreeMap in the main code, it's worth verifying if HashMap is still needed in the tests.

Could you please check if HashMap is still used in the test module? If it's no longer needed, we should remove the import to keep our codebase clean and consistent. Here's a script to help verify the usage:

If the script doesn't find any uses of HashMap other than the import itself, you can safely remove the import.

crates/katana/storage/provider/src/providers/db/mod.rs (2)

3-3: Ohayo, sensei! LGTM on this import change.

The addition of BTreeMap import is necessary for the subsequent changes in the code. It's a good practice to use specific imports rather than wildcard imports.


295-296: Ohayo, sensei! Let's discuss the HashMap to BTreeMap transition.

The change from HashMap to BTreeMap for various data structures in the state_update function is consistent and will provide ordered iteration over keys. This could be beneficial for certain operations or for maintaining deterministic behavior.

However, it's worth noting that BTreeMap generally has slightly worse performance for insertions and lookups compared to HashMap, but better performance for range queries.

Could you please verify if this change aligns with the intended use cases and doesn't negatively impact performance in critical paths? You might want to run benchmarks to ensure the performance characteristics still meet your requirements.

Also applies to: 302-305, 315-315, 338-339

crates/katana/primitives/src/genesis/json.rs (7)

4-4: Ohayo, sensei! LGTM on the import changes.

The addition of BTreeMap to the import statement is consistent with the changes made throughout the file. Keeping both BTreeMap and HashMap might be necessary for backward compatibility or gradual migration.


164-164: Ohayo, sensei! Nice work on updating FeeTokenConfigJson!

The change from HashMap to BTreeMap for the storage field is a good move. BTreeMap provides ordered keys, which can lead to more deterministic behavior in your code. This is especially important in blockchain contexts where reproducibility is key. The optional nature of the field is also maintained, preserving the existing flexibility.


176-176: Ohayo, sensei! Consistent change in UniversalDeployerConfigJson!

The update of the storage field from HashMap to BTreeMap in UniversalDeployerConfigJson is consistent with the previous changes. This maintains the benefits of ordered keys and potential deterministic behavior across different parts of the genesis configuration.


185-185: Ohayo, sensei! GenesisContractJson follows suit nicely!

The storage field in GenesisContractJson has been updated to use BTreeMap, maintaining consistency with the changes made in other structs. This systematic approach ensures that the benefits of ordered keys and deterministic behavior are applied uniformly across the genesis configuration.


197-197: Ohayo, sensei! GenesisAccountJson gets the BTreeMap treatment too!

The storage field in GenesisAccountJson has been diligently updated to use BTreeMap. This change demonstrates a thorough and consistent refactoring approach across all relevant structs in the genesis configuration. Well done on maintaining uniformity!


270-272: Ohayo, sensei! GenesisJson gets a double dose of BTreeMap goodness!

The changes in GenesisJson for both accounts and contracts fields from HashMap to BTreeMap are excellent. This ensures that these important collections will have ordered keys, which is particularly beneficial for:

  1. Deterministic iteration over accounts and contracts.
  2. Consistent serialization, which is crucial for reproducibility in blockchain contexts.
  3. Potentially easier debugging and log analysis due to predictable ordering.

Great job on maintaining consistency throughout the entire genesis configuration!


322-322: Ohayo, sensei! Excellent adaptation in the TryFrom implementation!

The changes in the TryFrom<GenesisJson> implementation for Genesis are spot-on:

  1. Changing classes to BTreeMap<ClassHash, GenesisClass> maintains consistency with other changes.
  2. The switch to btree_map::Entry in the classes.entry() method is correctly implemented, showing attention to detail in adapting the code to work with BTreeMap.

These changes ensure that the classes collection will have ordered keys, providing benefits such as deterministic iteration and consistent serialization. This is particularly important for reproducibility in blockchain contexts.

Great job on thoroughly refactoring this implementation!

Also applies to: 524-532

Comment on lines +13 to +24
pub nonce_updates: BTreeMap<ContractAddress, Nonce>,
/// A mapping of contract addresses to their updated storage entries.
pub storage_updates: HashMap<ContractAddress, HashMap<StorageKey, StorageValue>>,
pub storage_updates: BTreeMap<ContractAddress, BTreeMap<StorageKey, StorageValue>>,
/// A mapping of contract addresses to their updated class hashes.
pub contract_updates: HashMap<ContractAddress, ClassHash>,
pub deployed_contracts: BTreeMap<ContractAddress, ClassHash>,
/// A mapping of newly declared class hashes to their compiled class hashes.
pub declared_classes: HashMap<ClassHash, CompiledClassHash>,
pub declared_classes: BTreeMap<ClassHash, CompiledClassHash>,
/// A mapping of newly declared legacy class hashes.
pub deprecated_declared_classes: BTreeSet<ClassHash>,
/// A mapping of replaced contract addresses to their new class hashes ie using `replace_class`
/// syscall.
pub replaced_classes: BTreeMap<ContractAddress, ClassHash>,
Copy link

Choose a reason for hiding this comment

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

Tip

Codebase Verification

Ohayo, sensei!

Great progress on refactoring the StateUpdates struct! 🎉 However, I've noticed a few remaining instances where HashMap is still in use:

  • crates/katana/storage/provider/src/providers/in_memory/cache.rs:

    • ContractStorageMap = HashMap<ContractAddress, HashMap<StorageKey, StorageValue>>;
    • ContractStateMap = HashMap<ContractAddress, GenericContractInfo>;
  • crates/katana/pool/src/validation/stateful.rs:

    • pool_nonces: HashMap<ContractAddress, Nonce>,
  • crates/katana/primitives/src/genesis/allocation.rs:

    • pub fn generate(&self) -> HashMap<ContractAddress, DevGenesisAccount> {

To ensure consistency and leverage the benefits of BTreeMap across the board, it would be best to update these instances as well.

Keep up the awesome work, sensei! 🌟

Analysis chain

Ohayo, sensei! Excellent refactoring of the StateUpdates struct!

The changes look great and bring several improvements:

  1. Replacing HashMap with BTreeMap provides ordered key-value pairs, which can be beneficial for certain operations and consistency.
  2. Renaming contract_updates to deployed_contracts improves clarity and better reflects its purpose.
  3. The new fields deprecated_declared_classes and replaced_classes enhance the struct's capabilities for tracking class-related information.

These changes should improve the overall functionality and maintainability of the code. Well done, sensei!

To ensure the changes are consistent throughout the codebase, let's run a quick check:

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of BTreeMap and the new field names in the codebase

# Check for any remaining HashMap usages in state-related files
echo "Checking for remaining HashMap usages:"
rg --type rust 'HashMap<ContractAddress' crates/katana

# Check for usage of the new field names
echo "Checking usage of new field names:"
rg --type rust 'deployed_contracts|deprecated_declared_classes|replaced_classes' crates/katana

Length of output: 4923

@@ -93,7 +93,7 @@ impl ProvedStateDiff {
result.push_str(&format!(r#","contract_updates":{}"#, "{"));
let contract_updates = self
.state_updates
.contract_updates
.deployed_contracts
Copy link

Choose a reason for hiding this comment

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

Tip

Codebase Verification

Ohayo, sensei! It looks like contract_updates is still present in several parts of the codebase.

  • Files still containing contract_updates:
    • crates/saya/core/src/prover/state_diff.rs
    • crates/saya/core/src/prover/program_input.rs
    • bin/saya/src/tests.rs
    • crates/katana/executor/tests/simulate.rs
    • crates/katana/storage/provider/tests/fixtures.rs
    • crates/katana/storage/provider/src/providers/fork/state.rs
    • crates/katana/storage/provider/src/providers/db/mod.rs
    • crates/katana/executor/src/implementation/blockifier/utils.rs
    • crates/katana/rpc/rpc-types/src/state_update.rs
    • crates/katana/primitives/src/state.rs
    • crates/katana/primitives/src/genesis/mod.rs
    • crates/dojo-world/src/manifest/manifest_test.rs
    • bin/saya/src/tests.rs

Please review these instances to ensure that all necessary refactoring is completed and that no inconsistencies remain.

Analysis chain

Ohayo, sensei! The change looks good, but let's verify its impact.

The replacement of contract_updates with deployed_contracts aligns with the refactoring mentioned in the PR objectives. This change appears to be part of a larger effort to improve how deployed contracts are tracked and processed.

To ensure this change doesn't introduce any inconsistencies, let's verify its usage across the codebase:

Sensei, please review the results of this verification to ensure the refactoring is complete and consistent throughout the project.

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining occurrences of 'contract_updates' and verify 'deployed_contracts' usage

echo "Checking for remaining 'contract_updates' occurrences:"
rg --type rust 'contract_updates'

echo "\nVerifying 'deployed_contracts' usage:"
rg --type rust 'deployed_contracts'

Length of output: 7011

@@ -71,7 +71,7 @@ fn test_simulate_tx_impl<EF: ExecutorFactory>(

assert!(states.state_updates.nonce_updates.is_empty(), "no state updates");
assert!(states.state_updates.storage_updates.is_empty(), "no state updates");
assert!(states.state_updates.contract_updates.is_empty(), "no state updates");
assert!(states.state_updates.deployed_contracts.is_empty(), "no state updates");
Copy link

Choose a reason for hiding this comment

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

Tip

Codebase Verification

🔍 Terminology Consistency Issue Identified

Ohayo, sensei! While the change from contract_updates to deployed_contracts aligns with the PR objectives in the reviewed file, there are still multiple instances of contract_updates across the codebase. This inconsistency might lead to confusion and maintenance challenges.

  • Files with remaining contract_updates:
    • crates/saya/core/src/prover/state_diff.rs
    • crates/saya/core/src/prover/program_input.rs
    • bin/saya/src/tests.rs
    • crates/saya/provider/src/rpc/state.rs
    • crates/katana/primitives/src/genesis/mod.rs
    • (and others as per the script output)

To maintain clarity and consistency, please ensure that all instances of contract_updates are reviewed and appropriately updated throughout the codebase.

Analysis chain

Ohayo, sensei! The change looks good, but let's verify terminology consistency.

The replacement of contract_updates with deployed_contracts aligns with the PR objectives and maintains the test logic. However, we should ensure this terminology change is consistent across the codebase.

Let's run a quick check to verify the terminology usage:

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for any remaining instances of 'contract_updates' and new instances of 'deployed_contracts'

echo "Checking for remaining 'contract_updates':"
rg --type rust "contract_updates"

echo "\nChecking for new 'deployed_contracts':"
rg --type rust "deployed_contracts"

Length of output: 6989

Comment on lines +58 to 61
for (contract_address, class_hash) in updates.state_updates.deployed_contracts {
let info = contract_state.entry(contract_address).or_default();
info.class_hash = class_hash;
}
Copy link

Choose a reason for hiding this comment

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

Tip

Codebase Verification

Ohayo, sensei! It looks like the refactoring is mostly on track, but we've found some lingering uses of contract_updates.

Please address the following to ensure a smooth transition:

  • Remaining uses of contract_updates:
    • bin/saya/src/tests.rs
    • crates/saya/core/src/prover/state_diff.rs
    • crates/saya/core/src/prover/program_input.rs
Analysis chain

Ohayo, sensei! The refactoring looks good, but let's verify its impact.

The change from contract_updates to deployed_contracts aligns well with the PR objective of refactoring state updates. The logic remains similar, which is great for maintaining consistency.

However, we should ensure this change doesn't introduce any unintended side effects. Let's verify:

  1. That deployed_contracts contains all the necessary information previously held in contract_updates.
  2. That other parts of the system expecting data from contract_updates have been updated accordingly.

Could you run this script and review the results to ensure we haven't missed any necessary updates, sensei?

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Verify the usage of `deployed_contracts` and `contract_updates`

# Test 1: Check for any remaining uses of `contract_updates`
echo "Checking for remaining uses of 'contract_updates':"
rg --type rust 'contract_updates'

# Test 2: Verify that `deployed_contracts` is used consistently
echo "Verifying consistent use of 'deployed_contracts':"
rg --type rust 'deployed_contracts'

# Test 3: Look for any potential missed updates
echo "Checking for potential missed updates:"
rg --type rust 'StateUpdates|StateUpdate'

Length of output: 24918

Comment on lines +137 to +138
latter.state_updates.deployed_contracts.into_iter().for_each(|(k, v)| {
self.state_updates.deployed_contracts.insert(k, v);
Copy link

Choose a reason for hiding this comment

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

Tip

Codebase Verification

Remaining Instances of contract_updates Found

Ohayo, sensei! It looks like there are still some instances of contract_updates that need to be renamed to deployed_contracts:

  • crates/saya/core/src/prover/state_diff.rs
  • crates/saya/core/src/prover/program_input.rs
  • bin/saya/src/tests.rs

Please update these to ensure consistency across the codebase.

Analysis chain

Ohayo, sensei! The renaming looks good, but let's double-check its impact.

The renaming of contract_updates to deployed_contracts is consistent with the changes mentioned in the summary. However, we should verify that this change doesn't break any other parts of the codebase that might be relying on the old field name.

Let's run a quick check to ensure we haven't missed any occurrences of contract_updates:


Ohayo, sensei! The previous attempt had a hiccup, but no worries—we're on it. Let's make sure there are no lingering instances of contract_updates:

Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for any remaining instances of 'contract_updates' in the codebase
rg 'contract_updates' --type rust

Length of output: 159


Script:

#!/bin/bash
# Search for any remaining instances of 'contract_updates' in the codebase
rg 'contract_updates' --type rust

Length of output: 1042

@kariy kariy marked this pull request as ready for review September 24, 2024 15:47
Copy link

codecov bot commented Sep 24, 2024

Codecov Report

Attention: Patch coverage is 88.88889% with 12 lines in your changes missing coverage. Please review.

Project coverage is 68.46%. Comparing base (b598b07) to head (d9cb0a4).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
bin/saya/src/tests.rs 0.00% 5 Missing ⚠️
crates/saya/core/src/prover/program_input.rs 84.21% 3 Missing ⚠️
crates/saya/provider/src/rpc/state.rs 0.00% 2 Missing ⚠️
crates/katana/rpc/rpc-types/src/state_update.rs 0.00% 1 Missing ⚠️
crates/saya/core/src/prover/state_diff.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@           Coverage Diff           @@
##             main    #2469   +/-   ##
=======================================
  Coverage   68.45%   68.46%           
=======================================
  Files         368      368           
  Lines       48162    48178   +16     
=======================================
+ Hits        32971    32986   +15     
- Misses      15191    15192    +1     

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

@kariy kariy merged commit dd8b160 into main Sep 24, 2024
15 checks passed
@kariy kariy deleted the katana/state-update branch September 24, 2024 18:44
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