Skip to content

feat(contract): CT-14 VerificationWebhookNotifier and CT-15 CacheWarmupService#593

Merged
mftee merged 4 commits into
CodeGirlsInc:mainfrom
Ibinola:feat/issues-546-547
Jun 26, 2026
Merged

feat(contract): CT-14 VerificationWebhookNotifier and CT-15 CacheWarmupService#593
mftee merged 4 commits into
CodeGirlsInc:mainfrom
Ibinola:feat/issues-546-547

Conversation

@Ibinola

@Ibinola Ibinola commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Summary

Implements [CT-14] and [CT-15] for the Stellar Wave program.

CT-14 — VerificationWebhookNotifier (contract/src/module/webhook/)

  • Reads WEBHOOK_URL env var on startup; disabled with a WARN log if not set
  • notify(event_type, document_hash, tx_hash, timestamp) fires a POST with JSON payload { event_type, document_hash, tx_hash, timestamp, service: "smalda-contract" }
  • Uses reqwest with a 5-second timeout
  • Retries once after a 2-second delay on first failure; logs WARN but never propagates errors to the handler
  • Called in submit_document, revoke_document, and record_transfer after successful Stellar transactions

CT-15 — CacheWarmupService (contract/src/module/cache_warmup/)

  • Runs at application startup before the HTTP server begins accepting connections
  • Scans Redis for all submit:* keys, limits warmup to 200 entries
  • Writes verified=true cache entries using the stored tx_hash without re-querying Stellar
  • Logs the number of warmed entries and total time at INFO level
  • Gracefully skips if Redis is unavailable (WARN log, does not block startup)

Testing

  • cargo build — clean
  • cargo test — 28/28 passing

Closes #546
Closes #547

… CacheWarmupService

- Add VerificationWebhookNotifier in contract/src/module/webhook/
  - Reads WEBHOOK_URL env var; disables and logs warning if unset
  - notify() POSTs JSON payload with event_type, document_hash, tx_hash, timestamp, service
  - 5-second reqwest timeout; retries once after 2s on failure; logs WARN, never errors handler

- Add CacheWarmupService in contract/src/module/cache_warmup/
  - Runs before HTTP server accepts connections
  - Scans Redis submit:* keys, warms up to 200 entries with verified=true
  - Logs count and duration at INFO; skips gracefully if Redis unavailable

- Wire notifier into submit, revoke, and transfer handlers
- Add notifier to AppState

Closes CodeGirlsInc#546
Closes CodeGirlsInc#547
@vercel

vercel Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

@Ibinola is attempting to deploy a commit to the Mftee's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Jun 25, 2026

Copy link
Copy Markdown

@Ibinola Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@mftee mftee merged commit 437182e into CodeGirlsInc:main Jun 26, 2026
4 of 5 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.

[CT-15] Build CacheWarmupService [CT-14] Build VerificationWebhookNotifier

2 participants