- 
                Notifications
    
You must be signed in to change notification settings  - Fork 19
 
feat: add commit info to getVersion #518
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4 files reviewed, 3 comments
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small nit but otherwise LGTM
Greptile Summary
This PR enhances the
getVersionRPC endpoint by adding git commit information and extending the version response structure. The changes involve four main components:New git-version dependency: Added to
magicblock-version/Cargo.tomlto enable compile-time git commit hash extraction using thegit_version::git_version!()macro.Enhanced Version struct: Modified
magicblock-version/src/lib.rsto include a newsolana_corefield for tracking the underlying Solana version, updated commit computation to use the git-version macro instead of environment variables, and changed the default client identifier from SolanaLabs to MagicBlock.Extended RPC response structure: Created a new
RpcVersionInfoExtstruct inmagicblock-rpc/src/traits/rpc_minimal.rsthat provides more detailed version information including separate fields for solana-core version, feature-set, git-commit (as hex string), and magicblock-core version.Updated RPC handler: Modified the
get_versionmethod implementation inmagicblock-rpc/src/handlers/minimal.rsto return the new extended version info structure, formatting the git commit as an 8-character hexadecimal string and properly populating all version fields.