-
Notifications
You must be signed in to change notification settings - Fork 7
Open
Open
Copy link
Milestone
Description
Currently, when creating a User account, the PDA derivation still relies on an incremental index. This approach introduces a potential race condition when multiple users attempt to connect at the same time, since they may try to claim the same index.
Proposed Change
- Update the PDA derivation method for User accounts so it no longer depends on the index.
- Ensure uniqueness and determinism by using a combination of stable seeds (e.g., user pubkey, device identifier, or other unique attributes).
- Validate that the new PDA derivation remains compatible with existing flows and does not break user discovery or account lookups.
Impact
- Eliminates race conditions during concurrent user creation.
- Improves reliability and scalability of the User account provisioning flow.
- Reduces the risk of account conflicts or unintended overwrites.
Next Steps
- Define the new PDA seed strategy.
- Implement and update the relevant create_user instruction.
- Adjust unit tests and e2e tests to cover concurrent account creation scenarios.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels