-
Notifications
You must be signed in to change notification settings - Fork 9
Feat/v1.16.3 #60
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/v1.16.3 #60
Conversation
WalkthroughAdds 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
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
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
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~25 minutes Poem
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 unit tests
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. CodeRabbit Commands (Invoked using PR/Issue comments)Type Other keywords and placeholders
CodeRabbit Configuration File (
|
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
There was a problem hiding this 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
godirective must be major.minor (e.g.,1.23).1.23.9is invalid and will breakgotooling.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.typesis limited toopened, so pushes to an existing PR won’t trigger CI. Includereopenedandsynchronizeto 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.
⛔ Files ignored due to path filters (1)
packages/injective-test-tube/libinjectivetesttube/go.sumis 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
nowin 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-corereplaced withgithub.com/InjectiveFoundation/injective-core v1.16.3aligns with the PR objective.Cargo.toml (1)
6-7: Good: centralized workspace dep for ed25519-zebra.Defining
ed25519-zebraat 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: Workspaceed25519-zebraincludesalloc; no conflicting overrides found
- Workspace
Cargo.tomldeclares
ed25519-zebra = { version = "4.1.0", features = ["alloc"] }.packages/injective-test-tube/Cargo.tomluses{ workspace = true }and will inherit that feature set.packages/test-tube/Cargo.tomlexplicitly pins the same version withfeatures = ["alloc"].No missing features or unintended duplicates were detected.
Upgrade to chain version 1.16.3
Summary by CodeRabbit
New Features
Bug Fixes
Tests
Chores