Skip to content

Integrate and verify ZHTLC in komodo_defi_sdk#196

Merged
CharlVS merged 2 commits intocursor/integrate-zhtlc-types-and-rpcs-4654from
cursor/integrate-and-verify-zhtlc-in-komodo-defi-sdk-823b
Aug 21, 2025
Merged

Integrate and verify ZHTLC in komodo_defi_sdk#196
CharlVS merged 2 commits intocursor/integrate-zhtlc-types-and-rpcs-4654from
cursor/integrate-and-verify-zhtlc-in-komodo-defi-sdk-823b

Conversation

@CharlVS
Copy link
Copy Markdown
Collaborator

@CharlVS CharlVS commented Aug 18, 2025

Refactor ZHTLC activation to use the dedicated zhtlc RPC namespace and TaskShepherd for robust task management and accurate block reporting.


Open in Cursor Open in Web

Co-authored-by: charl <charl@vanstaden.info>
@cursor
Copy link
Copy Markdown

cursor bot commented Aug 18, 2025

Cursor Agent can help with this pull request. Just @cursor in comments and I'll start working on changes in this branch.
Learn more about Cursor Agents

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Aug 18, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Important

Review skipped

Draft detected.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch cursor/integrate-and-verify-zhtlc-in-komodo-defi-sdk-823b

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
🪧 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.

cursor[bot]

This comment was marked as outdated.

@CharlVS CharlVS marked this pull request as ready for review August 21, 2025 17:41
@CharlVS CharlVS merged commit e61dc52 into cursor/integrate-zhtlc-types-and-rpcs-4654 Aug 21, 2025
2 of 6 checks passed
@CharlVS CharlVS deleted the cursor/integrate-and-verify-zhtlc-in-komodo-defi-sdk-823b branch August 21, 2025 17:42
CharlVS added a commit that referenced this pull request Oct 2, 2025
* Enhance ZHTLC activation with improved config parsing and RPC methods

Co-authored-by: charl <charl@vanstaden.info>

* feat(zhtlc): integrate ZHTLC types and task RPCs per KDF API

* dragon_logs: remove tracked ignored files and add .gitignore files

* Integrate and verify ZHTLC in komodo_defi_sdk (#196)

* Refactor ZHTLC activation strategy with stream-based task handling

Co-authored-by: charl <charl@vanstaden.info>

* Refactor activation steps to use strongly-typed ActivationStep enum

Co-authored-by: charl <charl@vanstaden.info>

---------

Co-authored-by: Cursor Agent <cursoragent@cursor.com>

* chore: run code generators

* chore(git): delete previously tracked igored files

* Fix ERC20 and ZHTLC activation params serialization and method calls (#212)

Co-authored-by: Cursor Agent <cursoragent@cursor.com>

* fix: misc fixes

* docs(activation): add activation params refactoring plan

Clean base/subclass separation, canonical serialization + encoder strategy, user configuration + persistence, BLoC timeout, SDK integration via AssetId extension and resolveActivationParams, and migration steps. No backwards compatibility required.

* docs(sdk): activation refactoring v2

* feat(activation,zhtlc,sdk,rpc)!: extract ZHTLC fields to ZhtlcActivationParams; add ActivationConfigService; unify priv_key_policy serialization; normalize toRpcParams; formatting fixes

* Checkpoint before follow-up message

Co-authored-by: charl <charl@vanstaden.info>

* Fix: Remove unused import statement

Co-authored-by: charl <charl@vanstaden.info>

* feat: Add support for electrum_servers in Zhtlc activation

Co-authored-by: charl <charl@vanstaden.info>

* feat: initialize Firebase hosting for SDK example and playground

- Add Firebase hosting configuration for packages/komodo_defi_sdk/example
  - Configure to use kdf-sdk hosting site on komodo-defi-sdk project
  - Set up hosting target mapping
- Add Firebase hosting configuration for playground
  - Configure to use default hosting site on komodo-playground project
- Update GitHub Actions workflows to use target parameter for SDK example
- Update .gitignore to allow Firebase config files in example and playground

* fix: update z-coin activation strategy and example UI

- Update zhtlc_activation_strategy for improved activation handling
- Add activation config service enhancements
- Update logged_in_view_widget with improved UI for instance management
- Export additional SDK functionality in public API

* docs(firebase): reorganize Firebase deployment scripts and documentation

- Move Firebase scripts to .github/scripts/firebase/ directory
- Rename scripts for clarity:
  - setup-firebase-secrets.sh → setup-github-secrets.sh
  - verify-firebase-secrets.sh → verify-github-secrets.sh
- Move documentation to docs/firebase/ directory
- Rename documentation file to firebase-deployment-setup.md
- Update script paths in documentation
- Add README for scripts directory

* fix: remove global singleton registration of ActivationConfigService

- Remove global GetIt.I registration to prevent conflicts between multiple SDK instances
- Pass ActivationConfigService through constructor chain instead of global resolution
- Update ZhtlcActivationStrategy to accept service via constructor
- Update ActivationStrategyFactory and ActivationManager to propagate the service
- Prevent memory leaks and use-after-dispose issues when SDK instances are disposed

This ensures each SDK instance maintains its own isolated ActivationConfigService,
fixing issues where only the first SDK's service would be globally registered.

* fix(activation): register ActivationConfigService during bootstrap

- Ensure service is available before ActivationManager to fix ZHTLC/Z-coin activation flow\n- Remove duplicate registration from KomodoDefiSdk.init\n- Example: use instance sdk instead of context.read for ZHTLC prompt

* docs(tech-debt): add Activation & ZHTLC tech-debt report and refine sections

* feat(komodo_defi_sdk): add HiveActivationConfigRepository and integrate in activation flow; update bootstrap, activation service, and example widget

* fix: resolve external logging callback flaws and memory leak

- Fix native callback memory leak by disposing _kdfOperations in KomodoDefiFramework
- Remove debug-only conditional logging in bootstrap.dart
- Fix potential double subscription in komodo_defi_sdk.dart
- Add comprehensive error handling to log stream listeners
- Replace empty catch blocks with proper error handling
- Add safe logging helpers to prevent callback exceptions from crashing
- Ensure log streams continue operating even after callback errors

* refactor(withdrawals): inject LegacyWithdrawalManager and use for Tendermint flows

- add _legacyManager constructor param and field
- delegate Tendermint preview/withdraw to injected manager
- minor formatting and watch() simplifications

* fix(kdf-ops): use conditional imports for platform-specific imports

i.e. dart:ffi

* fix(activation-params): include other RPC server keys

* fix(activation-config-repository): register adapter type

* feat(zhtlc): add desktop zcash params downloader (#228)

* feat(sdk): add zhltc params file downloader

* feat(sdk-example): integrate zcash downloader for desktop

* chore: remove groth from default params download list

* test(komodo-defi-sdk): fix failing zcash unit tests

* refactor: clean up imports, tests, and dialog date conversion

* feat(zhtlc): add mobile config params downloader

* feat(zhtlc): web lightwallet server URLs workaround

* fix(zhtlc): align orderbook RPC with KDF schema, and add id pagination support (#229)

* feat(zhtlc-tx): add from_id pagination support from RPC docs

* fix(orderbook-v2): use v2 fields and types

* fix(source-address-field): use consistent text theme to fix visibility

* fix(order-address): change address data to optional for shielded ops

* fix(json-utils): convert int to string in traverse as it's lossless

* test(sdk): fix missing type in zcash mock classes

* fix(address-select-input): use consistent text theme to fix visibility

* feat(zhtlc): estimate activation percentage based on block height (#230)

* feat(zhtlc): estimate activation percentage based on block height

* refactor(review): remove unnecessary casts, states, and configurable polling

* fix(config-transform): only replace lightwalletservers if wss is not empty

* Fix ZHTLC activation issues and improve resilience

Co-authored-by: charl <charl@vanstaden.info>

---------

Co-authored-by: Charl (Nitride) <77973576+CharlVS@users.noreply.github.com>
Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: charl <charl@vanstaden.info>
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