Repository navigation
feat(rpc): add IsInvitationCodeValid endpoint - #2748
Merged
kkovaacs merged 3 commits intoOct 8, 2026
Merged
Conversation
Add a read-only gRPC method that reports whether an invitation code can still be used for registration. It returns true when allowlist enforcement is disabled or when the code exists and no account has registered with it. Unknown and consumed codes return false. The request type is excluded from derived Debug so invitation codes never reach logs, following the RegisterAccountRequest pattern. Full nodes forward the query to the sequencer.
This was referenced Oct 7, 2026
19 tasks
Mirko-von-Leipzig
approved these changes
Oct 8, 2026
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.
This PR adds
IsInvitationCodeValid, a read-only gRPC method onNodeServicethat reports whether an invitation code can still be used for registration. It returnstruewhen allowlist enforcement is disabled, or when the code exists in the registry and no account has registered with it. Unknown and consumed codes returnfalse. With enforcement enabled, an empty code is rejected withINVALID_ARGUMENT. Full nodes forward the query to their upstream sequencer, as they do forIsAccountAllowedandRegisterAccount.Clients currently have no way to check a code before they build an account and call
RegisterAccount. A sign-up flow has to construct the account first and only learns that the code is unknown or already used from the registration error. This endpoint lets a client validate the code up front, mirroring whatIsAccountAllowedalready offers for account IDs.Points worth attention:
Debugin bothprostconfig and theDecoded*generation, with hand-written redactingDebugimpls. This follows the existingRegisterAccountRequestpattern and is covered by a test. The handler also does not record the code on its tracing span.falseso the answer matches whatRegisterAccountwould accept for a new account.truewithout touching the database or validating the code, consistent withIsAccountAllowedand withRegisterAccountaccepting any code in that mode.Changelog