Skip to content

sync main#257

Merged
ca333 merged 2 commits intomainfrom
dev
Oct 26, 2025
Merged

sync main#257
ca333 merged 2 commits intomainfrom
dev

Conversation

@ca333
Copy link
Copy Markdown
Contributor

@ca333 ca333 commented Oct 26, 2025

Summary by CodeRabbit

  • New Features

    • Added support for Base chain and Base tokens across activation and transaction history services.
    • Introduced KDF health check with automatic recovery capability.
    • Added optional debug logging for RPC calls and balance polling.
  • Bug Fixes

    • Fixed RPC endpoint addressing for improved mobile compatibility.
  • Chores

    • Updated bundled coins repository reference.

takenagain and others added 2 commits October 26, 2025 12:23
* feat(sdk): add support for ETH-BASE

* chore(deps): bump coins repo commit to base addition

* feat(etherscan): add ETH-BASE urls

* chore(etherscan): remove unsupported FTM, KRC, and HT tokens
* add kdf health check and recovery

* add debug logging
Copilot AI review requested due to automatic review settings October 26, 2025 12:11
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Oct 26, 2025

Caution

Review failed

The pull request is closed.

Walkthrough

This pull request adds Base chain support to the Komodo DeFi SDK, introduces debug logging infrastructure for RPC calls and balance polling with performance metrics, implements a health check mechanism in the authentication layer, and updates the bundled coins repository reference. The changes modify 16 files across the framework, client, authentication, and asset management layers.

Changes

Cohort / File(s) Summary
Build Configuration
packages/komodo_defi_framework/app_build/build_config.json
Updated bundled_coins_repo_commit from 9d99819f3f7a8357464240c8c26f7442f5a7da32 to 3d23cb5dcc82d4bb8c88f8ebf67ad3fb51ed3b6b
RPC Debug Logging Infrastructure
packages/komodo_defi_framework/lib/komodo_defi_framework.dart, packages/komodo_defi_sdk/lib/src/balances/balance_manager.dart, packages/komodo_defi_framework/lib/src/client/kdf_api_client.dart
Added static enableDebugLogging flags to toggle verbose logging; integrated Stopwatch-based duration tracking for RPC and balance polling operations; added structured logging for Electrum-related methods with connection details; added error logging with method names and durations on failure
KDF Health Check
packages/komodo_defi_framework/lib/komodo_defi_framework.dart
Added isHealthy() method to verify framework is running and responsive; added private Logger instance
Authentication Health Check
packages/komodo_defi_local_auth/lib/src/auth/auth_service.dart, packages/komodo_defi_local_auth/lib/src/komodo_defi_local_auth.dart, packages/komodo_defi_local_auth/lib/src/trezor/trezor_auth_service.dart
Added ensureKdfHealthy() method across IAuthService, KdfAuthService, KomodoDefiAuth, KomodoDefiLocalAuth, and TrezorAuthService to check KDF health and attempt recovery via restart if unhealthy
RPC Endpoint Configuration
packages/komodo_defi_framework/lib/src/operations/kdf_operations_native.dart
Changed MM2 RPC HTTP endpoint from localhost to 127.0.0.1 to resolve DNS issues on mobile platforms
Base Chain Enum Support
packages/komodo_defi_types/lib/src/coin_classes/coin_subclasses.dart
Added CoinSubClass.base enum value; updated ticker, iconTicker, formatted, color, tokenStandardSuffix getters to handle base; added base to evmCoinSubClasses set
Base Chain Activation Support
packages/komodo_defi_sdk/lib/src/activation/protocol_strategies/custom_erc20_activation_strategy.dart, packages/komodo_defi_sdk/lib/src/activation/protocol_strategies/erc20_activation_strategy.dart, packages/komodo_defi_sdk/lib/src/activation/protocol_strategies/eth_task_activation_strategy.dart, packages/komodo_defi_sdk/lib/src/activation/protocol_strategies/eth_with_tokens_activation_strategy.dart
Added CoinSubClass.base to supportedProtocols set in all four ERC-20-like activation strategies
Transaction History & Protocol Routing
packages/komodo_defi_sdk/lib/src/transaction_history/strategies/etherscan_transaction_history_strategy.dart, packages/komodo_defi_types/lib/src/coin_classes/protocol_class.dart
Added base chain endpoint support (_ethBaseUrl, _ethBaseTokenUrl) to Etherscan strategy; removed deprecated endpoints (heco, ftm, krc20); added CoinSubClass.base routing to Erc20Protocol in ProtocolClass.fromJson

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Debug logging additions: Straightforward conditional logging with duration tracking across three files; pattern is consistent and repetitive
  • Health check implementation: New logic in authentication layer requires verification of recovery flow (restart behavior on unhealthy state)
  • Base chain rollout: Systematic additions across activation strategies and type definitions are repetitive but must be verified for consistency
  • Key areas requiring attention:
    • Verify health check recovery logic handles both no-auth and authenticated user scenarios correctly
    • Confirm all Base chain additions (enum, activation, protocol routing, endpoints) are properly integrated and consistent
    • Review RPC duration logging accuracy and performance impact
    • Validate Electrum connection info logging correctness

Possibly related PRs

Suggested labels

enhancement

Suggested reviewers

  • CharlVS
  • smk762

Poem

🐰 A Base chain hops into the fold,
Debug logs trace each RPC's tale,
Health checks keep the frame on course,
From enum values new and bold,
The framework stands both sound and hale! 🎉

✨ Finishing touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch dev

📜 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 eac3044 and 0b23126.

📒 Files selected for processing (15)
  • packages/komodo_defi_framework/app_build/build_config.json (1 hunks)
  • packages/komodo_defi_framework/lib/komodo_defi_framework.dart (3 hunks)
  • packages/komodo_defi_framework/lib/src/client/kdf_api_client.dart (1 hunks)
  • packages/komodo_defi_framework/lib/src/operations/kdf_operations_native.dart (1 hunks)
  • packages/komodo_defi_local_auth/lib/src/auth/auth_service.dart (2 hunks)
  • packages/komodo_defi_local_auth/lib/src/komodo_defi_local_auth.dart (2 hunks)
  • packages/komodo_defi_local_auth/lib/src/trezor/trezor_auth_service.dart (1 hunks)
  • packages/komodo_defi_sdk/lib/src/activation/protocol_strategies/custom_erc20_activation_strategy.dart (2 hunks)
  • packages/komodo_defi_sdk/lib/src/activation/protocol_strategies/erc20_activation_strategy.dart (2 hunks)
  • packages/komodo_defi_sdk/lib/src/activation/protocol_strategies/eth_task_activation_strategy.dart (1 hunks)
  • packages/komodo_defi_sdk/lib/src/activation/protocol_strategies/eth_with_tokens_activation_strategy.dart (1 hunks)
  • packages/komodo_defi_sdk/lib/src/balances/balance_manager.dart (3 hunks)
  • packages/komodo_defi_sdk/lib/src/transaction_history/strategies/etherscan_transaction_history_strategy.dart (2 hunks)
  • packages/komodo_defi_types/lib/src/coin_classes/coin_subclasses.dart (7 hunks)
  • packages/komodo_defi_types/lib/src/coin_classes/protocol_class.dart (1 hunks)

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.

@ca333 ca333 merged commit 7197de6 into main Oct 26, 2025
4 of 6 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR synchronizes the main branch with updates that add support for the Base blockchain network and improve debugging capabilities across the KDF stack. The changes include adding Base as a new EVM-compatible chain alongside existing networks like Ethereum, Arbitrum, and Polygon.

Key changes:

  • Adds Base blockchain support throughout the activation, transaction history, and protocol infrastructure
  • Implements debug logging capabilities for RPC calls and balance polling operations
  • Fixes DNS resolution issues on mobile platforms by using 127.0.0.1 instead of localhost
  • Updates bundled coins repository commit reference

Reviewed Changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/komodo_defi_types/lib/src/coin_classes/coin_subclasses.dart Adds Base enum value and supporting metadata (name, color, token standard)
packages/komodo_defi_types/lib/src/coin_classes/protocol_class.dart Includes Base in EVM chain subclass validation
packages/komodo_defi_sdk/lib/src/transaction_history/strategies/etherscan_transaction_history_strategy.dart Adds Base transaction history endpoints and removes deprecated chain endpoints
packages/komodo_defi_sdk/lib/src/balances/balance_manager.dart Adds configurable debug logging for balance polling operations
packages/komodo_defi_sdk/lib/src/activation/protocol_strategies/*.dart Registers Base in various activation strategy supported subclasses sets
packages/komodo_defi_local_auth/lib/src/trezor/trezor_auth_service.dart Adds ensureKdfHealthy delegation to underlying auth service
packages/komodo_defi_local_auth/lib/src/komodo_defi_local_auth.dart Exposes ensureKdfHealthy method in public API with documentation
packages/komodo_defi_local_auth/lib/src/auth/auth_service.dart Implements KDF health checking with automatic recovery
packages/komodo_defi_framework/lib/src/operations/kdf_operations_native.dart Changes localhost to 127.0.0.1 to prevent DNS issues on mobile
packages/komodo_defi_framework/lib/src/client/kdf_api_client.dart Adds detailed RPC call logging with electrum-specific tracking
packages/komodo_defi_framework/lib/komodo_defi_framework.dart Implements isHealthy check and RPC logging infrastructure
packages/komodo_defi_framework/app_build/build_config.json Updates bundled coins repository commit hash
Comments suppressed due to low confidence (1)

packages/komodo_defi_sdk/lib/src/transaction_history/strategies/etherscan_transaction_history_strategy.dart:1

  • The token standard for Base should be 'BASE20' to match the established pattern of other EVM chains (e.g., 'ARB20' for Arbitrum, 'AVX20' for Avalanche, 'FTM20' for Fantom). The current value 'BASE' breaks this naming convention.
import 'package:collection/collection.dart';

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +31 to +33
if (!enableDebugLogging) {
return _rpcCallback(request);
}
Copy link

Copilot AI Oct 26, 2025

Choose a reason for hiding this comment

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

The logic is inverted: when debug logging is disabled, the function returns early without logging, but when enabled, it falls through to logging code. However, this means debug logging only works when enableDebugLogging is true, which contradicts the early return. The condition should be if (!enableDebugLogging) with the simple return path, or the logic flow needs restructuring to ensure logging happens when enabled.

Copilot uses AI. Check for mistakes.
@github-actions
Copy link
Copy Markdown
Contributor

Visit the preview URL for this PR (updated for commit 0b23126):

https://kdf-sdk--pr257-dev-uar4w2zt.web.app

(expires Sun, 02 Nov 2025 12:16:36 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 9c1b6e6c010cf0b965c455ba7a69c4aedafa8a1d

@github-actions
Copy link
Copy Markdown
Contributor

Visit the preview URL for this PR (updated for commit 0b23126):

https://komodo-playground--pr257-dev-hjwoqjd7.web.app

(expires Sun, 02 Nov 2025 12:17:30 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 2bfedd77fdea45b25ba7c784416e81f177aa5c47

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.

3 participants