Skip to content

sync main#279

Merged
ca333 merged 2 commits intomainfrom
dev
Nov 1, 2025
Merged

sync main#279
ca333 merged 2 commits intomainfrom
dev

Conversation

@ca333
Copy link
Copy Markdown
Contributor

@ca333 ca333 commented Nov 1, 2025

Summary by CodeRabbit

  • New Features

    • Logging configuration is now publicly available, enabling control over verbose logging output across activation processes.
  • Improvements

    • Activation logging throughout the framework now respects verbose logging settings, reducing log noise during standard operation while maintaining detailed diagnostics when enabled.

Copilot AI review requested due to automatic review settings November 1, 2025 20:57
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Nov 1, 2025

Walkthrough

The PR exports logging configuration types to the public API and gates debug logging across protocol activation strategies with a verbose logging flag to control log output without changing functional behavior.

Changes

Cohort / File(s) Summary
Logging Configuration Export
packages/komodo_defi_framework/lib/komodo_defi_framework.dart
Exported kdf_logging_config.dart to public API surface, making logging configuration types available to consumers.
Protocol Activation Strategies with Conditional Logging
packages/komodo_defi_sdk/lib/src/activation/protocol_strategies/{bch,custom_erc20,erc20,eth_task,eth_with_tokens,qtum,tendermint,utxo,zhtlc}_activation_strategy.dart
Added imports of komodo_defi_framework and wrapped existing debug log statements with if (KdfLoggingConfig.verboseLogging) guards across all activation strategy files. Logs now emit only when verbose logging is enabled. No changes to activation flow or RPC call logic.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

  • Note: While the changes span 10+ files, they follow a highly consistent and repetitive pattern (import addition + wrapping logs with conditional checks), which reduces complexity per file. The main review effort is verifying consistency across all strategy files and ensuring no logs are unintentionally omitted.

Possibly related PRs

  • sync main #261 — Modifies the same activation logging code paths and relies on shared logging configuration behavior.
  • sync main #257 — Extensive logging additions that rely on and interact with the same KdfLoggingConfig logging behavior.

Suggested labels

enhancement

Suggested reviewers

  • CharlVS

Poem

🐰 A framework grows with grace so bright,
Configuration logs now see the light,
Verbosity gated, noise controlled,
Activation strategies refined and bold,
Debug whispers only when they're told! 🎯

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.
Title Check ❓ Inconclusive The PR title "sync main" is a generic placeholder message that fails to convey meaningful information about the actual changes in the changeset. The changes consist of adding logging configuration exports and implementing conditional verbose logging across multiple activation strategy files, but the title provides no indication of these specific changes. The phrase "sync main" is non-descriptive and could apply to any synchronization operation, making it impossible for a teammate scanning the history to understand what was actually modified without examining the full changeset. Consider revising the title to something more specific and descriptive, such as "Add conditional verbose logging support to activation strategies" or "Export logging configuration and add verbose logging guards". This would clearly communicate the main purpose of the changes and help teammates understand the changeset at a glance.
✅ Passed checks (1 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
✨ 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 bb7881c and 0cdff3c.

📒 Files selected for processing (10)
  • packages/komodo_defi_framework/lib/komodo_defi_framework.dart (1 hunks)
  • packages/komodo_defi_sdk/lib/src/activation/protocol_strategies/bch_activation_strategy.dart (4 hunks)
  • packages/komodo_defi_sdk/lib/src/activation/protocol_strategies/custom_erc20_activation_strategy.dart (3 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 (2 hunks)
  • packages/komodo_defi_sdk/lib/src/activation/protocol_strategies/eth_with_tokens_activation_strategy.dart (2 hunks)
  • packages/komodo_defi_sdk/lib/src/activation/protocol_strategies/qtum_activation_strategy.dart (3 hunks)
  • packages/komodo_defi_sdk/lib/src/activation/protocol_strategies/tendermint_activation_strategy.dart (3 hunks)
  • packages/komodo_defi_sdk/lib/src/activation/protocol_strategies/utxo_activation_strategy.dart (2 hunks)
  • packages/komodo_defi_sdk/lib/src/activation/protocol_strategies/zhtlc_activation_strategy.dart (2 hunks)
⏰ 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). (2)
  • GitHub Check: Flutter tests (all packages)
  • GitHub Check: setup
🔇 Additional comments (23)
packages/komodo_defi_sdk/lib/src/activation/protocol_strategies/custom_erc20_activation_strategy.dart (2)

4-4: LGTM!

The import enables access to KdfLoggingConfig for conditional logging.


74-103: LGTM! Clean conditional logging implementation.

The debug logs are now properly gated by KdfLoggingConfig.verboseLogging while preserving the core activation logic and error handling unchanged. This follows a consistent pattern across the codebase.

packages/komodo_defi_sdk/lib/src/activation/protocol_strategies/utxo_activation_strategy.dart (2)

4-4: LGTM!

Import added to access logging configuration.


69-90: LGTM! Electrum logs properly gated.

The ELECTRUM-related debug logs are now conditional on verbose logging without affecting the activation flow or error handling.

packages/komodo_defi_sdk/lib/src/activation/protocol_strategies/qtum_activation_strategy.dart (2)

3-3: LGTM!

Framework import added for logging configuration access.


49-77: LGTM! Consistent conditional logging pattern.

All three debug log blocks are properly gated with KdfLoggingConfig.verboseLogging without affecting the QTUM activation logic.

packages/komodo_defi_sdk/lib/src/activation/protocol_strategies/zhtlc_activation_strategy.dart (2)

7-7: LGTM!

Import enables conditional logging for ZHTLC activation.


107-118: LGTM! ZHTLC debug logs appropriately gated.

The verbose logging guards are correctly applied to ZHTLC activation debug logs while preserving the complex streaming activation logic.

packages/komodo_defi_sdk/lib/src/activation/protocol_strategies/erc20_activation_strategy.dart (2)

4-4: LGTM!

Import added for logging configuration.


75-102: LGTM! ERC20 token activation logs properly gated.

Debug logs for token activation are now conditional on KdfLoggingConfig.verboseLogging without affecting the activation flow or error handling.

packages/komodo_defi_sdk/lib/src/activation/protocol_strategies/eth_task_activation_strategy.dart (2)

3-3: LGTM!

Import enables conditional logging for ETH task-based activation.


97-118: LGTM! ETH task activation logs appropriately gated.

The debug logs for task-based ETH activation (used with Trezor) are now conditional without affecting the activation logic or hardware device interaction flows.

packages/komodo_defi_sdk/lib/src/activation/protocol_strategies/bch_activation_strategy.dart (2)

4-4: LGTM!

Import added for logging configuration, even though this strategy is deprecated.


97-189: LGTM! BCH and SLP logs consistently gated.

All four debug log blocks (BCH activation, BCH success, SLP activation, SLP success) are properly wrapped with KdfLoggingConfig.verboseLogging guards. The activation logic for both BCH and SLP tokens remains unchanged.

Note: This strategy is deprecated, but the changes maintain consistency with the codebase.

packages/komodo_defi_framework/lib/komodo_defi_framework.dart (1)

17-17: No issues found—implementation satisfies all verification requirements.

The export of KdfLoggingConfig is correct and all concerns are properly addressed:

  • KdfLoggingConfig.verboseLogging defaults to false, which is sensible for reducing log noise
  • The field is a static variable initialized at class definition time, ensuring it's ready before any code executes
  • Activation strategies and framework components safely access the field across 20+ usage sites
  • The private constructor prevents accidental instantiation while allowing static field access
packages/komodo_defi_sdk/lib/src/activation/protocol_strategies/eth_with_tokens_activation_strategy.dart (4)

3-3: LGTM: Import added for logging configuration.

The import provides access to KdfLoggingConfig for controlling verbose logging behavior.


118-123: LGTM: Verbose guard correctly applied to activation start log.

The conditional guard ensures this debug log only executes when verbose logging is enabled, without affecting activation functionality.


124-129: LGTM: Verbose guard correctly applied to detailed activation parameters log.

The guard ensures the JSON encoding and map construction only occur when verbose logging is enabled, avoiding unnecessary overhead during normal operation.


136-141: LGTM: Verbose guard correctly applied to activation success log.

The conditional guard ensures this success log only executes when verbose logging is enabled, maintaining consistency with the other logging guards in this strategy.

packages/komodo_defi_sdk/lib/src/activation/protocol_strategies/tendermint_activation_strategy.dart (4)

3-3: LGTM: Import added for logging configuration.

The import provides access to KdfLoggingConfig for controlling verbose logging behavior, consistent with the ETH strategy implementation.


110-115: LGTM: Verbose guard correctly applied to activation start log.

The conditional guard ensures this debug log only executes when verbose logging is enabled, following the same pattern as the ETH strategy.


116-130: LGTM: Verbose guard correctly applied to detailed activation parameters log.

The guard ensures the JSON encoding and map construction only occur when verbose logging is enabled. The multi-line formatting makes the comprehensive parameter set more readable while avoiding overhead during normal operation.


138-143: LGTM: Verbose guard correctly applied to task initiation log.

The conditional guard ensures this task status log only executes when verbose logging is enabled, completing the consistent verbose logging pattern across the Tendermint activation strategy.


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.

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 adds conditional logging based on the KdfLoggingConfig.verboseLogging flag to reduce log noise in production. The change wraps existing debug log statements in various activation strategy classes with verbose logging checks.

  • Introduces KdfLoggingConfig class with a verboseLogging static flag
  • Wraps debug log statements in activation strategies with conditional checks
  • Exports KdfLoggingConfig from the framework package

Reviewed Changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
komodo_defi_framework.dart Exports the new KdfLoggingConfig class
zhtlc_activation_strategy.dart Wraps ZHTLC activation debug logs with verbose logging checks
utxo_activation_strategy.dart Wraps UTXO/Electrum activation debug logs with verbose logging checks
tendermint_activation_strategy.dart Wraps Tendermint activation debug logs with verbose logging checks
qtum_activation_strategy.dart Wraps QTUM activation debug logs with verbose logging checks
eth_with_tokens_activation_strategy.dart Wraps ETH platform activation debug logs with verbose logging checks
eth_task_activation_strategy.dart Wraps ETH task-based activation debug logs with verbose logging checks
erc20_activation_strategy.dart Wraps ERC20 token activation debug logs with verbose logging checks
custom_erc20_activation_strategy.dart Wraps custom ERC20 token activation debug logs with verbose logging checks
bch_activation_strategy.dart Wraps BCH and SLP token activation debug logs with verbose logging checks

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

Comment on lines +107 to +118
if (KdfLoggingConfig.verboseLogging) {
log(
'[RPC] Activating ZHTLC coin: ${asset.id.id}',
name: 'ZhtlcActivationStrategy',
);
log(
}
if (KdfLoggingConfig.verboseLogging) {
log(
'[RPC] Activation parameters: ${jsonEncode({'ticker': asset.id.id, 'protocol': asset.protocol.subClass.formatted, 'activation_params': params.toRpcParams(), 'zcash_params_path': userConfig.zcashParamsPath, 'scan_blocks_per_iteration': userConfig.scanBlocksPerIteration, 'scan_interval_ms': userConfig.scanIntervalMs, 'polling_interval_ms': effectivePollingInterval.inMilliseconds, 'priv_key_policy': privKeyPolicy.toJson()})}',
name: 'ZhtlcActivationStrategy',
);
}
Copy link

Copilot AI Nov 1, 2025

Choose a reason for hiding this comment

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

Two consecutive log statements are wrapped in separate if (KdfLoggingConfig.verboseLogging) blocks. These should be combined into a single conditional block to reduce redundancy and improve readability.

Copilot uses AI. Check for mistakes.
Comment on lines +110 to 118
if (KdfLoggingConfig.verboseLogging) {
log(
'[RPC] Activating Tendermint platform: ${asset.id.id}',
name: 'TendermintWithTokensActivationStrategy',
);
log(
}
if (KdfLoggingConfig.verboseLogging) {
log(
'[RPC] Activation parameters: ${jsonEncode({
Copy link

Copilot AI Nov 1, 2025

Choose a reason for hiding this comment

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

Two consecutive log statements are wrapped in separate if (KdfLoggingConfig.verboseLogging) blocks. These should be combined into a single conditional block to reduce redundancy and improve readability.

Copilot uses AI. Check for mistakes.
Comment on lines +49 to 57
if (KdfLoggingConfig.verboseLogging) {
log(
'[RPC] Activating QTUM coin: ${asset.id.id}',
name: 'QtumActivationStrategy',
);
log(
}
if (KdfLoggingConfig.verboseLogging) {
log(
'[RPC] Activation parameters: ${jsonEncode({
Copy link

Copilot AI Nov 1, 2025

Choose a reason for hiding this comment

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

Two consecutive log statements are wrapped in separate if (KdfLoggingConfig.verboseLogging) blocks. These should be combined into a single conditional block to reduce redundancy and improve readability.

Copilot uses AI. Check for mistakes.
Comment on lines +118 to +129
if (KdfLoggingConfig.verboseLogging) {
log(
'[RPC] Activating ETH platform: ${asset.id.id}',
name: 'EthWithTokensActivationStrategy',
);
log(
}
if (KdfLoggingConfig.verboseLogging) {
log(
'[RPC] Activation parameters: ${jsonEncode({'ticker': asset.id.id, 'protocol': asset.protocol.subClass.formatted, 'token_count': children?.length ?? 0, 'tokens': children?.map((e) => e.id.id).toList() ?? [], 'activation_params': activationParams.toRpcParams(), 'priv_key_policy': privKeyPolicy.toJson()})}',
name: 'EthWithTokensActivationStrategy',
);
}
Copy link

Copilot AI Nov 1, 2025

Choose a reason for hiding this comment

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

Two consecutive log statements are wrapped in separate if (KdfLoggingConfig.verboseLogging) blocks. These should be combined into a single conditional block to reduce redundancy and improve readability.

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

github-actions bot commented Nov 1, 2025

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

https://komodo-playground--pr279-dev-vfaqs1cf.web.app

(expires Sat, 08 Nov 2025 21:04:04 GMT)

🔥 via Firebase Hosting GitHub Action 🌎

Sign: 2bfedd77fdea45b25ba7c784416e81f177aa5c47

@ca333 ca333 merged commit bd25579 into main Nov 1, 2025
15 of 18 checks passed
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