Skip to content

Conversation

@jbernal87
Copy link
Contributor

@jbernal87 jbernal87 commented Aug 15, 2025

Upgrade to chain version 1.16.3

Summary by CodeRabbit

  • New Features

    • None.
  • Bug Fixes

    • Use a consistent UTC timestamp during environment initialization for more reliable runs.
  • Tests

    • Expanded auction module tests to cover time-driven auction basket behavior.
  • Chores

    • Added linting to CI alongside tests.
    • Stopped ignoring Cargo.lock.
    • Upgraded dependencies across Rust and Go modules (including CosmWasm, Injective core) and added ed25519 support.
    • Bumped package versions to latest patch releases.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Aug 15, 2025

Walkthrough

Adds a parallel linting job to CI, stops ignoring Cargo.lock, introduces a workspace dependency, updates multiple Rust crate manifests, revises Go module replacements and indirect deps, aligns test environment initialization time in Go, and expands a Rust auction module test with time-based assertions.

Changes

Cohort / File(s) Summary of Changes
CI workflow
.github/workflows/unit_test.yml
Added lints job (rustfmt, clippy) alongside existing tests; moved workflow name to top-level; test job unchanged.
Ignore rules
.gitignore
Removed Cargo.lock ignore and related comments.
Workspace config
Cargo.toml
Added [workspace.dependencies] with ed25519-zebra = 4.1.0 (alloc).
Rust crate manifests (Injective test-tube)
packages/injective-test-tube/Cargo.toml
Bumped crate version; updated multiple deps (cosmsrs, cosmwasm-std, injective-* , prost, serde_json); added build-dep ed25519-zebra via workspace; updated test-tube-inj to 2.0.8-1 with local path; dev-dep cw1-whitelist -> 2.0.0.
Rust crate manifests (test-tube)
packages/test-tube/Cargo.toml
Version bump to 2.0.8-1; updated deps (base64, cosmsr, cosmwasm-std, prost, serde_json, thiserror); added ed25519-zebra (alloc); removed dev-deps cw1-whitelist and rayon.
Go module dep updates
packages/injective-test-tube/libinjectivetesttube/go.mod
Replaced Injective core to InjectiveFoundation/injective-core v1.16.3; expanded indirect deps (Cosmos SDK, wasmvm v2, metrics, Prometheus, DataDog, genproto, k8s yaml, skip-mev).
Go test environment init
packages/injective-test-tube/libinjectivetesttube/testenv/setup.go
Captured a single UTC timestamp and reused it for InitChain and initial context Time.
Rust tests (auction)
packages/injective-test-tube/src/module/auction.rs
Reorganized imports; added QueryCurrentAuctionBasketRequest; extended test with time-based basket queries and assertions.

Sequence Diagram(s)

sequenceDiagram
  participant Tester
  participant TestEnv as TestEnv Setup
  participant App as ABCI App

  Tester->>TestEnv: Setup()
  TestEnv->>TestEnv: now := time.Now().UTC()
  TestEnv->>App: InitChain(Time=now, AppStateBytes, ChainId, ...)
  App-->>TestEnv: InitChain OK
  TestEnv->>App: NewUncachedContext(Header{Time=now})
  App-->>TestEnv: Context
  TestEnv-->>Tester: Ready
Loading
sequenceDiagram
  participant Test as Rust Test
  participant App as InjectiveTestApp
  participant Auction as Auction Module

  Test->>App: block_time_sec()
  Test->>Auction: query_current_auction_basket()
  Auction-->>Test: {round, closing_time, highest_*}
  Test->>App: increase_time(1)
  Test->>Auction: query_current_auction_basket()
  Auction-->>Test: unchanged round/closing_time
  Test->>App: increase_time(closing_time - block_time + 1)
  Test->>Auction: query_current_auction_basket()
  Auction-->>Test: increased round and closing_time
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Poem

I thump my paw at linting’s call,
Locks unignored, we track it all.
Time stands still—then sprints ahead,
Auctions turn, the clocks are read.
Crates and mods all tuned just right—
A rabbit ships by moonlit night. 🐇✨

Tip

🔌 Remote MCP (Model Context Protocol) integration is now available!

Pro plan users can now connect to remote MCP servers from the Integrations page. Connect with popular remote MCPs such as Notion and Linear to add more context to your reviews and chats.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/v1.16.3

🪧 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.
    • 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.
  • 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 the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR/Issue comments)

Type @coderabbitai help to get the list of available commands.

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

Status, Documentation and Community

  • Visit our Status Page to check the current availability of CodeRabbit.
  • 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.

@socket-security
Copy link

socket-security bot commented Aug 15, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedgithub.com/​InjectiveFoundation/​injective-core@​v1.16.0-beta.3 ⏵ v1.16.380 -310010010070

View full report

@jbernal87 jbernal87 marked this pull request as ready for review August 16, 2025 14:37
Copy link
Contributor

@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: 1

🔭 Outside diff range comments (1)
packages/injective-test-tube/libinjectivetesttube/go.mod (1)

3-3: Invalid Go version directive in go.mod.

The go directive must be major.minor (e.g., 1.23). 1.23.9 is invalid and will break go tooling.

Apply this diff:

-go 1.23.9
+go 1.23
🧹 Nitpick comments (10)
.github/workflows/unit_test.yml (3)

31-56: Add broader clippy coverage for workspace, targets, and features.

To lint everything consistently (including examples, benches, build scripts, all features), expand clippy args.

Apply this diff:

       - name: Run cargo clippy
         uses: actions-rs/cargo@v1
         with:
           command: clippy
-          args: --tests -- -D warnings
+          args: --workspace --all-targets --all-features --tests -- -D warnings

3-7: Run workflow on PR updates, not only when opened.

pull_request.types is limited to opened, so pushes to an existing PR won’t trigger CI. Include reopened and synchronize to cover updates.

Apply this diff:

 on:
   push:
   pull_request:
-    types: [opened]
+    types: [opened, reopened, synchronize]

56-56: Add newline at end of file.

YAML lint flags missing newline at EOF.

Please add a newline at the end of the file to satisfy linters.

packages/injective-test-tube/src/module/auction.rs (3)

87-127: Prevent potential underflow in time arithmetic (future-proofing).

You assert closing_time > block_time_sec, which is good. To make the increment robust even if assumptions change, use saturating ops.

Apply this diff:

-        app.increase_time(1);
+        app.increase_time(1);

         let basket_response_after_increase = auction
             .query_current_auction_basket(&QueryCurrentAuctionBasketRequest {})
             .expect("query_current_auction_basket should succeed (after)");

         assert_eq!(
             basket_response_after_increase.auction_round, round,
             "Round should not change"
         );

         assert_eq!(
             basket_response_after_increase.auction_closing_time,
             closing_time,
         );

-        app.increase_time(closing_time - block_time_sec + 1);
+        app.increase_time(closing_time.saturating_sub(block_time_sec).saturating_add(1));

99-102: Avoid println in tests (keep CI logs clean).

Unless needed for debugging, remove println! to reduce noise.

Apply this diff:

-        println!(
-            "[check] round={}, closing_time={}, highest_bidder={}, highest_bid_amount={}",
-            round, closing_time, highest_bidder, highest_bid
-        );

Note: If you remove this, also remove the temporary variables that are only used for printing:

-        let highest_bid = basket_res.highest_bid_amount.clone();
-        let highest_bidder = basket_res.highest_bidder.clone();

134-137: Stronger assertion: expect exactly one round increment.

If the auction period is fixed and you jump just past the closing time, the round should increment by 1, not just “be greater.”

Apply this diff:

-        assert!(
-            basket_response_after_increase.auction_round > round,
-            "Round should increase"
-        );
+        assert_eq!(
+            basket_response_after_increase.auction_round,
+            round + 1,
+            "Round should increase exactly by 1"
+        );
packages/test-tube/Cargo.toml (2)

12-12: Prefer workspace-managed dependency for ed25519-zebra to avoid drift.

You already declare ed25519-zebra in [workspace.dependencies] (with features = ["alloc"]). To keep consistency and avoid accidental version/feature drift, switch this crate to use the workspace-managed dependency.

Apply this diff here:

-ed25519-zebra = { version = "4.1.0", features = ["alloc"] }
+ed25519-zebra = { workspace = true }

15-15: Consider trimming cosmwasm-std feature set if not all are required.

Enabling multiple compatibility features ("cosmwasm_1_2", "1_3", "1_4", "2_0") plus "stargate" and "iterator" can inflate compile time and binary size. If tests don’t require older compatibility layers, narrow the set to the minimum needed.

packages/injective-test-tube/Cargo.toml (2)

14-14: Optionally reduce cosmwasm-std features.

If your tests do not span older CosmWasm compatibility, consider disabling unneeded "cosmwasm_1_x" features to reduce compilation and linkage overhead.


19-19: serde_json bump is fine; consider centralizing in workspace.

To avoid version skew across member crates, you can manage serde_json in [workspace.dependencies] and reference it via workspace = true.

Example change here:

-serde_json         = "1.0.140"
+serde_json         = { workspace = true }

And in the workspace Cargo.toml:

[workspace.dependencies]
serde_json = "1.0.140"
📜 Review details

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

💡 Knowledge Base configuration:

  • MCP integration is disabled by default for public repositories
  • Jira integration is disabled by default for public repositories
  • Linear integration is disabled by default for public repositories

You can enable these sources in your CodeRabbit configuration.

📥 Commits

Reviewing files that changed from the base of the PR and between 2485318 and dad5d7a.

⛔ Files ignored due to path filters (1)
  • packages/injective-test-tube/libinjectivetesttube/go.sum is excluded by !**/*.sum
📒 Files selected for processing (8)
  • .github/workflows/unit_test.yml (3 hunks)
  • .gitignore (0 hunks)
  • Cargo.toml (1 hunks)
  • packages/injective-test-tube/Cargo.toml (1 hunks)
  • packages/injective-test-tube/libinjectivetesttube/go.mod (4 hunks)
  • packages/injective-test-tube/libinjectivetesttube/testenv/setup.go (1 hunks)
  • packages/injective-test-tube/src/module/auction.rs (2 hunks)
  • packages/test-tube/Cargo.toml (1 hunks)
💤 Files with no reviewable changes (1)
  • .gitignore
🧰 Additional context used
🧬 Code Graph Analysis (1)
packages/injective-test-tube/src/module/auction.rs (1)
packages/injective-test-tube/src/runner/app.rs (1)
  • app (301-302)
🪛 YAMLlint (1.37.1)
.github/workflows/unit_test.yml

[error] 56-56: no new line character at the end of file

(new-line-at-end-of-file)

🔇 Additional comments (12)
packages/injective-test-tube/libinjectivetesttube/testenv/setup.go (2)

156-165: Good move: snapshotting UTC time for deterministic init.

Capturing now := time.Now().UTC() and using it for both InitChain and the initial context avoids flakiness in time-dependent tests. This is a solid improvement in determinism.


169-169: Consistency win: context header reuses the same timestamp.

Reusing now in NewUncachedContext aligns block header time with genesis time, preventing edge cases from closely spaced timestamps. LGTM.

packages/injective-test-tube/src/module/auction.rs (1)

26-28: Nice: exposing query_current_auction_basket in the module API.

The new query function is consistent with existing patterns and unblocks time-based test coverage.

packages/injective-test-tube/libinjectivetesttube/go.mod (1)

300-301: Core upgrade mapping looks correct.

github.com/InjectiveLabs/injective-core replaced with github.com/InjectiveFoundation/injective-core v1.16.3 aligns with the PR objective.

Cargo.toml (1)

6-7: Good: centralized workspace dep for ed25519-zebra.

Defining ed25519-zebra at the workspace level simplifies version alignment across crates.

packages/test-tube/Cargo.toml (2)

7-7: Version bump looks good and aligned with downstream.

2.0.8-1 aligns with the dependent crate update in injective-test-tube. No concerns.


13-18: Deps refresh LGTM (cosmrs, cosmwasm-std, prost, serde_json, thiserror, base64).

The versions and feature flags look correct for the target chain/tooling. No functional risks identified.

packages/injective-test-tube/Cargo.toml (5)

7-7: Version bump aligns with chain v1.16.3 – LGTM.

Matches the PR objective and pairs with injective-std exact pin below.


13-17: Core deps update and exact std pin look correct.

  • cosmrs 0.22.0 with ["cosmwasm","rpc"] and cosmwasm-std 2.2.2 are consistent.
  • injective-std pinned to =1.16.3-1 is appropriate for the chain upgrade.
  • prost 0.13.5 with "derive" matches current prost packaging.

20-21: Path + version for test-tube-inj is consistent.

Specifying both ensures the local path is used and the version stays in lockstep with the crate at that path. Good call.


31-31: Dev-dep cw1-whitelist -> 2.0.0 matches CosmWasm 2.x – LGTM.

This aligns with cosmwasm-std 2.2.x; no issues anticipated.


25-25: Workspace ed25519-zebra includes alloc; no conflicting overrides found

  • Workspace Cargo.toml declares
    ed25519-zebra = { version = "4.1.0", features = ["alloc"] }.
  • packages/injective-test-tube/Cargo.toml uses { workspace = true } and will inherit that feature set.
  • packages/test-tube/Cargo.toml explicitly pins the same version with features = ["alloc"].

No missing features or unintended duplicates were detected.

@jbernal87 jbernal87 requested a review from gorgos August 16, 2025 16:40
@InjectiveLabs InjectiveLabs deleted a comment from coderabbitai bot Sep 5, 2025
@jbernal87 jbernal87 merged commit ca64de7 into dev Sep 16, 2025
5 checks passed
@jbernal87 jbernal87 deleted the feat/v1.16.3 branch September 16, 2025 12:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants