Skip to content

Merge cors_fix delivery tracking into main-dym#461

Merged
danwt merged 26 commits intomain-dymfrom
danwt/claude/merge-cors-fix-to-main-dym
Jan 28, 2026
Merged

Merge cors_fix delivery tracking into main-dym#461
danwt merged 26 commits intomain-dymfrom
danwt/claude/merge-cors-fix-to-main-dym

Conversation

@danwt
Copy link
Copy Markdown

@danwt danwt commented Jan 28, 2026

Summary

Merges Michael's delivery tracking and CORS features from the cors_fix branch into main-dym.

Features added:

  • /delivered endpoint - check if a message was delivered by message_id and domain_id
  • /dispatched endpoint - get message_id from transaction hash (reverse lookup)
  • CORS support for /reprocess_message route
  • DeliveryDb trait for tracking delivery tx hashes

How delivery tracking works

When the relayer successfully delivers a message to a destination chain, it stores:

  • message_id -> delivery_tx_hash mapping (for /delivered queries)
  • dispatch_tx_hash -> message_id mapping (for /dispatched queries)

The data is stored in RocksDB using the DeliveryDb trait implementation.

API Endpoints

GET /delivered

  • Query params: message_id (hex), domain_id (destination domain)
  • Returns: { delivered: bool, tx_hash: string | null }

GET /dispatched

  • Query params: tx_hash (hex or base58 for Solana), domain_id (origin domain)
  • Returns: { message_id: string, destination_domain_id: u32 }

CORS Configuration

CORS is configured with allow_origin(Any) for the delivery endpoints and /reprocess_message. This is intentional as these are public read-only APIs. The permissive configuration allows frontend applications (like the portal) to query delivery status directly.

Test plan

  • Verify relayer compiles locally
  • Deploy to testnet relayer
  • Verify /delivered endpoint returns correct delivery status
  • Verify /dispatched endpoint returns message_id from tx hash
  • Verify CORS headers are present on responses

🤖 Generated with Claude Code

mtsitrin and others added 26 commits December 22, 2025 11:42
…ryDb for all destination chains, implement delivery status query, and update related database operations. Introduce new handler for checking message delivery status and streamline database interactions.
…ied expected format for message ID in comments and error messages, specifying hex string requirements and providing examples for better user guidance.
Merge Michael's delivery tracking and CORS features from the cors_fix branch
into main-dym.

Features added:
- /delivered endpoint - check if a message was delivered by message_id
- /dispatched endpoint - get message_id from transaction hash
- CORS support for /reprocess_message route
- DeliveryDb for tracking message delivery status across all chains

This enables Tzachi's portal integration to query delivery status.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Change warn! to debug!/error! for appropriate log levels
- Remove redundant log message prefixes (DELIVERY_API:, DISPATCHED_API:, etc.)
- Set ADVANCED_LOG_META back to false
- Remove unused message_syncs field from ServerState
- Add SOLANA_SIGNATURE_BYTES constant for magic number 64
- Simplify delivery_db.rs implementation
- Add comment documenting permissive CORS configuration

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
BLOCKING fixes:
- Fix warn! to error! for failed delivery tx storage
- Remove success/debug logging for delivery tx storage (follow log-after-action rule)
- Remove leftover debug warn! with ALL CAPS in hyperlane_db.rs
- Remove CORS from /reprocess_message (security: POST endpoints should not have permissive CORS)
- Remove unused origin_db_delivery field from MessageContext

MAJOR fixes:
- Remove duplicate tx->message_id reverse mapping from delivery_db.rs
  (origin-side mapping via HyperlaneDb is sufficient for /dispatched endpoint)
- Remove logging from low-level DB methods (let callers decide)

Simplifies delivery_db.rs to only store message_id -> delivery_tx mapping,
which is what the /delivered endpoint actually uses.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Downgrade error! to debug! for best-effort delivery tx storage
- Fix idempotency: store_message_with_dispatch_tx now returns actual
  store_message result and only stores dispatch tx mapping for new messages
- Remove unused warn import from hyperlane_db.rs
- Fix spurious blank lines in hyperlane_db.rs and contract_sync/mod.rs

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@danwt danwt merged commit edc9b55 into main-dym Jan 28, 2026
6 of 11 checks passed
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