Add channel subscriptions, counts, creators, and DB query indexes#531
Open
king-aj-the-first wants to merge 1 commit into
Open
Add channel subscriptions, counts, creators, and DB query indexes#531king-aj-the-first wants to merge 1 commit into
king-aj-the-first wants to merge 1 commit into
Conversation
|
@king-aj-the-first 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! 🚀 |
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.
Summary
Adds on-chain notification channel subscriptions (creator metadata, subscriber counts, batch subscribe) and listener DB query-performance indexes.
Task 1 — Subscription Count View
get_subscriber_count(channel_id)on the contractget_channel)Task 2 — Batch Subscription Functionality
batch_subscribe(channel_ids, subscriber)processes multiple channels in one txBatchSubscribeResult { succeeded, failed, subscribed_ids }docs/BATCH_SUBSCRIBE_GAS.mdTask 3 — Channel Creator Information
create_channelpermanently stores the creator wallet onNotificationChannelget_channel_creator(id)andget_channel(id).creatorNotFoundfor unknown channelsTask 4 — Database Query Performance
schema.sql+ migration002-query-performance-indexesdocs/DATABASE_QUERY_PERFORMANCE.mdquery-performance.test.tsto assert indexes exist and claim queries use an indexed planNew contract APIs
create_channelget_channelget_channel_creatorget_subscriber_countis_channel_subscribersubscribe/unsubscribebatch_subscribeTest plan
channel_subscription_test(creator, count, batch + partial failure)query-performance.test.tsdocs/BATCH_SUBSCRIBE_GAS.mdanddocs/DATABASE_QUERY_PERFORMANCE.md002on an existing listener DB and confirm indexes viaPRAGMA index_listcloses #471
closes #478
closes #480
closes #486