Skip to content

Conversation

@jigar-arc10
Copy link
Contributor

@jigar-arc10 jigar-arc10 commented Oct 1, 2025

closes #1931

Summary by CodeRabbit

  • New Changes
    • Removed legacy network-version markers and unified network identification for consistent behavior.
  • Performance
    • Reduced application footprint by removing unused protocol/type assets.
  • Chores
    • Cleaned up environment variables across environments and removed unused third-party packages.
  • Notes for deployers
    • Environment-based version flags are no longer supported; rely on the selected network configuration.

@jigar-arc10 jigar-arc10 requested a review from a team as a code owner October 1, 2025 16:05
@jigar-arc10 jigar-arc10 marked this pull request as draft October 1, 2025 16:06
@coderabbitai
Copy link

coderabbitai bot commented Oct 1, 2025

Walkthrough

Removes network version variables and related schema/mappings, simplifies network config (version fields dropped), changes Network.id to string, deletes proto initialization/exports, removes akash-related dependencies, and adds general public network env vars in the local .env while stripping version keys from production/sandbox/staging.

Changes

Cohort / File(s) Summary
Environment variables & schemas
apps/provider-console/env/.env, apps/provider-console/env/.env.production, apps/provider-console/env/.env.sandbox, apps/provider-console/env/.env.staging, apps/provider-console/src/config/browser-env.config.ts, apps/provider-console/src/config/env-config.schema.ts
Added general public network env vars to local .env; removed NEXT_PUBLIC_NETWORK_VERSION and NEXT_PUBLIC_NETWORK_VERSION_MARKET from production/sandbox/staging and from browser env config and schema.
Network config & types
apps/provider-console/src/config/network.config.ts, apps/provider-console/src/types/network.ts, apps/provider-console/src/utils/constants.ts
Dropped version/versionMarket handling from network config and helpers; getCurrentNetworkConfig returns version as null; Network.id type changed to string; removed networkVersion / networkVersionMarket exports.
Proto initialization & re-exports
apps/provider-console/src/utils/init.ts, apps/provider-console/src/utils/proto/index.ts, apps/provider-console/src/utils/proto/grant.ts
Removed proto type selection and initProtoTypes() export; stopped calling proto init in app startup; removed several proto re-exports (feegrant/authz/tx and feegrant types).
Dependency cleanup
apps/provider-console/package.json
Removed dependencies: @akashnetwork/akash-api and @akashnetwork/akashjs.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant App
  participant Env as Env Config
  participant Net as Network Config

  rect rgb(245, 248, 255)
  note right of App: After changes (simplified flow)
  User->>App: Load Provider Console
  App->>Env: Read public env vars (no version fields)
  Env-->>App: Network selection
  App->>Net: getCurrentNetworkConfig()
  Net-->>App: Config { id, ..., version: null }
  App-->>User: Render UI with selected network
  end
Loading
sequenceDiagram
  autonumber
  actor User
  participant App
  participant Env as Env Config (before)
  participant Net as Network Config (before)
  participant Proto as Proto Types (before)

  rect rgb(255, 248, 240)
  note right of App: Previous flow (for contrast)
  User->>App: Load
  App->>Env: Read public env vars (incl. version, versionMarket)
  Env-->>App: Network + version fields
  App->>Net: getNetworkConfig()
  Net-->>App: Config { id, version, versionMarket }
  App->>Proto: initProtoTypes(network id)
  Proto-->>App: Selected proto types
  App-->>User: Render UI
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

Suggested reviewers

  • devalpatel67
  • baktun14
  • ygrishajev

Poem

A rabbit nibbles config lines at dawn,
Hops out versions that were holding on.
Packs made lighter, proto paths laid low,
IDs now strings and envs that softly glow.
Thump-thump — the console wakes to go! 🐇✨

Pre-merge checks and finishing touches

❌ Failed checks (1 warning, 1 inconclusive)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
Linked Issues Check ❓ Inconclusive The linked issue #1931 specifies the objective to "update any place where 'v1beta' is used in the provider console app" as part of integrating ChainSDK into the provider console. The changeset demonstrates removal of proto initialization, proto re-exports, and related infrastructure, which suggests migration away from locally-managed proto types. However, the provided summaries do not explicitly show the actual updates or replacements of v1beta references with SDK 53 equivalents, making it unclear whether the code now uses the updated ChainSDK types as intended. Without confirmation that v1beta references have been properly replaced with newer API versions, the compliance cannot be fully verified. Review the actual code changes to confirm that v1beta references have been replaced with SDK 53 equivalents, and verify that the removal of proto initialization and re-exports is accompanied by proper integration with ChainSDK types. Ensure that imports and API calls throughout the provider console now utilize the updated ChainSDK types as intended by issue #1931.
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "feat(provider): sdk 53 upgrade and cleanup dead code" clearly aligns with the changeset. The title accurately conveys the two main aspects of the work: an SDK upgrade (specifically SDK 53) and removal of dead code. The changes demonstrate significant cleanup including removal of proto type initialization, network version variables, unused dependencies, and re-exported types. The title is specific and descriptive, avoiding vague terms while summarizing the primary intent from the developer's perspective.
Out of Scope Changes Check ✅ Passed The changeset includes several modifications that appear aligned with the dual purpose of SDK upgrade and cleanup. Removal of network version environment variables (NEXT_PUBLIC_NETWORK_VERSION, NEXT_PUBLIC_NETWORK_VERSION_MARKET) and their configuration mappings, deletion of @akashnetwork/akash-api and @akashnetwork/akashjs dependencies, and simplification of the Network type suggest consolidation around ChainSDK. These changes can be justified as cleanup of legacy code that is superseded by SDK 53 integration. The removal of proto initialization code and re-exports directly supports the migration objective.
✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/provider-console/chain-sdk--53

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5ec2073 and cf96c3c.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (1)
  • apps/provider-console/package.json (0 hunks)
💤 Files with no reviewable changes (1)
  • apps/provider-console/package.json
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (13)
  • GitHub Check: validate (apps/indexer) / validate-unsafe
  • GitHub Check: validate / validate-app
  • GitHub Check: test-build
  • GitHub Check: validate / validate-app
  • GitHub Check: test-build
  • GitHub Check: validate / validate-app
  • GitHub Check: test-build
  • GitHub Check: test-build
  • GitHub Check: test-build
  • GitHub Check: validate / validate-app
  • GitHub Check: test-build
  • GitHub Check: validate / validate-app
  • GitHub Check: test-build

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@jigar-arc10 jigar-arc10 force-pushed the feat/provider-console/chain-sdk--53 branch from 63e6294 to 5dba5db Compare October 1, 2025 16:09
@codecov
Copy link

codecov bot commented Oct 1, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 46.28%. Comparing base (e3d2c7b) to head (fbb43b6).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1989      +/-   ##
==========================================
- Coverage   46.42%   46.28%   -0.15%     
==========================================
  Files        1016     1016              
  Lines       28674    28513     -161     
  Branches     7461     7384      -77     
==========================================
- Hits        13312    13197     -115     
+ Misses      14171    14125      -46     
  Partials     1191     1191              
Flag Coverage Δ
api 82.05% <ø> (+0.02%) ⬆️
deploy-web 24.63% <ø> (+<0.01%) ⬆️
log-collector 75.35% <ø> (ø)
notifications 88.11% <ø> (ø)
provider-console 81.48% <ø> (ø)
provider-proxy 84.61% <ø> (ø)
see 2 files with indirect coverage changes
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@jigar-arc10 jigar-arc10 marked this pull request as ready for review October 9, 2025 16:52
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

🧹 Nitpick comments (4)
apps/provider-console/env/.env (1)

4-15: Resolve dotenv-linter warnings

dotenv-linter is flagging the extra blank line, the unsorted key order, and the missing trailing newline for this block. Please tidy the spacing and sort the keys so the linter passes.

 NEXT_PUBLIC_SENTRY_DSN=https://[email protected]/2
-
-
-# Network Configurations
-NEXT_PUBLIC_SELECTED_NETWORK=mainnet
-NEXT_PUBLIC_NETWORK_TITLE=Mainnet
-NEXT_PUBLIC_CHAIN_ID=akashnet-2
-NEXT_PUBLIC_CHAIN_REGISTRY_NAME=akash
-NEXT_PUBLIC_NETWORK_TYPE=mainnet
-NEXT_PUBLIC_RPC_ENDPOINT=https://rpc.cosmos.directory/akash
-NEXT_PUBLIC_API_ENDPOINT=https://rest.cosmos.directory/akash
-NEXT_PUBLIC_CONSOLE_API_URL=https://console-api.akash.network
-NEXT_PUBLIC_SECURITY_URL=https://provider-console-security.akash.network
-NEXT_PUBLIC_API_BASE_URL=https://provider-console-api.akash.network
-NEXT_PUBLIC_URL=https://provider-console.akash.network
+# Network Configurations
+NEXT_PUBLIC_API_BASE_URL=https://provider-console-api.akash.network
+NEXT_PUBLIC_API_ENDPOINT=https://rest.cosmos.directory/akash
+NEXT_PUBLIC_CHAIN_ID=akashnet-2
+NEXT_PUBLIC_CHAIN_REGISTRY_NAME=akash
+NEXT_PUBLIC_CONSOLE_API_URL=https://console-api.akash.network
+NEXT_PUBLIC_NETWORK_TITLE=Mainnet
+NEXT_PUBLIC_NETWORK_TYPE=mainnet
+NEXT_PUBLIC_RPC_ENDPOINT=https://rpc.cosmos.directory/akash
+NEXT_PUBLIC_SECURITY_URL=https://provider-console-security.akash.network
+NEXT_PUBLIC_SELECTED_NETWORK=mainnet
+NEXT_PUBLIC_URL=https://provider-console.akash.network

Based on static analysis hints

apps/provider-console/src/types/network.ts (1)

10-10: Consider removing the unused version field.

Since version is now hardcoded to null in network.config.ts (line 24), this field appears to be dead code. If the version field is no longer needed as part of the SDK 53 upgrade, consider removing it from the type definition to simplify the interface.

Apply this diff if the field is confirmed unused:

-  version: string | null;
apps/provider-console/src/config/network.config.ts (2)

74-80: Rename function to reflect its actual purpose.

The function name getNetworkVersionInfo is misleading since it no longer returns version information—it only returns selectedNetworkId. Consider renaming to getSelectedNetworkId or similar to better reflect its current behavior.

Apply this diff to rename the function:

-export function getNetworkVersionInfo() {
+export function getSelectedNetworkId() {
   const selectedNetwork = browserEnvConfig.NEXT_PUBLIC_SELECTED_NETWORK ?? "mainnet";
 
   return {
     selectedNetworkId: selectedNetwork
   };
 }

Then update all call sites to use the new name:

#!/bin/bash
# Description: Find all call sites to update

# Find function calls
rg -nP --type=ts --type=tsx 'getNetworkVersionInfo\(' apps/provider-console/

24-24: Remove unused version field from network config: Hard-coding version = null is safe—no code reads config.version (all .version matches are on publicRuntimeConfig or node.version). Remove this property from NetworkConfig and networkStore to clean up dead code.

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 81a7979 and 5ec2073.

⛔ Files ignored due to path filters (1)
  • package-lock.json is excluded by !**/package-lock.json
📒 Files selected for processing (13)
  • apps/provider-console/env/.env (1 hunks)
  • apps/provider-console/env/.env.production (0 hunks)
  • apps/provider-console/env/.env.sandbox (0 hunks)
  • apps/provider-console/env/.env.staging (0 hunks)
  • apps/provider-console/package.json (0 hunks)
  • apps/provider-console/src/config/browser-env.config.ts (0 hunks)
  • apps/provider-console/src/config/env-config.schema.ts (0 hunks)
  • apps/provider-console/src/config/network.config.ts (1 hunks)
  • apps/provider-console/src/types/network.ts (1 hunks)
  • apps/provider-console/src/utils/constants.ts (0 hunks)
  • apps/provider-console/src/utils/init.ts (0 hunks)
  • apps/provider-console/src/utils/proto/grant.ts (0 hunks)
  • apps/provider-console/src/utils/proto/index.ts (0 hunks)
💤 Files with no reviewable changes (10)
  • apps/provider-console/package.json
  • apps/provider-console/src/config/env-config.schema.ts
  • apps/provider-console/src/utils/constants.ts
  • apps/provider-console/env/.env.sandbox
  • apps/provider-console/src/config/browser-env.config.ts
  • apps/provider-console/src/utils/proto/grant.ts
  • apps/provider-console/src/utils/proto/index.ts
  • apps/provider-console/src/utils/init.ts
  • apps/provider-console/env/.env.staging
  • apps/provider-console/env/.env.production
🧰 Additional context used
📓 Path-based instructions (2)
**/*.{ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

Never use type any or cast to type any. Always define the proper TypeScript types.

Files:

  • apps/provider-console/src/types/network.ts
  • apps/provider-console/src/config/network.config.ts
**/*.{js,ts,tsx}

📄 CodeRabbit inference engine (.cursor/rules/general.mdc)

**/*.{js,ts,tsx}: Never use deprecated methods from libraries.
Don't add unnecessary comments to the code

Files:

  • apps/provider-console/src/types/network.ts
  • apps/provider-console/src/config/network.config.ts
🧠 Learnings (1)
📚 Learning: 2025-08-12T13:52:38.708Z
Learnt from: stalniy
PR: akash-network/console#1800
File: apps/deploy-web/next.config.js:163-165
Timestamp: 2025-08-12T13:52:38.708Z
Learning: In the Akash Console project, akashnetwork/env-loader is used at the top of next.config.js files to automatically load environment variables from env/.env files into process.env. SENTRY_ORG and SENTRY_PROJECT are stored as public configuration values in apps/deploy-web/env/.env and are loaded this way, while only SENTRY_AUTH_TOKEN is handled as a GitHub secret in workflows.

Applied to files:

  • apps/provider-console/env/.env
🪛 dotenv-linter (3.3.0)
apps/provider-console/env/.env

[warning] 3-3: [ExtraBlankLine] Extra blank line detected

(ExtraBlankLine)


[warning] 6-6: [UnorderedKey] The NEXT_PUBLIC_NETWORK_TITLE key should go before the NEXT_PUBLIC_SELECTED_NETWORK key

(UnorderedKey)


[warning] 7-7: [UnorderedKey] The NEXT_PUBLIC_CHAIN_ID key should go before the NEXT_PUBLIC_NETWORK_TITLE key

(UnorderedKey)


[warning] 8-8: [UnorderedKey] The NEXT_PUBLIC_CHAIN_REGISTRY_NAME key should go before the NEXT_PUBLIC_NETWORK_TITLE key

(UnorderedKey)


[warning] 9-9: [UnorderedKey] The NEXT_PUBLIC_NETWORK_TYPE key should go before the NEXT_PUBLIC_SELECTED_NETWORK key

(UnorderedKey)


[warning] 10-10: [UnorderedKey] The NEXT_PUBLIC_RPC_ENDPOINT key should go before the NEXT_PUBLIC_SELECTED_NETWORK key

(UnorderedKey)


[warning] 11-11: [UnorderedKey] The NEXT_PUBLIC_API_ENDPOINT key should go before the NEXT_PUBLIC_CHAIN_ID key

(UnorderedKey)


[warning] 12-12: [UnorderedKey] The NEXT_PUBLIC_CONSOLE_API_URL key should go before the NEXT_PUBLIC_NETWORK_TITLE key

(UnorderedKey)


[warning] 13-13: [UnorderedKey] The NEXT_PUBLIC_SECURITY_URL key should go before the NEXT_PUBLIC_SELECTED_NETWORK key

(UnorderedKey)


[warning] 14-14: [UnorderedKey] The NEXT_PUBLIC_API_BASE_URL key should go before the NEXT_PUBLIC_API_ENDPOINT key

(UnorderedKey)


[warning] 15-15: [EndingBlankLine] No blank line at the end of the file

(EndingBlankLine)

🔇 Additional comments (1)
apps/provider-console/src/types/network.ts (1)

2-2: It looks like the “unrecognized file type: tsx” is coming from whatever CLI or bundler you’re using—it doesn’t know how to handle .tsx inputs and is exiting early (“Broken pipe”). To help diagnose:

• Which command (and tool) are you running when you get that error?
• How is your project configured to compile .tsx files (tsconfig, Babel, esbuild, etc.)?
• Does running a plain tsc or yarn build succeed?

Once we know your build setup and exact invocation, we can recommend the right loader or flag to add TSX support.

@jigar-arc10 jigar-arc10 merged commit f86e600 into main Oct 27, 2025
64 checks passed
@jigar-arc10 jigar-arc10 deleted the feat/provider-console/chain-sdk--53 branch October 27, 2025 15:38
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.

Integrate ChainSDK into Provider-Console UI

4 participants