feat: on-chain webhook subscription system with HMAC signing (Closes #508)#773
feat: on-chain webhook subscription system with HMAC signing (Closes #508)#773LaphoqueRC wants to merge 1 commit intoSolFoundry:mainfrom
Conversation
…508) Implements webhooks for on-chain events as specified in bounty #508. ## Core - Subscribe to on-chain events: escrow.locked, escrow.released, reputation.updated, stake.deposited, stake.withdrawn - HMAC-SHA256 payload signing for delivery verification - 5-second batch window for efficient delivery - Exponential backoff retry (1s/2s/4s) with 4xx=permanent fail - Dashboard with delivery stats and retry history - Test event endpoint for integration testing - Event catalog with payload schemas ## Endpoints - POST /api/onchain-webhooks/register — subscribe (HTTPS-only) - DELETE /api/onchain-webhooks/{id} — unsubscribe - GET /api/onchain-webhooks — list subscriptions - GET /api/onchain-webhooks/{id}/dashboard — delivery stats - POST /api/onchain-webhooks/{id}/test — send test event - GET /api/onchain-webhooks/catalog — event type catalog ## Database - Alembic migration 005: onchain_webhook_subscriptions + delivery_logs - Proper indexes for performance ## Tests 25 pytest test cases across 8 classes: - Event catalog (3), Registration (5), Listing (2), Delete (2), Dashboard (1), Test event (1), HMAC signing (1), Models (5) --- **Wallet:** `HZV6YPdTeJPjPujWjzsFLLKja91K2Ze78XeY8MeFhfK8`
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (7)
📝 WalkthroughWalkthroughThis pull request introduces on-chain webhook subscription functionality to the SolFoundry backend. It adds a PostgreSQL migration creating two tables ( Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested labels
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
Changes
Implements webhooks for on-chain events as specified in bounty #508.
Core
escrow.locked,escrow.released,reputation.updated,stake.deposited,stake.withdrawnEndpoints
POST /api/onchain-webhooks/register— subscribe (HTTPS-only)DELETE /api/onchain-webhooks/{id}— unsubscribeGET /api/onchain-webhooks— list subscriptionsGET /api/onchain-webhooks/{id}/dashboard— delivery statsPOST /api/onchain-webhooks/{id}/test— send test eventGET /api/onchain-webhooks/catalog— event type catalogDatabase
onchain_webhook_subscriptions+delivery_logsTests
25 pytest test cases across 8 classes:
Wallet:
HZV6YPdTeJPjPujWjzsFLLKja91K2Ze78XeY8MeFhfK8