Skip to content
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

Add proper version command #63

Merged
merged 2 commits into from
Nov 15, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions multiepoch-getVersion.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,3 +46,11 @@ func (ser *MultiEpoch) GetFaithfulVersionInfo() map[string]any {
faithfulVersion["epochs"] = ser.GetEpochNumbers()
return faithfulVersion
}

// This function should return the solana version we are compatible with
func (ser *MultiEpoch) GetSolanaVersionInfo() map[string]any {
solanaVersion := make(map[string]any)
solanaVersion["feature-set"] = 1879391783
solanaVersion["solana-core"] = "1.16.7"
return solanaVersion
}
12 changes: 9 additions & 3 deletions multiepoch.go
linuskendall marked this conversation as resolved.
Show resolved Hide resolved
Original file line number Diff line number Diff line change
Expand Up @@ -298,13 +298,19 @@ func newMultiEpochHandler(handler *MultiEpoch, lsConf *ListenerConfig) func(ctx
method := rpcRequest.Method

if method == "getVersion" {
versionInfo := make(map[string]any)
faithfulVersion := handler.GetFaithfulVersionInfo()
versionInfo["faithful"] = faithfulVersion

solanaVersion := handler.GetSolanaVersionInfo()
for k,v := range solanaVersion {
versionInfo[k] = v
}

err := rqCtx.ReplyRaw(
reqCtx,
rpcRequest.ID,
map[string]any{
"faithful": faithfulVersion,
},
versionInfo,
)
if err != nil {
klog.Errorf("[%s] failed to reply to getVersion: %v", reqID, err)
Expand Down