Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(katana): implement more feeder gateway types #2744

Merged
merged 15 commits into from
Dec 2, 2024

Conversation

kariy
Copy link
Member

@kariy kariy commented Dec 1, 2024

ref #639

initially, i wanted to deserialize the transaction data from the fgw client directly into the primitive transaction types. but because on v3 transaction, the type DataAvailabilityMode (ie nonce_data_availability_mode and fee_data_availability_mode fields) has different serde implementation than what is expected from the fgw client. changing the serde impl to match the client would require breaking the database format which should never be taken too lightly.

im pretty sure its possible to change the serde impl of DataAvailabilityMode to both (1) maintain the impl expected by the current db format, and (2) deserialize from the fgw impl. but havent gone too deeply into this yet and might require a relatively complex Deserialize impl. so i chose the easiest path for now.

Summary by CodeRabbit

Release Notes

  • New Features

    • Introduced support for a new transaction variant, InvokeTx::V0, enhancing transaction handling capabilities.
    • Added new data structures for transaction receipts and types, including ConfirmedReceipt and ConfirmedTransaction.
    • Enhanced block representation with a new Block struct, providing detailed block information.
    • Added EntryPointSelector to improve transaction handling flexibility.
  • Bug Fixes

    • Improved error handling for unsupported transaction versions in the transaction pool.
  • Documentation

    • Updated method names for clarity and consistency across the codebase, such as renaming with_query_param to add_query_param.
  • Refactor

    • Streamlined transaction processing logic and serialization attributes for better data handling.

@kariy kariy marked this pull request as ready for review December 2, 2024 19:15
Copy link

coderabbitai bot commented Dec 2, 2024

Walkthrough

Ohayo, sensei! This pull request introduces significant modifications across several files in the Katana project, primarily focusing on enhancing transaction handling and data structures. Key changes include the addition of new transaction variants, such as InvokeTx::V0, and the introduction of the EntryPointSelector for improved transaction execution. Method names in the RequestBuilder struct have been updated for clarity, and new data structures like ConfirmedReceipt and Block have been defined. Overall, these changes refine the transaction processing capabilities and improve the data model within the Katana framework.

Changes

File Path Change Summary
crates/katana/executor/src/implementation/blockifier/utils.rs Added EntryPointSelector to imports; updated to_executor_tx for InvokeTx::V0; modified call function to use EntryPointSelector.
crates/katana/feeder-gateway/src/client.rs Renamed with_query_param to add_query_param; updated method calls in get_state_update_with_block, get_class, and get_compiled_class; adjusted tests for new method name.
crates/katana/feeder-gateway/src/types/mod.rs Added new imports; replaced Block type with BlockStatus; defined new Block struct; updated StateUpdateWithBlock to use the new Block struct.
crates/katana/feeder-gateway/src/types/receipt.rs Introduced new ConfirmedReceipt struct with fields for transaction details.
crates/katana/feeder-gateway/src/types/transaction.rs Added ConfirmedTransaction, TypedTransaction, DataAvailabilityMode, RawInvokeTx, RawDeclareTx, RawDeployAccountTx, and TxTryFromError; implemented conversions for various transaction types.
crates/katana/pool/src/tx.rs Updated PoolTransaction trait methods for ExecutableTxWithHash to handle InvokeTx::V0; specified responses for unsupported transaction versions.
crates/katana/primitives/src/block.rs Enhanced GasPrices struct with new serialization attributes; added deserialize_u128 and deserialize_u64 functions for custom deserialization.
crates/katana/primitives/src/fee.rs Updated ResourceBounds fields for custom deserialization; added l1_gas and l2_gas fields to ResourceBoundsMapping.
crates/katana/primitives/src/transaction.rs Expanded transaction types with DeployTx and InvokeTxV0; added chain_id field to several transaction structs; updated calculate_hash methods.
crates/katana/rpc/rpc-types/src/transaction.rs Added InvokeTx::V0 to From<TxWithHash> implementation; updated handling for InternalTx::Deploy and other transaction types.

Possibly related PRs

Suggested reviewers

  • Larkooo
  • glihm
  • steebchen

Feel free to reach out if you need further details or clarifications, sensei!


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

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🧹 Outside diff range and nitpick comments (9)
crates/katana/feeder-gateway/src/types/transaction.rs (2)

30-38: Ohayo, sensei! Consider refactoring to avoid redundant definition of DataAvailabilityMode.

Defining DataAvailabilityMode again can lead to maintenance challenges. Perhaps explore ways to unify the serde implementations or use feature flags to prevent code duplication.


244-245: Ohayo, sensei! Enhance readability by defining constants for transaction versions.

Using Felt::ZERO, Felt::ONE, and Felt::THREE directly can be unclear. Defining constants like const VERSION_0: Felt = Felt::ZERO; improves code clarity and reduces potential errors.

Also applies to: 254-255, 263-264

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

Line range hint 98-98: Ohayo, sensei! Safeguard against potential overflow when casting initial_gas.

Casting initial_gas from u128 to u64 might overflow if the value exceeds u64::MAX. Consider validating initial_gas or handling values that are too large.

crates/katana/feeder-gateway/src/types/receipt.rs (1)

8-22: Ohayo! Add documentation for the ConfirmedReceipt struct and its fields, sensei!

While the implementation looks solid, adding documentation would help other developers understand:

  • The purpose of ConfirmedReceipt
  • When each optional field is expected to be present/absent
  • The relationship between execution_status and revert_error

Example documentation:

/// Represents a confirmed transaction receipt containing execution details and messages
pub struct ConfirmedReceipt {
    /// The unique identifier of the transaction
    pub transaction_hash: Felt,
    /// The position of the transaction within its block
    pub transaction_index: u64,
    // ... (continue for other fields)
}
crates/katana/feeder-gateway/src/types/mod.rs (1)

75-98: Ohayo! Consider adding timestamp validation and documentation, sensei!

The Block struct looks well-designed, but consider these improvements:

  1. Add validation for the timestamp field to ensure it's not in the future
  2. Add documentation explaining the relationship between optional and required fields

Example implementation:

impl Block {
    /// Validates block timestamp is not in the future
    pub fn validate_timestamp(&self) -> Result<(), &'static str> {
        let current_time = std::time::SystemTime::now()
            .duration_since(std::time::UNIX_EPOCH)
            .unwrap()
            .as_secs();
        if self.timestamp > current_time {
            return Err("Block timestamp cannot be in the future");
        }
        Ok(())
    }
}
crates/katana/pool/src/tx.rs (1)

156-158: LGTM! Consider adding documentation about fee behavior

The implementation correctly handles the absence of max_fee in V0 and V3 by returning 0.

Consider adding a doc comment explaining why these versions return 0 and any implications for transaction processing.

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

66-72: LGTM! Consider adding format documentation

The serde aliases and custom deserialization improve compatibility.

Consider adding a doc comment specifying the expected string formats (e.g., "0x"-prefixed hex or decimal).


94-104: Ohayo! Consider using generics to reduce code duplication

The deserialize_u64 function is nearly identical to deserialize_u128.

Consider using a generic implementation:

-pub fn deserialize_u128<'de, D>(deserializer: D) -> Result<u128, D::Error>
-where
-    D: serde::Deserializer<'de>,
-{
-    let s = String::deserialize(deserializer)?;
-    if let Some(hex) = s.strip_prefix("0x") {
-        u128::from_str_radix(hex, 16).map_err(serde::de::Error::custom)
-    } else {
-        s.parse::<u128>().map_err(serde::de::Error::custom)
-    }
-}
-
-pub fn deserialize_u64<'de, D>(deserializer: D) -> Result<u64, D::Error>
+pub fn deserialize_number<'de, D, T>(deserializer: D) -> Result<T, D::Error>
where
    D: serde::Deserializer<'de>,
+   T: std::str::FromStr + From<u8>,
+   <T as std::str::FromStr>::Err: std::fmt::Display,
{
    let s = String::deserialize(deserializer)?;
    if let Some(hex) = s.strip_prefix("0x") {
-        u64::from_str_radix(hex, 16).map_err(serde::de::Error::custom)
+        T::from_str_radix(hex, 16).map_err(serde::de::Error::custom)
    } else {
-        s.parse::<u64>().map_err(serde::de::Error::custom)
+        s.parse::<T>().map_err(serde::de::Error::custom)
    }
}
crates/katana/rpc/rpc-types/src/transaction.rs (1)

Line range hint 579-582: Consider addressing the architectural TODO, sensei

The TODO comment suggests moving away from starknet-rs RPC types for more flexibility. This architectural change could reduce the need for type conversions and improve maintainability.

Consider:

  1. Defining custom RPC types within Katana
  2. Implementing direct conversions to/from these types
  3. Using these types as the primary interface
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 3ba53c8 and c2eb889.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (12)
  • crates/katana/executor/src/implementation/blockifier/utils.rs (2 hunks)
  • crates/katana/feeder-gateway/Cargo.toml (1 hunks)
  • crates/katana/feeder-gateway/src/client.rs (6 hunks)
  • crates/katana/feeder-gateway/src/types/mod.rs (2 hunks)
  • crates/katana/feeder-gateway/src/types/receipt.rs (1 hunks)
  • crates/katana/feeder-gateway/src/types/transaction.rs (1 hunks)
  • crates/katana/pool/src/tx.rs (4 hunks)
  • crates/katana/primitives/src/block.rs (3 hunks)
  • crates/katana/primitives/src/da/mod.rs (1 hunks)
  • crates/katana/primitives/src/fee.rs (1 hunks)
  • crates/katana/primitives/src/transaction.rs (16 hunks)
  • crates/katana/rpc/rpc-types/src/transaction.rs (2 hunks)
🔇 Additional comments (13)
crates/katana/feeder-gateway/src/types/transaction.rs (1)

1-10: Ohayo, sensei! The initial imports and definitions look solid.

The necessary modules and structs are correctly imported, establishing a good foundation for the transaction types.

crates/katana/primitives/src/transaction.rs (1)

56-56: Ohayo, sensei! Remember to handle the new Deploy variant in all match statements.

With Deploy(DeployTx) added to the Tx enum, ensure all pattern matches are updated to include this variant to prevent runtime issues.

crates/katana/feeder-gateway/Cargo.toml (1)

15-15: Ohayo, sensei! The addition of serde_json dependency is well-placed.

Including serde_json will aid in JSON serialization tasks, enhancing the feeder-gateway's capabilities.

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

22-23: ⚠️ Potential issue

Ohayo, sensei! Be cautious with changes to DataAvailabilityMode serialization.

Assigning integer values and removing serde renames might alter the serialized form, possibly affecting backward compatibility. Please verify that this modification doesn't disrupt existing data deserialization.

crates/katana/primitives/src/fee.rs (1)

8-12: Ohayo! Verify numeric bounds handling, sensei!

The implementation looks solid with proper type constraints. Let's verify the deserialization handles numeric bounds correctly.

✅ Verification successful

Let me check the actual deserializer implementations to verify the numeric bounds handling.


Ohayo! The numeric bounds are properly handled, sensei!

The deserialization implementation is secure and handles bounds correctly through Rust's native parsing:

  • For u128: Uses u128::from_str_radix for hex and parse::<u128>() for decimal
  • For u64: Uses u64::from_str_radix for hex and parse::<u64>() for decimal

These native parsing methods automatically enforce type bounds and return errors for any out-of-range values. The implementation supports both hexadecimal (with "0x" prefix) and decimal formats while maintaining type safety.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for numeric bound checks in deserializer implementations
rg -A 5 "deserialize_u(64|128)" 

Length of output: 5910


Script:

#!/bin/bash
# Let's examine the deserializer implementations
cat crates/katana/primitives/src/block.rs | grep -A 20 "pub fn deserialize_u"

Length of output: 1164

crates/katana/feeder-gateway/src/types/mod.rs (1)

94-95: Verify transaction and receipt count consistency, sensei!

Ensure that transactions and transaction_receipts vectors maintain consistent lengths and ordering.

crates/katana/pool/src/tx.rs (2)

176-179: LGTM! Consistent handling of tip across versions

The implementation correctly handles the absence of tip in V0 and V1 versions.


139-142: Verify the semantic difference between contract_address and sender_address

The V0 implementation uses contract_address while V1 and V3 use sender_address. Please confirm this architectural difference is intentional.

✅ Verification successful

Ohayo sensei! Based on the search results we've gathered, I can now provide a conclusive response about the architectural difference between V0 and later versions of InvokeTx.

The difference between contract_address and sender_address is intentional and architecturally correct

The implementation correctly reflects the evolution of Starknet's transaction versions:

  • V0 uses contract_address as it represents the contract being invoked
  • V1 and V3 use sender_address as they represent the account initiating the transaction

This change aligns with Starknet's transition from contract-based transactions (V0) to account abstraction (V1+), where transactions are initiated by account contracts rather than being direct contract calls.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Search for other usages of these fields to verify consistency
rg -A 2 "contract_address.*InvokeTx::V0"
rg -A 2 "sender_address.*InvokeTx::(V1|V3)"

Length of output: 88


Script:

#!/bin/bash
# Let's search for the struct definitions to understand the field differences
ast-grep --pattern 'struct $name {
  $$$
}'

# Also search for any usage patterns of these fields
rg -B 2 -A 2 "contract_address|sender_address"

Length of output: 68207


Script:

#!/bin/bash
# Let's search for the InvokeTx struct definitions to understand the field differences
ast-grep --pattern 'enum InvokeTx {
  $$$
}'

# Also search for any usage patterns of these specific fields in the context of InvokeTx
rg -B 2 -A 2 "InvokeTx::(V0|V1|V3).*(contract_address|sender_address)"

Length of output: 653


Script:

#!/bin/bash
# Let's look for the struct definitions of V0, V1, and V3 to understand their fields
ast-grep --pattern 'struct $name {
  $$$
  contract_address: $_,
  $$$
}'

ast-grep --pattern 'struct $name {
  $$$
  sender_address: $_,
  $$$
}'

# Also search for any documentation or comments about these versions
rg -B 3 -A 3 "(V0|V1|V3).*struct.*Invoke"

Length of output: 193

crates/katana/feeder-gateway/src/client.rs (2)

60-60: LGTM! Clear and consistent method naming

The rename from with_query_param to add_query_param better reflects the method's purpose.

Also applies to: 72-72, 84-84


121-124: LGTM! Clean builder pattern implementation

The implementation is concise and follows Rust's builder pattern conventions.

crates/katana/primitives/src/block.rs (1)

82-92: LGTM! Robust number parsing implementation

The function properly handles both hexadecimal and decimal formats with appropriate error handling.

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

397-406: Deploy transaction conversion implementation looks good, sensei!

The conversion from internal deploy transaction to RPC deploy transaction is properly implemented with all required fields correctly mapped.


267-269: ⚠️ Potential issue

Ohayo! Critical: Unimplemented InvokeTx::V0 variant will cause runtime panics

The todo!() macro will panic if an InvokeTx::V0 transaction is processed. This needs to be implemented before merging to prevent runtime failures.

Comment on lines 162 to 164
V3(InvokeTxV3),
}

Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Ohayo, sensei! Add Deploy variant to TxRef enum for completeness.

Including Deploy(&'a DeployTx) in TxRef ensures that references to DeployTx are properly handled across the codebase.

crates/katana/primitives/src/transaction.rs Show resolved Hide resolved
crates/katana/pool/src/tx.rs Show resolved Hide resolved
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: 0

🧹 Outside diff range and nitpick comments (3)
crates/katana/rpc/rpc-types/src/transaction.rs (3)

Line range hint 44-61: Ohayo sensei! Refactor duplicated code in validate_compiled_class_hash

The match arms for BroadcastedDeclareTransaction::V2 and BroadcastedDeclareTransaction::V3 contain duplicated logic. Refactoring to combine these cases can enhance maintainability and reduce code duplication.

Consider refactoring as follows:

BroadcastedDeclareTransaction::V2(tx) | BroadcastedDeclareTransaction::V3(tx) => {
    let hash = compiled_class_hash_from_flattened_sierra_class(&tx.contract_class)?;
    hash == tx.compiled_class_hash
}

Line range hint 74-77: Ohayo sensei! Address the TODO comment regarding contract class type

There's a TODO comment suggesting changing the contract class type for the broadcasted transaction to katana-rpc-types for easier conversion. Implementing this change could improve code clarity and ease future maintenance.

Would you like assistance in implementing this change or opening a GitHub issue to track this task?


Line range hint 351-354: Ohayo sensei! Handle potential overflow when converting nonce

Using expect("nonce should fit in u64") might cause a panic if nonce exceeds u64 limits. To enhance robustness, consider handling this conversion safely.

Apply this diff to prevent potential panics:

- nonce: tx.nonce.to_u64().expect("nonce should fit in u64"),
+ nonce: match tx.nonce.to_u64() {
+     Some(nonce_u64) => nonce_u64,
+     None => {
+         // Handle the error appropriately, perhaps return an error or set a maximum value
+     },
+ },
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between c2eb889 and ed94472.

📒 Files selected for processing (1)
  • crates/katana/rpc/rpc-types/src/transaction.rs (2 hunks)
🔇 Additional comments (1)
crates/katana/rpc/rpc-types/src/transaction.rs (1)

267-278: Ohayo sensei! Verify if the version field should be included in InvokeTransactionV0

In the conversion to InvokeTransactionV0, the version field is not set. Since other transactions like DeployTransaction include the version, please verify whether it's necessary to include it here for consistency and correctness.

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: 0

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

8-12: Excellent solution for feeder gateway compatibility, sensei!

The custom deserialization approach elegantly solves the feeder gateway compatibility issue while maintaining the existing database format. The conditional compilation ensures the serde features are only included when needed.

Consider documenting these custom deserialization choices in a comment block above the struct to help future maintainers understand the rationale behind these specific implementations.

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between ed94472 and 79251b4.

📒 Files selected for processing (1)
  • crates/katana/primitives/src/fee.rs (1 hunks)
🔇 Additional comments (2)
crates/katana/primitives/src/fee.rs (2)

1-1: Ohayo! Clean import for deserialization functions.

The import statement correctly brings in the required deserialization functions from the block module.


15-24: Clean implementation of ResourceBoundsMapping with API compatibility.

The struct correctly implements the feeder gateway API mapping with appropriate aliases.

Let's verify the naming consistency across the codebase:

✅ Verification successful

Field naming conventions are consistent across the codebase

The verification shows that the l1_gas and l2_gas field names in ResourceBoundsMapping follow the established naming patterns in the codebase. The search results confirm:

  • The l1_gas prefix is consistently used across the codebase for L1-related gas fields (e.g., in DataAvailabilityResources, BlockEnv)
  • The snake_case naming convention is uniformly applied for all gas-related fields
  • The struct maintains API compatibility through serde aliases while adhering to Rust naming conventions
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check naming conventions for gas-related fields
# Expected: Consistent use of l1_gas/l2_gas vs other variations

# Search for other gas-related field names
rg -g '*.rs' 'gas.*:' ./crates/

Length of output: 16561

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: 0

🧹 Outside diff range and nitpick comments (1)
crates/katana/feeder-gateway/src/types/mod.rs (1)

76-103: Ohayo, sensei! The Block struct implementation looks solid.

The struct is well-structured with appropriate use of optional fields and good field organization. Consider adding documentation for each field to improve maintainability.

Add documentation comments for each field, for example:

 pub struct Block {
+    /// The unique identifier of the block
     #[serde(default)]
     pub block_hash: Option<BlockHash>,
+    /// The sequential number of the block in the chain
     #[serde(default)]
     pub block_number: Option<BlockNumber>,
📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 79251b4 and 0405749.

📒 Files selected for processing (4)
  • crates/katana/feeder-gateway/src/types/mod.rs (2 hunks)
  • crates/katana/primitives/src/block.rs (0 hunks)
  • crates/katana/primitives/src/fee.rs (1 hunks)
  • crates/katana/primitives/src/transaction.rs (11 hunks)
💤 Files with no reviewable changes (1)
  • crates/katana/primitives/src/block.rs
🚧 Files skipped from review as they are similar to previous changes (1)
  • crates/katana/primitives/src/fee.rs
🔇 Additional comments (3)
crates/katana/primitives/src/transaction.rs (3)

243-246: Ohayo, sensei! The hash calculation for InvokeTx::V0 is still missing.

The todo!() implementation will cause a panic if invoked. Please implement the hash calculation for V0 transactions.


567-582: Ohayo, sensei! Add Deploy variant to TxRef enum for consistency.

The DeployTx struct is well-implemented, but it needs to be added to the TxRef enum to maintain consistency across the codebase.


187-187: Ohayo, sensei! Chain ID implementation looks great!

The consistent addition of chain_id with #[serde(default)] across all transaction types provides good replay attack protection while maintaining backward compatibility.

Also applies to: 209-209, 301-301, 324-324, 349-349, 426-426, 480-480, 506-506

Copy link

codecov bot commented Dec 2, 2024

Codecov Report

Attention: Patch coverage is 2.72374% with 250 lines in your changes missing coverage. Please review.

Project coverage is 56.10%. Comparing base (3ba53c8) to head (0405749).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
...tes/katana/feeder-gateway/src/types/transaction.rs 0.00% 198 Missing ⚠️
crates/katana/rpc/rpc-types/src/transaction.rs 0.00% 21 Missing ⚠️
...na/executor/src/implementation/blockifier/utils.rs 0.00% 17 Missing ⚠️
crates/katana/primitives/src/transaction.rs 0.00% 5 Missing ⚠️
crates/katana/pool/src/tx.rs 0.00% 4 Missing ⚠️
crates/katana/feeder-gateway/src/client.rs 70.00% 3 Missing ⚠️
crates/katana/feeder-gateway/src/types/mod.rs 0.00% 1 Missing ⚠️
crates/katana/feeder-gateway/src/types/receipt.rs 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2744      +/-   ##
==========================================
- Coverage   56.35%   56.10%   -0.25%     
==========================================
  Files         425      427       +2     
  Lines       54269    54516     +247     
==========================================
+ Hits        30583    30586       +3     
- Misses      23686    23930     +244     

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

@kariy kariy merged commit a0a173e into main Dec 2, 2024
12 of 14 checks passed
@kariy kariy deleted the katana/feeder-gateway-types branch December 2, 2024 21:02
augustin-v pushed a commit to augustin-v/dojo that referenced this pull request Dec 4, 2024
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