Repository navigation
feat: set default identity on delegation - #83
Merged
Merged
Conversation
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.
[Description](feat: set default identity on delegation)
Greptile Summary
Updated On: 2025-09-04 15:42:38 UTC
This PR introduces a default validator identity mechanism for the delegation system. The change adds a new constant
DEFAULT_VALIDATOR_IDENTITYinsrc/consts.rsthat specifies a hardcoded validator pubkey (MAS1Dt9qreoRMQ14YQuhg8UTZMMzDdKhmkZMECCzk57) to serve as a fallback when no validator is explicitly provided during delegation operations.The implementation modifies the delegation processor in
src/processor/delegate.rsto use this default validator identity viaargs.validator.unwrap_or(DEFAULT_VALIDATOR_IDENTITY)instead of potentially allowing undefined behavior whenargs.validatoris None. This ensures every delegation record has a valid authority field, which is essential for the delegation system's operation.The change integrates well with the existing codebase architecture by following the established pattern of defining program constants in
consts.rsalongside other important values likeRENT_FEES_PERCENTAGEandPROTOCOL_FEES_PERCENTAGE. The use of thepubkey!macro creates a compile-time constant from the base58-encoded address, maintaining type safety and efficiency consistent with Solana program development best practices.Confidence score: 4/5