chore!: remove support for legacy v1 receipts#929
Merged
suchapalaver merged 39 commits intomainfrom Feb 5, 2026
Merged
Conversation
7f6f073 to
419e89e
Compare
BREAKING CHANGE: TAP agent now requires Horizon mode to be enabled. Legacy V1 receipt handling has been removed in favor of exclusive V2 (Horizon) protocol support. The V1 escrow accounts watcher and hybrid migration mode are no longer available.
Remove unused escrow sync interval variable and streamline the Horizon mode validation logic by using early returns instead of nested conditionals with unreachable branches.
…ng fails Add contextual information (notification id and signer address) to the error when collection_id parsing fails, making debugging easier when receipt notifications contain malformed data. Also consolidates the SUBGRAPH_SERVICE_ADDRESS test constant to avoid duplication across test modules.
…mode is required Remove unreachable legacy fallback branch in sender account initialization. Since the agent now requires Horizon mode, the denylist check is always performed against tap_horizon_denylist.
…lpers - Remove unreachable legacy fallback branch in sender denylist check since Horizon mode is now required - Extract duplicated deny state retry loops into `wait_for_deny_state` helper for more robust and readable tests
Clarify that Horizon mode is now required throughout tap-agent: - Update error messages to remove references to disabling Horizon - Simplify tap_mode field documentation since legacy mode is removed - Add context to legacy metric counters explaining backwards compatibility
The startup error message suggested users could disable Horizon via config, but this option is no longer available since Horizon mode is now required.
Re-export TAP_EIP712_DOMAIN and VERIFIER_ADDRESS from test_assets instead of duplicating the definitions in tap-agent's test module.
… required Remove redundant `is_horizon()` conditionals that were always true since the agent now requires Horizon mode at startup. Also convert denylist queries to runtime execution to avoid compile-time database dependency.
Use `wait_for_deny_state` helper in pending RAVs test to account for async message processing. Update snapshot for allocation update test to reflect actual message ordering.
…ering Use `wait_for_deny_state` helper in pending RAVs test to account for async message processing. Remove flaky snapshot assertion that depended on specific message ordering between async watchers.
…rizon tables During migration from legacy allocations to Horizon, some receipts and RAVs may contain 20-byte allocation IDs instead of 32-byte collection IDs. Instead of panicking on these invalid entries, skip them with a warning to allow the system to continue processing valid receipts.
Now that Horizon mode is required, the V1 receipts domain is no longer needed.
All TAP receipt handling now uses Horizon V2 receipts exclusively. Legacy V1 tests and helpers are no longer needed since V1 receipt support was removed in prior commits.
Remove legacy V1 receipt handling from the service crate, requiring only V2 escrow accounts. This simplifies the TAP receipt processing pipeline by eliminating the dual V1/V2 domain separator logic and consolidating on the Horizon-compatible receipt format.
…pport Remove the Legacy network version type and all V1-specific code paths from tap-agent. The AllocationId enum is now a simple wrapper around CollectionId. This removes ~900 lines of legacy RAV/receipt handling, V1 escrow subgraph client, and dual-version metrics.
…port Remove V1 variants and Option wrappers throughout the codebase now that TAP V2 (Horizon) is required. This eliminates version branching in receipt handling, RAV aggregation, and database queries.
Remove V1/V2 versioning terminology and migration references now that legacy V1 receipt support has been dropped. Horizon is now the only supported production mode.
Rename `derive_key_pair_v1`/`derive_key_pair_v2` to `derive_key_pair_primary`/`derive_key_pair_fallback` to better describe their roles rather than suggesting a versioning relationship with the recently removed TAP V1/V2 receipt types.
Remove legacy fallback logic from EIP-712 domain separator setup since Horizon mode is now required. Also update config comments to use consistent "Horizon" terminology instead of "V2".
…d param Simplify startup validation since Horizon mode is now always required, making the DIPS-specific horizon check redundant. Also remove unused allocation_id parameter from tap_allocation_redeemed_watcher.
Horizon is now mandatory—configs with `horizon.enabled = false` are rejected at validation time. The default value is changed to `true` to match this requirement.
Config examples and defaults now include the required Horizon addresses (subgraph_service_address, receipts_verifier_address_v2) that must be set for operation.
Remove leftover "V1 tests removed" comments and update documentation to use consistent language for the deprecated verifier address field.
Since Horizon mode is mandatory, the escrow accounts v2 watcher is always present. Remove Option wrapper to simplify code paths and fail fast if the watcher is missing.
Since Horizon mode is now mandatory, remove redundant "When horizon.enabled = true" prefix from error messages. Also add TODO for eventual removal of 20-byte allocation ID migration fallback.
Add `horizon_receipts_verifier_address()` helper to `BlockchainConfig` that enforces the validation requirement for `receipts_verifier_address_v2`, reducing duplication and making the contract clearer.
Mark `receipts_verifier_address` as deprecated with a compiler warning since Horizon mode now uses `receipts_verifier_address_v2` exclusively.
The subgraph query API returns Result<Data, Error>, not Result<Result<Data, Error>, Error>. Several match patterns were incorrectly nested after the V1 removal refactor. Also adds explicit type annotation for redeemed_ids vec to resolve type inference.
Tests no longer need to mock the escrow subgraph since V1 receipt handling was removed. Also renames mock variable to reflect its actual purpose (network subgraph for redeemed allocation checks).
Add comprehensive tests covering RAV requests, allocation closure, unaggregated fee calculation, invalid receipt handling, and edge cases for the Horizon-only TAP protocol implementation.
Users can now omit the deprecated receipts_verifier_address field from their config files entirely. This reduces config clutter as the field was only kept for backward compatibility and is not used since the switch to Horizon receipts.
Error messages now explain that Horizon is required, rather than just stating that fields must be set, making it clearer why configuration is needed.
Drain startup messages before asserting on periodic reconciliation and tolerate interleaved messages that may arrive during time advancement.
Remove unnecessary Option wrapper from subgraph_service_address() since Horizon mode is now required. Also fix typo in receipts_len variable and remove obsolete TODO comment.
The receipts_verifier_address_v2 field is now a required Address instead of Option<Address>, enforced at config load time rather than runtime validation. This simplifies accessor methods and removes unnecessary Option handling throughout the codebase.
…eceipts Replace the TapReceipt enum (which only had a V2 variant) with a newtype struct, removing the unnecessary match arms and accessor methods across receipt handling, TAP checks, and agent code.
d11e17a to
eb8777d
Compare
neithanmo
approved these changes
Feb 5, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PR Summary: Remove Legacy V1 TAP Receipt Support
Overview
This PR removes support for legacy TAP V1 receipts, making Horizon (V2) mode mandatory. This is a breaking change that simplifies the codebase by removing ~3900 lines of legacy code paths.
What Changed
V1/V2variants) to a newtype wrapping only Horizon v2 receiptshorizon.enabled = trueandreceipts_verifier_address_v2are now requiredscalar_tap_receipts) no longer written to_by_versionvariantsBreaking Changes
Configuration
horizon.enabledfalsetrueblockchain.receipts_verifier_address_v2blockchain.receipts_verifier_addressblockchain.subgraph_service_addressMetrics Removed
The following metrics have been removed. Use the
_by_versionequivalents instead:tap_ravs_created_total→ usetap_ravs_created_total_by_versiontap_ravs_failed_total→ usetap_ravs_failed_total_by_versiontap_rav_response_time_seconds→ usetap_rav_response_time_seconds_by_versionMigration Guide
Update configuration:
Update monitoring dashboards: Replace any references to the removed metrics with their
_by_versionequivalents. The version label will always be"v2".Ensure Horizon contracts are deployed: The service will fail to start if the Network Subgraph indicates Horizon is not active.
Recommendations for Release
Release Notes: Document the breaking configuration changes prominently. Users on legacy mode must update their configuration before upgrading.
Migration Documentation: Update existing migration guides to note that Horizon mode is now mandatory. Legacy V1 receipts will no longer be accepted or processed.
Monitoring Alerts: Notify users that the non-versioned metrics (
tap_ravs_created_total,tap_ravs_failed_total,tap_rav_response_time_seconds) have been removed. Dashboards and alerts referencing these metrics must be updated to use the_by_versionvariants.Testing
Signed off by Joseph Livesey joseph@semiotic.ai