Skip to content

chore: add Manki AI code review configuration#595

Closed
xdustinface wants to merge 4 commits intodashpay:v0.42-devfrom
xdustinface:chore-add-manki-config
Closed

chore: add Manki AI code review configuration#595
xdustinface wants to merge 4 commits intodashpay:v0.42-devfrom
xdustinface:chore-add-manki-config

Conversation

@xdustinface
Copy link
Copy Markdown
Collaborator

@xdustinface xdustinface commented Mar 30, 2026

Summary

  • Add .manki.yml with project-specific review instructions for Dash protocol
  • Add .github/workflows/manki.yml workflow trigger

Manki is a multi-agent AI code review action that provides specialized review feedback. Configuration includes:

  • Auto-review on PR open/update
  • Auto-approve when findings are resolved
  • Instructions tailored for Dash protocol, consensus safety, FFI, and crypto
  • Excluded paths for lock files and fuzz corpus

Summary by CodeRabbit

  • Refactor

    • Consolidated transaction block metadata parameters into a unified structure, simplifying wallet transaction checking and record APIs.
    • Restructured transaction context handling to use a unified approach for confirmed and unconfirmed states.
    • Enhanced error handling for invalid block information in confirmed transaction contexts.
  • Chores

    • Added automated AI-powered code review workflow to the repository.

Replace separate block-related fields with a `context: TransactionContext` in
`TransactionRecord`, preserving the full transaction context (mempool, instant-send,
in-block, chain-locked). Replace `mark_confirmed`/`mark_unconfirmed` with a single
`update_context` method. Introduce `FFIBlockInfo` struct and use
`FFITransactionContextDetails` in `FFITransactionRecord` to expose the full context
across the FFI boundary.
@github-actions github-actions bot added the merge-conflict The PR conflicts with the target branch. label Mar 30, 2026
@github-actions
Copy link
Copy Markdown

This PR has merge conflicts with the base branch. Please rebase or merge the base branch into your branch to resolve them.

@xdustinface
Copy link
Copy Markdown
Collaborator Author

Opened on wrong repo by mistake

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Mar 30, 2026

Caution

Review failed

The pull request is closed.

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 6dfc7456-ccda-4a0b-9e92-d6fc867b57fa

📥 Commits

Reviewing files that changed from the base of the PR and between 472131a and 2762b55.

📒 Files selected for processing (19)
  • .github/workflows/manki.yml
  • .manki.yml
  • key-wallet-ffi/FFI_API.md
  • key-wallet-ffi/src/managed_account.rs
  • key-wallet-ffi/src/transaction.rs
  • key-wallet-ffi/src/transaction_checking.rs
  • key-wallet-ffi/src/types.rs
  • key-wallet-ffi/src/wallet_manager.rs
  • key-wallet-ffi/src/wallet_manager_tests.rs
  • key-wallet/src/managed_account/mod.rs
  • key-wallet/src/managed_account/transaction_record.rs
  • key-wallet/src/manager/event_tests.rs
  • key-wallet/src/manager/test_helpers.rs
  • key-wallet/src/tests/spent_outpoints_tests.rs
  • key-wallet/src/transaction_checking/transaction_context.rs
  • key-wallet/src/transaction_checking/transaction_router/tests/helpers.rs
  • key-wallet/src/transaction_checking/transaction_router/tests/identity_transactions.rs
  • key-wallet/src/transaction_checking/transaction_router/tests/routing.rs
  • key-wallet/src/transaction_checking/wallet_checker.rs

📝 Walkthrough

Walkthrough

This PR refactors block parameter handling across FFI and core wallet layers by consolidating scattered height, block_hash, and timestamp parameters into new FFIBlockInfo (FFI) and BlockInfo (core) structures. Transaction context APIs and record storage are updated to use these consolidated types, with new validation logic rejecting zeroed block info for confirmed transactions. CI/CD configuration adds Manki AI code review automation.

Changes

Cohort / File(s) Summary
CI/CD & Code Review Setup
.github/workflows/manki.yml, .manki.yml
Adds GitHub Actions workflow for automated Manki AI code review on PRs and issues, with configuration emphasizing Rust safety, FFI correctness, and consensus-critical path validation.
FFI Block Info & Type System
key-wallet-ffi/FFI_API.md, key-wallet-ffi/src/types.rs
Introduces FFIBlockInfo struct with height, block_hash, timestamp fields; replaces pointer-based block parameter conversion with value-based FFIBlockInfo passing; updates FFITransactionContextDetails to embed FFIBlockInfo instead of separate fields; adds transaction_context_from_ffi() validation returning Option to reject zeroed block info for confirmed contexts.
FFI Transaction Functions
key-wallet-ffi/src/transaction.rs, key-wallet-ffi/src/transaction_checking.rs
Updates wallet_check_transaction and managed_wallet_check_transaction signatures to accept block_info: FFIBlockInfo instead of separate block_height, block_hash, timestamp parameters; refactors context construction to use transaction_context_from_ffi() with error handling for invalid block info.
FFI Managed Account & Tests
key-wallet-ffi/src/managed_account.rs, key-wallet-ffi/src/wallet_manager.rs, key-wallet-ffi/src/wallet_manager_tests.rs
Replaces FFITransactionRecord exposure of height, block_hash, timestamp fields with single context: FFITransactionContextDetails field; updates wallet manager to handle fallible to_transaction_context() conversion; refactors test context construction to use new builder methods.
Core Transaction Record
key-wallet/src/managed_account/transaction_record.rs, key-wallet/src/managed_account/mod.rs
Consolidates height, block_hash, timestamp fields into single context: TransactionContext field; replaces separate new() and new_confirmed() constructors with unified new(context) API; replaces mark_confirmed() and mark_unconfirmed() mutators with update_context(); adds block_info() and height() accessor methods.
Core Transaction Context & Helpers
key-wallet/src/transaction_checking/transaction_context.rs, key-wallet/src/transaction_checking/transaction_router/tests/helpers.rs, key-wallet/src/transaction_checking/transaction_router/tests/identity_transactions.rs, key-wallet/src/transaction_checking/transaction_router/tests/routing.rs
Adds conditional serde support to TransactionContext; makes block_info() public; introduces test_block_info() helper for test block construction; updates test suites to use helper instead of inline BlockInfo creation.
Wallet Manager & Checker Tests
key-wallet/src/manager/event_tests.rs, key-wallet/src/manager/test_helpers.rs, key-wallet/src/tests/spent_outpoints_tests.rs, key-wallet/src/transaction_checking/wallet_checker.rs
Updates test assertions to use method-based accessors (height(), block_info()) instead of direct field access; refactors context assertions to compare TransactionContext enum variants instead of individual confirmation fields.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

Suggested labels

ready-for-review

Suggested reviewers

  • QuantumExplorer
  • ZocoLini

Poem

🐰 A rabbit hops through block-info trees,
Consolidating parameters with ease!
No scattered height or hash in sight,
Just FFIBlockInfo shining bright,
Validation guards each context's way,
Consensus-critical—hip-hop-hooray! 🥕✨

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-conflict The PR conflicts with the target branch.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant