smartcontract: add Index account for multicast group code uniqueness#3414
Closed
martinsander00 wants to merge 1 commit intomainfrom
Closed
smartcontract: add Index account for multicast group code uniqueness#3414martinsander00 wants to merge 1 commit intomainfrom
martinsander00 wants to merge 1 commit intomainfrom
Conversation
Introduce an Index account (PDA derived from entity type + lowercased code) that enforces unique multicast group codes onchain and enables O(1) code-to-pubkey lookup. Integrate Index lifecycle into multicast group create/update/delete/close instructions. Add standalone CreateIndex/DeleteIndex instructions (variants 104/105) for migration backfill. Update Go, Python, and TypeScript SDKs with Index account type.
Contributor
Author
|
Superseded — using #3256 directly as PR1 instead |
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.
Resolves: #3408
Summary
Indexaccount type to Go, Python, and TypeScript SDKsSplit from #3256 (1/2). Rust SDK integration in #PENDING.
New derivation workflow: #3256 (comment)
Diff Breakdown
~53% tests, ~46% onchain program, ~1% other (activator, e2e, Go/Py/TS SDKs, changelog)
Key files (click to expand)
smartcontract/programs/doublezero-serviceability/src/state/index.rs— new Index account struct (34 bytes: account_type + pubkey + bump_seed) with Borsh serializationsmartcontract/programs/doublezero-serviceability/src/processors/index/create.rs— standalone CreateIndex processor for migration backfillsmartcontract/programs/doublezero-serviceability/src/processors/multicastgroup/update.rs— atomic Index rename when multicast group code changes (close old, create new)smartcontract/programs/doublezero-serviceability/src/processors/multicastgroup/create.rs— creates Index account alongside multicast groupsmartcontract/programs/doublezero-serviceability/src/processors/index/delete.rs— standalone DeleteIndex processor for cleanupsmartcontract/programs/doublezero-serviceability/src/pda.rs—get_index_pda()with case-insensitive seed derivationsdk/serviceability/go/state.go,sdk/serviceability/python/serviceability/state.py,sdk/serviceability/typescript/serviceability/state.ts— addIndexaccount typeTesting Verification
index_test.rswith tests for Index creation, duplicate rejection, deletion, and rename