Skip to content

Spv in det rebased sam#99

Closed
QuantumExplorer wants to merge 39 commits into
v0.40-devfrom
spv-in-det-rebased-sam
Closed

Spv in det rebased sam#99
QuantumExplorer wants to merge 39 commits into
v0.40-devfrom
spv-in-det-rebased-sam

Conversation

@QuantumExplorer

Copy link
Copy Markdown
Member

No description provided.

pauldelucia and others added 30 commits August 4, 2025 12:26
- Removed DashSPVFFI target from Package.swift
- DashSPVFFI module now provided by unified SDK in dashpay-ios
- Updated SwiftDashCoreSDK to have no dependencies
- Added comments explaining standalone build limitations

SwiftDashCoreSDK now relies on the unified SDK's DashSPVFFI module,
which is available when used as a dependency in dashpay-ios but not
for standalone builds.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
When no peers support compact filters, the sequential sync manager now properly transitions to the next phase instead of getting stuck. This fixes the issue where masternode lists weren't being synced to the chain tip.

Changes:
- Check return value of start_sync_headers and transition if it returns false
- Add current_phase_needs_execution to detect phases that need execution after transition
- Modified check_timeout to execute pending phases before checking for timeouts

This ensures Platform SDK can fetch quorum public keys at recent heights by keeping masternode lists synced to the chain tip.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Move diff count increment to success case only to ensure accurate tracking
- Add debug logging for diff completion checks and state tracking
- Handle storage height exceeding tip gracefully by adjusting to available data
- Fix phase completion logic to verify target height is actually reached
- Re-start masternode sync if it reports complete but hasn't reached target
- Add masternode engine state logging after applying diffs

This improves sync reliability when dealing with partial syncs, phase
transitions, and edge cases where the requested height exceeds available data.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add test-utils to workspace members
- Add dashcore-test-utils dependency to dash-spv-ffi for testing
- Add log crate to dash for improved debugging

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add DKGWindow struct to represent DKG mining windows
- Implement get_dkg_window_for_height() to calculate mining windows
- Implement get_dkg_windows_in_range() for efficient batch processing
- Add NetworkLLMQExt trait for network-specific LLMQ operations
- Fix LLMQ_100_67 interval from 2 to 24 (platform consensus quorum)
- Add proper platform activation height checks for mainnet/testnet

This enables smart masternode list fetching by calculating exactly
which blocks can contain quorum commitments based on DKG intervals.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add ffiClientHandle property to expose FFI client pointer
- Make client property @ObservationIgnored to prevent observation issues
- Add debug logging for detailed sync progress callbacks
- Document that handle is nil until start() is called

This enables Platform SDK to access Core chain data through the
unified SDK for proof verification and other platform operations.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add Copy, Clone, Debug, PartialEq, Eq traits to FFIErrorCode
- Enables better error handling and testing patterns
- Improves ergonomics when working with error codes

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
- Add minimal platform integration test for basic null checks
- Add comprehensive safety test suite covering:
  - Null pointer handling for all FFI functions
  - Buffer overflow prevention
  - Memory safety (double-free, use-after-free)
  - Thread safety with concurrent access
  - Error propagation and thread-local storage
- Add CLAUDE.md with FFI build and integration instructions
- Add PLAN.md documenting smart quorum fetching algorithm design
- Add integration tests for smart fetch algorithm
- Add test script for validating smart fetch behavior

These tests ensure FFI safety and document the smart fetch implementation
for future maintenance and development.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
…ames

Remove underscore prefixes from quorum_type and core_chain_locked_height
parameters in ffi_dash_spv_get_quorum_public_key to follow standard naming
conventions. The underscores were likely added to suppress unused parameter
warnings but are no longer needed.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
Add TODO comments clarifying height parameter usage in storage APIs:

- get_header() method currently expects storage-relative heights (0-based from sync_base_height)
- Document confusion between storage indexes vs blockchain heights
- Suggest future refactor to use absolute blockchain heights for better UX
- Add comments to both trait definition and disk implementation

This addresses a common confusion point where blockchain operations expect
absolute heights but storage APIs use relative indexing.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Aug 12, 2025

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

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 spv-in-det-rebased-sam

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.

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