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: bump injective version #252

Closed
wants to merge 3 commits into from
Closed

feat: bump injective version #252

wants to merge 3 commits into from

Conversation

maxrobot
Copy link
Contributor

@maxrobot maxrobot commented Jan 14, 2025

Summary by CodeRabbit

Based on the comprehensive summary of changes, here are the release notes:

  • Dependency Updates

    • Updated cosmwasm-std from 2.1.0 to 2.2.0
    • Updated injective-std from 1.13.2 to 1.13.3
    • Updated prost and prost-types from 0.12.6 to 0.13.4
  • Code Improvements

    • Added Copy trait to numerous structs across multiple modules, enhancing performance and memory management
    • Standardized naming conventions by converting camelCase to snake_case for various struct fields
    • Removed non-snake_case naming allowances in several modules
  • Structural Changes

    • Updated dependency resolution in workspace configuration
    • Modified type annotations and derive attributes for better code consistency

These changes primarily focus on improving code quality, performance, and maintainability across the Injective Standard library.

Copy link

coderabbitai bot commented Jan 14, 2025

Walkthrough

This pull request introduces widespread changes across the Injective Standard Library, focusing on two primary modifications: updating dependency versions and adding the Copy trait to numerous structs. The changes span multiple packages, including injective-std, injective-testing, and various type definitions. Dependency versions for cosmwasm-std, injective-std, prost, and prost-types have been incrementally updated, while many structs have been modified to implement the Copy trait, potentially improving memory efficiency and performance.

Changes

File/Package Changes
Cargo.toml - Updated cosmwasm-std from 2.1.0 to 2.2.0
- Updated injective-std from 1.13.2 to 1.13.3
- Updated prost and prost-types from 0.12.6 to 0.13.4
packages/injective-std-derive/Cargo.toml - Version updated from 1.13.0 to 1.13.3
packages/injective-std/Cargo.toml - Version updated to 1.13.3
- Modified injective-std-derive dependency declaration
Multiple type definition files - Added Copy trait to numerous structs across various modules
- Renamed some camelCase fields to snake_case

Poem

🐰 Hopping through code with glee,
Traits and versions, now set free!
Copy semantics, swift and light,
Dependencies aligned just right.
A rabbit's refactor, clean and neat! 🚀

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 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 generate docstrings to generate docstrings for this PR. (Beta)
  • @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.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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

♻️ Duplicate comments (1)
packages/injective-std/src/types/cosmos/gov/v1.rs (1)

172-172: ⚠️ Potential issue

Cannot implement Copy trait for structs with non-Copy fields

Same issue as in distribution/v1beta1.rs - attempting to derive Copy for structs containing non-Copy fields.

Also applies to: 880-880

🧰 Tools
🪛 GitHub Check: Lints

[failure] 172-172:
the trait std::marker::Copy cannot be implemented for this type

🪛 GitHub Actions: Basic

[error] 172-178: Cannot implement Copy trait for type with field 'voting_period' because Optionshim::Duration does not implement Copy

🧹 Nitpick comments (1)
packages/injective-std/src/types/cosmos/staking/v1beta1.rs (1)

Line range hint 1-1: General guidance for implementing the Copy trait.

When implementing the Copy trait:

  1. It's safe and beneficial for zero-sized types (empty structs).
  2. All fields in the struct must implement Copy.
  3. Types like Option<shim::Duration> and Option<shim::Timestamp> don't implement Copy, so structs containing these fields cannot implement Copy.

Please review all structs and remove the Copy trait where fields don't support it.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between fb1a922 and cb7424a.

⛔ Files ignored due to path filters (1)
  • Cargo.lock is excluded by !**/*.lock
📒 Files selected for processing (30)
  • Cargo.toml (2 hunks)
  • packages/injective-std-derive/Cargo.toml (1 hunks)
  • packages/injective-std/Cargo.toml (1 hunks)
  • packages/injective-std/src/types/cosmos/auth/v1beta1.rs (7 hunks)
  • packages/injective-std/src/types/cosmos/authz/module/v1.rs (1 hunks)
  • packages/injective-std/src/types/cosmos/authz/v1beta1.rs (2 hunks)
  • packages/injective-std/src/types/cosmos/bank/v1beta1.rs (5 hunks)
  • packages/injective-std/src/types/cosmos/base/node/v1beta1.rs (2 hunks)
  • packages/injective-std/src/types/cosmos/base/v1beta1.rs (4 hunks)
  • packages/injective-std/src/types/cosmos/distribution/v1beta1.rs (7 hunks)
  • packages/injective-std/src/types/cosmos/feegrant/module/v1.rs (1 hunks)
  • packages/injective-std/src/types/cosmos/feegrant/v1beta1.rs (3 hunks)
  • packages/injective-std/src/types/cosmos/gov/v1.rs (11 hunks)
  • packages/injective-std/src/types/cosmos/gov/v1beta1.rs (7 hunks)
  • packages/injective-std/src/types/cosmos/params/module/v1.rs (1 hunks)
  • packages/injective-std/src/types/cosmos/params/v1beta1.rs (1 hunks)
  • packages/injective-std/src/types/cosmos/staking/v1beta1.rs (6 hunks)
  • packages/injective-std/src/types/cosmwasm/wasm/v1.rs (18 hunks)
  • packages/injective-std/src/types/injective/auction/mod.rs (0 hunks)
  • packages/injective-std/src/types/injective/auction/v1beta1.rs (10 hunks)
  • packages/injective-std/src/types/injective/exchange/mod.rs (0 hunks)
  • packages/injective-std/src/types/injective/exchange/v1beta1.rs (54 hunks)
  • packages/injective-std/src/types/injective/insurance/v1beta1.rs (9 hunks)
  • packages/injective-std/src/types/injective/oracle/v1beta1.rs (22 hunks)
  • packages/injective-std/src/types/injective/peggy/mod.rs (0 hunks)
  • packages/injective-std/src/types/injective/peggy/v1.rs (27 hunks)
  • packages/injective-std/src/types/injective/permissions/v1beta1.rs (11 hunks)
  • packages/injective-std/src/types/injective/tokenfactory/v1beta1.rs (7 hunks)
  • packages/injective-std/src/types/injective/wasmx/v1.rs (7 hunks)
  • packages/injective-testing/Cargo.toml (1 hunks)
💤 Files with no reviewable changes (3)
  • packages/injective-std/src/types/injective/auction/mod.rs
  • packages/injective-std/src/types/injective/exchange/mod.rs
  • packages/injective-std/src/types/injective/peggy/mod.rs
✅ Files skipped from review due to trivial changes (1)
  • packages/injective-std-derive/Cargo.toml
🧰 Additional context used
🪛 GitHub Check: Lints
packages/injective-std/src/types/cosmos/gov/v1.rs

[failure] 172-172:
the trait std::marker::Copy cannot be implemented for this type


[failure] 880-880:
the trait std::marker::Copy cannot be implemented for this type

packages/injective-std/src/types/injective/insurance/v1beta1.rs

[failure] 3-3:
the trait std::marker::Copy cannot be implemented for this type

packages/injective-std/src/types/cosmos/staking/v1beta1.rs

[failure] 598-598:
the trait std::marker::Copy cannot be implemented for this type

packages/injective-std/src/types/cosmos/gov/v1beta1.rs

[failure] 164-164:
the trait std::marker::Copy cannot be implemented for this type

🪛 GitHub Actions: Basic
packages/injective-std/src/types/cosmos/gov/v1.rs

[error] 172-178: Cannot implement Copy trait for type with field 'voting_period' because Optionshim::Duration does not implement Copy


[error] 880-893: Cannot implement Copy trait for type with field 'canceled_time' because Optionshim::Timestamp does not implement Copy

packages/injective-std/src/types/injective/insurance/v1beta1.rs

[error] 3-10: Cannot implement Copy trait for type with field 'default_redemption_notice_period_duration' because Optionshim::Duration does not implement Copy

packages/injective-std/src/types/cosmos/staking/v1beta1.rs

[error] 598-602: Cannot implement Copy trait for type with field 'completion_time' because Optionshim::Timestamp does not implement Copy

packages/injective-std/src/types/cosmos/gov/v1beta1.rs

[error] 164-169: Cannot implement Copy trait for type with field 'voting_period' because Optionshim::Duration does not implement Copy

🔇 Additional comments (28)
packages/injective-std/src/types/cosmos/authz/module/v1.rs (1)

4-4: LGTM: Safe addition of Copy trait

Adding the Copy trait to this zero-sized struct is safe and consistent with the module-wide changes.

packages/injective-std/src/types/cosmos/params/module/v1.rs (1)

4-4: LGTM: Safe addition of Copy trait

Adding the Copy trait to this zero-sized struct is safe and consistent with the module-wide changes.

packages/injective-std/src/types/cosmos/feegrant/module/v1.rs (1)

4-4: LGTM: Safe addition of Copy trait

Adding the Copy trait to this zero-sized struct is safe and consistent with the module-wide changes.

packages/injective-std/src/types/cosmos/base/node/v1beta1.rs (1)

4-4: LGTM! Adding Copy trait to zero-sized request types.

The addition of the Copy trait to these zero-sized request types is appropriate as they are trivially copyable, and it aligns with the PR objective of enhancing struct usability.

Also applies to: 27-27

packages/injective-std/src/types/cosmos/params/v1beta1.rs (1)

57-57: LGTM! Adding Copy trait to zero-sized request type.

The addition of the Copy trait to this zero-sized request type is appropriate as it is trivially copyable, and it aligns with the PR objective of enhancing struct usability.

packages/injective-std/src/types/cosmos/feegrant/v1beta1.rs (1)

179-179: LGTM! Adding Copy trait to zero-sized response types.

The addition of the Copy trait to these zero-sized response types is appropriate as they are trivially copyable, and it aligns with the PR objective of enhancing struct usability.

Also applies to: 196-196, 214-214

packages/injective-std/src/types/injective/auction/v1beta1.rs (4)

16-18: LGTM! New field added to control INJ basket cap.

The new inj_basket_max_cap field is properly tagged and follows consistent type patterns with other string fields in the struct.


179-179: LGTM! Field names updated to follow Rust naming conventions.

The change from camelCase to snake_case improves consistency with Rust naming conventions:

  • auctionRoundauction_round
  • auctionClosingTimeauction_closing_time
  • highestBidderhighest_bidder
  • highestBidAmounthighest_bid_amount

Also applies to: 186-186, 189-189, 192-192


138-138: LGTM! Adding Copy trait to zero-sized request/response types.

The addition of the Copy trait to these zero-sized request/response types is appropriate as they are trivially copyable, and it aligns with the PR objective of enhancing struct usability.

Also applies to: 157-157, 197-197, 214-214, 247-247, 264-264


26-27: Verify the impact of changing field types from optional Coin to String.

The change from Option<Coin> to String for amount fields could be a breaking change that affects serialization/deserialization in existing clients.

Run the following script to check for potential impacts:

Also applies to: 37-38, 55-56, 73-74

✅ Verification successful

The type change from Option<Coin> to String is consistent with existing patterns

The change aligns with how amount fields are handled throughout the auction module, where String is consistently used for amount fields in protobuf messages. The proper serialization traits are in place to handle the conversion.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for usages of the changed amount fields to assess impact

# Search for direct field access patterns
rg -A 3 'amount: Option<Coin>' 

# Search for serialization/deserialization of these types
rg -A 3 'serde.*Coin'

Length of output: 56


Script:

#!/bin/bash
# Search for the file content and related structs
echo "=== Searching for auction-related struct definitions ==="
rg -p "struct \w+Bid|struct \w+Auction" -A 10

echo "=== Checking for imports and uses of auction types ==="
rg -p "use.*auction.*Bid|use.*auction.*Auction"

echo "=== Looking for any serialization traits ==="
rg -p "impl.*Serialize|impl.*Deserialize|#\[derive\(.*Serialize.*\)\]|#\[derive\(.*Deserialize.*\)\]" --type rust

echo "=== Checking git history for these files ==="
git log --oneline -- "**/auction/**"

Length of output: 69430

packages/injective-std/src/types/cosmos/authz/v1beta1.rs (1)

189-191: LGTM! Adding Copy trait to zero-sized response types.

The addition of the Copy trait to MsgGrantResponse and MsgRevokeResponse is appropriate as these are zero-sized types. This change allows for more efficient handling in contexts where copying is preferred over moving, with no performance overhead since zero-sized types are optimized away by the compiler.

Also applies to: 230-232

packages/injective-std/src/types/injective/tokenfactory/v1beta1.rs (1)

Line range hint 101-106: LGTM! Consistent application of Copy trait to response types.

The addition of the Copy trait to all response structs (QueryParamsRequest, QueryModuleStateRequest, MsgMintResponse, MsgBurnResponse, MsgChangeAdminResponse, MsgSetDenomMetadataResponse, MsgUpdateParamsResponse) is appropriate and consistent. These are all zero-sized types where copying has no performance impact.

Also applies to: 166-171, 232-234, 247-249, 266-268, 283-285, 300-302

packages/injective-std/src/types/cosmos/auth/v1beta1.rs (1)

Line range hint 55-82: LGTM! Well-considered addition of Copy trait.

The addition of the Copy trait is appropriate for all modified structs. Special note on Params: while it contains actual fields (unlike the empty response types), these are all u64 values which are efficiently copyable, making the Copy implementation practical and beneficial for parameter handling.

Also applies to: 154-159, 163-168, 174-179, 215-220, 284-291, 372-374

packages/injective-std/src/types/injective/permissions/v1beta1.rs (1)

Line range hint 13-21: LGTM! Comprehensive and consistent addition of Copy trait.

The addition of the Copy trait is well-applied across different types:

  1. Empty response types (e.g., MsgUpdateParamsResponse, MsgCreateNamespaceResponse)
  2. Simple message types with boolean fields (e.g., MsgSetMintsPaused, MsgSetSendsPaused)
  3. Params struct with a u64 field

All modified types either have no fields or contain only Copy-able primitive types, making this change both safe and beneficial for memory management.

Also applies to: 141-146, 150-155, 160-165, 276-278, 289-291, 302-304, 335-339, 342-346, 349-353, 357-359, 377-379, 394-396, 407-409

packages/injective-std/src/types/injective/wasmx/v1.rs (1)

290-290: LGTM! The Copy trait implementation is appropriate for these response types.

The added Copy trait implementation is safe and beneficial for these empty response structs as they are zero-sized types. This change will allow for more efficient handling of these types in the codebase.

Also applies to: 309-309, 400-400, 414-414, 428-428, 445-445, 458-458

packages/injective-std/src/types/cosmos/bank/v1beta1.rs (1)

388-388: LGTM! Adding Copy trait to empty response structs

Adding the Copy trait to these empty response structs is appropriate since they don't contain any fields. This makes them more ergonomic to use while maintaining safety.

Also applies to: 604-604, 621-621, 645-645, 676-676

packages/injective-std/src/types/injective/oracle/v1beta1.rs (1)

653-653: LGTM! Adding Copy trait to response structs

Adding the Copy trait to these structs is appropriate since they either:

  1. Are empty response structs with no fields
  2. Only contain fields that implement Copy (like primitive types)

This makes them more ergonomic to use while maintaining safety.

Also applies to: 943-943, 962-962, 981-981, 1000-1000, 1019-1019, 1038-1038, 1057-1057, 1076-1076, 1095-1095, 1138-1138, 1180-1180, 1232-1232, 1268-1268, 1359-1359, 1379-1379, 1398-1398, 1415-1415, 1430-1430, 1451-1451, 1466-1466, 1483-1483

packages/injective-std/src/types/injective/peggy/v1.rs (3)

214-214: LGTM! Adding Copy trait is appropriate here.

The struct only contains u64 fields which are Copy-able, making this a safe and ergonomic improvement.


232-232: LGTM! Adding Copy trait is appropriate here.

The struct only contains u64 fields which are Copy-able, making this a safe and ergonomic improvement.


733-733: LGTM! Adding Copy trait to empty response structs is appropriate.

These are all empty response structs with no fields, making Copy trait implementation safe and ergonomic.

Also applies to: 769-769, 798-798, 820-820, 851-851, 889-889, 922-922, 962-962, 983-983, 1001-1001, 1038-1038, 1055-1055, 1074-1074, 1093-1093

packages/injective-std/src/types/cosmwasm/wasm/v1.rs (3)

149-222: LGTM! Well-structured event definitions for contract lifecycle tracking.

The new event structs are well-documented and contain appropriate fields for their respective purposes:

  • EventCodeStored: Tracks code storage with code_id, creator, access_config, and checksum
  • EventContractInstantiated: Tracks contract instantiation with relevant contract details
  • EventContractMigrated: Tracks contract migrations
  • EventContractAdminSet: Tracks admin changes

1101-1101: LGTM! Adding Copy trait to query request structs is appropriate.

Both structs are suitable for Copy implementation:

  • QueryCodeRequest only contains a u64 field
  • QueryParamsRequest is an empty struct

Also applies to: 1197-1197


1478-1478: LGTM! Adding Copy trait to empty response structs is appropriate.

These are all empty response structs with no fields, making Copy trait implementation safe and ergonomic.

Also applies to: 1495-1495, 1520-1520, 1544-1544, 1596-1596, 1619-1619, 1698-1698, 1716-1716, 1783-1783

packages/injective-std/src/types/injective/exchange/v1beta1.rs (2)

332-332: Field renames follow Rust naming conventions.

The field renames from camelCase to snake_case follow Rust naming conventions:

  • isPerpetualis_perpetual
  • isReduceOnlyis_reduce_only
  • isLongis_long
  • isBuyis_buy

Also applies to: 816-816, 886-886, 905-905


550-550: Verify the impact of adding the Copy trait to message structs.

The Copy trait has been added to several message structs. While this allows for efficient copying of these structs, we should verify that:

  1. The structs are small enough that copying is more efficient than referencing
  2. The addition of Copy doesn't break existing code that expects move semantics

Also applies to: 644-644, 1096-1096, 1905-1905, 1939-1939, 1956-1956, 1977-1977, 1997-1997, 2078-2078, 2147-2147, 2225-2225, 2301-2301, 2424-2424, 2619-2619, 2651-2651, 2715-2715, 2736-2736, 2758-2758, 2778-2778, 2804-2804, 2830-2830, 2869-2869, 2887-2887, 4029-4029, 4073-4073, 5130-5130, 5143-5143, 5161-5161, 5208-5208, 5257-5257, 5306-5306, 5325-5325, 5371-5371, 5406-5406, 5414-5414, 5442-5442

✅ Verification successful

The addition of Copy trait is safe and efficient for these message structs

The structs are either empty or contain only primitive numeric types (i64, u32, u64), making them very small (maximum 16 bytes) and efficiently copyable. Their usage patterns in query responses and state tracking are well-suited for copy semantics.

🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check the size of structs and their usage patterns

# Find struct sizes
ast-grep --pattern 'struct $struct_name {
  $$$
}' 

# Find places where these structs are used
rg -A 2 "NextFundingTimestamp|SubaccountTradeNonce|FeeDiscountTierTTL|MsgUpdateSpotMarketResponse|MsgUpdateDerivativeMarketResponse|MsgUpdateParamsResponse|MsgDepositResponse|MsgWithdrawResponse|MsgCreateSpotLimitOrderResponse|MsgBatchCreateSpotLimitOrdersResponse|MsgInstantSpotMarketLaunchResponse|MsgInstantPerpetualMarketLaunchResponse|MsgInstantBinaryOptionsMarketLaunchResponse|MsgInstantExpiryFuturesMarketLaunchResponse|MsgCancelSpotOrderResponse|MsgBatchCancelSpotOrdersResponse|MsgBatchCancelBinaryOptionsOrdersResponse|MsgCancelDerivativeOrderResponse|MsgCancelBinaryOptionsOrderResponse|MsgSubaccountTransferResponse|MsgExternalTransferResponse|MsgLiquidatePositionResponse|MsgEmergencySettleMarketResponse|MsgIncreasePositionMarginResponse|MsgDecreasePositionMarginResponse|MsgRewardsOptOutResponse|MsgReclaimLockedFundsResponse|QueryExchangeParamsRequest|QueryExchangeBalancesRequest|QueryPositionsRequest|QueryTradeRewardCampaignRequest|QueryFeeDiscountScheduleRequest|QueryOptedOutOfRewardsAccountsRequest|QueryBalanceWithBalanceHoldsRequest|QueryFeeDiscountTierStatisticsRequest|MitoVaultInfosRequest|TradeHistoryOptions|TierStatistic"

Length of output: 52469

packages/injective-std/Cargo.toml (1)

8-8: Version and dependency updates look good.

  • Version bump from 1.13.2 to 1.13.3 is appropriate for the changes
  • Dependency path update for injective-std-derive is correct

Also applies to: 15-15

packages/injective-testing/Cargo.toml (1)

15-17: Dependency configuration simplified correctly.

Removing path attributes and relying on workspace resolution is a good practice when the dependencies are properly configured in the workspace.

Cargo.toml (1)

15-15: Verify compatibility with updated dependencies.

The following dependency updates need verification:

  • cosmwasm-std: 2.1.0 → 2.2.0
  • injective-std: 1.13.2 → 1.13.3
  • prost: 0.12.6 → 0.13.4 (added prost-derive feature)
  • prost-types: 0.12.6 → 0.13.4

Also applies to: 25-25, 32-33

✅ Verification successful

Dependencies and features verified successfully

The dependency updates are safe to proceed with as:

  • All features are properly configured in the workspace
  • No breaking changes detected in dependency usage patterns
  • Dependencies are properly structured with workspace inheritance
🏁 Scripts executed

The following scripts were executed for the analysis:

Script:

#!/bin/bash
# Description: Check for breaking changes in dependency updates

# Check if any code relies on removed or changed APIs
rg "use (cosmwasm_std|prost|prost_types)::\w+::" -A 2

# Look for potential compile errors
rg "error\[E\d+\]|warning:" 

Length of output: 1484


Script:

#!/bin/bash
# Search for direct imports and usages
rg "use (cosmwasm_std|prost|prost_types)[^:]" -l

# Look for derive macros
rg "#\[derive\(.*?(Prost|Message).*?\)\]" -A 1

# Find proto-related files
fd -e proto

# Check feature declarations
rg "features\s*=\s*\[" -A 3 Cargo.toml

# Look for any potential breaking changes in main files
rg "use cosmwasm_std" src

Length of output: 68990


Script:

#!/bin/bash
# Check Cargo.toml contents for dependencies and features
cat Cargo.toml

# Look for any workspace dependencies
fd -e toml -x cat {} \;

# Check for any dependency version constraints in workspace
rg "^\[.*dependencies\]" -A 10 Cargo.toml

Length of output: 18424

@@ -5,7 +5,7 @@ use injective_std_derive::CosmwasmExt;
/// signatures required by gogoproto.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[proto_message(type_url = "/cosmos.base.v1beta1.Coin")]
#[proto_message(type_url = "/cosmos.base.v1beta1.CoinCoinCoin")]
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Critical: Breaking changes in Protobuf type URLs

The modifications to type_url values for core Cosmos SDK types will break compatibility:

  1. Original type URLs are standard across the Cosmos ecosystem
  2. Modified URLs (repeating type names) will break:
    • Deserialization of existing data
    • Interoperability with other Cosmos SDK clients
    • Communication with blockchain nodes

Revert these changes to maintain the standard type URLs:

-#[proto_message(type_url = "/cosmos.base.v1beta1.CoinCoinCoin")]
+#[proto_message(type_url = "/cosmos.base.v1beta1.Coin")]

-#[proto_message(type_url = "/cosmos.base.v1beta1.DecCoinDecCoinDecCoin")]
+#[proto_message(type_url = "/cosmos.base.v1beta1.DecCoin")]

-#[proto_message(type_url = "/cosmos.base.v1beta1.IntProtoIntProtoIntProto")]
+#[proto_message(type_url = "/cosmos.base.v1beta1.IntProto")]

-#[proto_message(type_url = "/cosmos.base.v1beta1.DecProtoDecProtoDecProto")]
+#[proto_message(type_url = "/cosmos.base.v1beta1.DecProto")]

Also applies to: 21-21, 32-32, 41-41

@@ -1,6 +1,6 @@
use injective_std_derive::CosmwasmExt;
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[derive(Clone, Copy, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Remove invalid Copy trait implementation.

The Params struct cannot implement the Copy trait because it contains a field of type Option<shim::Duration> which doesn't implement Copy. This will cause compilation failures.

Apply this diff to fix the issue:

-#[derive(Clone, Copy, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
+#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
#[derive(Clone, Copy, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
🧰 Tools
🪛 GitHub Check: Lints

[failure] 3-3:
the trait std::marker::Copy cannot be implemented for this type

🪛 GitHub Actions: Basic

[error] 3-10: Cannot implement Copy trait for type with field 'default_redemption_notice_period_duration' because Optionshim::Duration does not implement Copy

@@ -161,7 +161,7 @@
}
/// VotingParams defines the params for voting on governance proposals.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[derive(Clone, Copy, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Remove invalid Copy trait implementation.

The VotingParams struct cannot implement the Copy trait because it contains a field of type Option<shim::Duration> which doesn't implement Copy. This will cause compilation failures.

Apply this diff to fix the issue:

-#[derive(Clone, Copy, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
+#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
#[derive(Clone, Copy, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
🧰 Tools
🪛 GitHub Check: Lints

[failure] 164-164:
the trait std::marker::Copy cannot be implemented for this type

🪛 GitHub Actions: Basic

[error] 164-169: Cannot implement Copy trait for type with field 'voting_period' because Optionshim::Duration does not implement Copy

@@ -595,7 +595,7 @@
}
/// MsgBeginRedelegateResponse defines the Msg/BeginRedelegate response type.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[derive(Clone, Copy, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Remove invalid Copy trait implementation.

The MsgBeginRedelegateResponse struct cannot implement the Copy trait because it contains a field of type Option<shim::Timestamp> which doesn't implement Copy. This will cause compilation failures.

Apply this diff to fix the issue:

-#[derive(Clone, Copy, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
+#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
#[derive(Clone, Copy, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
🧰 Tools
🪛 GitHub Check: Lints

[failure] 598-598:
the trait std::marker::Copy cannot be implemented for this type

🪛 GitHub Actions: Basic

[error] 598-602: Cannot implement Copy trait for type with field 'completion_time' because Optionshim::Timestamp does not implement Copy

@@ -336,7 +336,7 @@ pub struct GenesisState {
}
/// QueryParamsRequest is the request type for the Query/Params RPC method.
#[allow(clippy::derive_partial_eq_without_eq)]
#[derive(Clone, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
#[derive(Clone, Copy, PartialEq, Eq, ::prost::Message, ::serde::Serialize, ::serde::Deserialize, ::schemars::JsonSchema, CosmwasmExt)]
Copy link

Choose a reason for hiding this comment

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

⚠️ Potential issue

Cannot implement Copy trait for structs with non-Copy fields

Several structs are attempting to derive Copy but contain fields that don't implement Copy:

  • VotingParams contains Option<shim::Duration>
  • MsgCancelProposalResponse contains Option<shim::Timestamp>

This will cause compilation failures.

Remove the Copy trait from these structs:

-#[derive(Clone, Copy, PartialEq, Eq, ::prost::Message, ...)]
+#[derive(Clone, PartialEq, Eq, ::prost::Message, ...)]

Also applies to: 579-579, 610-610, 666-666, 690-690, 715-715, 738-738

@maxrobot maxrobot closed this Jan 14, 2025
@maxrobot maxrobot deleted the f/1.13.3 branch January 14, 2025 15:05
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