Skip to content

Conversation

@suchapalaver
Copy link
Contributor

@suchapalaver suchapalaver commented Jul 17, 2025

Summary

This PR introduces the aggregate_receipts_v2 JSON-RPC endpoint, enabling collection-based receipt aggregation for the Horizon protocol. It maintains full backward compatibility with existing V1 endpoints while supporting a new V2 receipt structure.


What’s New

✨ V2 Aggregation Endpoint

  • New JSON-RPC Method: aggregate_receipts_v2
  • Updated Receipt Format:
    • collection_id (replaces allocation_id)
    • payer, data_service, service_provider (new fields)
  • Feature-Flagged: Controlled by the v2 feature flag (enabled by default)

Architecture Improvements

  • Protocol Mode: Introduces ProtocolMode enum (Legacy vs Horizon)
  • Receipt Classification: Centralized validation and protocol detection logic in receipt_classifier.rs
  • Structured Validation:
    • Validates collection_id, payer, data_service, service_provider
  • Error Handling: V2-specific errors surfaced with meaningful messages

Compatibility & Migration

  • ✅ V1 endpoints and gRPC support remain unchanged
  • 🔁 V2 support can be toggled off via --no-default-features
  • 🧭 Phased migration path:
    1. Deploy with V2 enabled
    2. Clients can begin testing V2
    3. Gradual migration to V2
    4. V1 retained for legacy support

Signed off by Joseph Livesey [email protected]

@github-actions
Copy link

Pull Request Test Coverage Report for Build 16354415176

Details

  • 71 of 142 (50.0%) changed or added relevant lines in 2 files are covered.
  • 10 unchanged lines in 2 files lost coverage.
  • Overall coverage decreased (-2.7%) to 73.473%

Changes Missing Coverage Covered Lines Changed/Added Lines %
tap_aggregator/src/server.rs 26 97 26.8%
Files with Coverage Reduction New Missed Lines %
tap_aggregator/src/aggregator/v1.rs 1 93.55%
tap_aggregator/src/server.rs 9 64.85%
Totals Coverage Status
Change from base Build 15931262360: -2.7%
Covered Lines: 1371
Relevant Lines: 1866

💛 - Coveralls

@suchapalaver suchapalaver force-pushed the suchapalaver/feat/v2-endpoints branch from d67a9a6 to 4e54992 Compare July 17, 2025 19:56
@suchapalaver suchapalaver force-pushed the suchapalaver/feat/v2-endpoints branch from 4e54992 to e7713c4 Compare July 17, 2025 19:59
@suchapalaver suchapalaver marked this pull request as ready for review July 17, 2025 20:06
@suchapalaver suchapalaver merged commit 9a8015a into main Jul 18, 2025
8 checks passed
@suchapalaver
Copy link
Contributor Author

Make sure before deleting branch we update testing infra in indexer-rs that currently uses this branch!

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