Skip to content

Persist webhook subscriptions to database instead of in-memory #502

Open

Description

@Wilfred007

What

Webhook subscriptions are stored in-memory in webhook.service.ts. They're lost on server restart and don't work with multiple replicas.

Why

Production deployments use multiple pods. In-memory subscriptions are randomly lost on pod restart and are invisible to other pods.

Scope

In scope: Create webhook_subscriptions table, migrate to PostgreSQL, add CRUD API
Out of scope: Webhook event history, delivery tracking

Acceptance Criteria

  • Subscriptions stored in PostgreSQL
  • Survive server restart
  • Work across multiple replicas
  • CRUD API for subscription management

Technical Context

  • backend/src/services/webhook.service.ts — in-memory storage
  • backend/src/controllers/webhook.controller.ts — controller
  • backend/src/db/migrations/ — needs new migration

Activity

  1. added
    backendBackend development
    hardComplex tasks
    Maybe RewardedIssue may be eligible for a GrantFox reward
    GrantFox OSSIssue tracked in GrantFox OSS
    on Aug 19, 2026
  2. ranjeet150 commented on Oct 1, 2026

    @ranjeet150

    Greetings @maintainers,

    I would like to take on and implement this issue: Persist webhook subscriptions to database instead of in-memory.

    Technical Implementation Roadmap:

    1. Formal Soroban Invariant Design: Audit storage layout (Instance, Persistent, Temporary) with strict TTL management and explicit require_auth guards.
    2. Core Rust WASM Implementation: Implement deterministic state transition handlers eliminating arithmetic overflow risks using checked/saturating math.
    3. Hermetic Testing Suite: Build comprehensive test cases in tests/ asserting authorized vs unauthorized invocations, mock auth environments, and edge value bounds.
    4. Gas & Footprint Optimization: Profile CPU/memory instruction budgets under Soroban host environment to ensure optimal runtime efficiency.

    I am ready to begin implementation immediately upon assignment and will deliver a high-quality, fully-tested PR. Please assign this issue to me!

  3. woahwhattheheck commented on Oct 8, 2026

    @woahwhattheheck

    /claim #502

    PR #704 is the existing original-author carrier by @woahwhattheheck. Claimant/payee: @woahwhattheheck. Please evaluate this contribution under the issue's existing GrantFox OSS / Third Campaign bounty route.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardThird CampaignCampaign: Third CampaignbackendBackend developmenthardComplex tasks

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions