-
Notifications
You must be signed in to change notification settings - Fork 54
RPC errors #40
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
RPC errors #40
Conversation
if errors.As(err, &rpcError) { | ||
// this is the error code for slot was skipped: | ||
if rpcError.Code == -32007 && strings.Contains(rpcError.Message, "skipped") { | ||
klog.Infof("slot %v was skipped, no fee rewards.", slot) |
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.
Warnf maybe?
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.
I mean, this part of the exporter is not designed for tracking skipped slots so in theory this is not necessarily a bad thing. For instance, we might want to track the fee rewards of Triton 1 to see if they are doing something we aren't (or just a handful of validator benchmarks), so does it make sense for us to get a warning when they have a skipped slot?
cmd/solana_exporter/slots.go
Outdated
var rpcError *rpc.RPCError | ||
if errors.As(err, &rpcError) { | ||
// this is the error code for slot was skipped: | ||
if rpcError.Code == -32007 && strings.Contains(rpcError.Message, "skipped") { |
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.
Can you make that a constant please? Also, where did you get that rpc error code from? The solana source or some docs? If from some docs, can you link them in a comment 🙏
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.
No docs, just ran the call on a block that was skipped and looked at the code. Can make it a constant tho
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.
Here you go sir!
response[T any] struct { | ||
jsonrpc string | ||
Result T `json:"result"` | ||
Error rpcError `json:"error"` | ||
Error RPCError `json:"error"` |
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.
Maybe we should change type of Error
to T
. Type of Error could change from function to function(it actually do for some of requests. I.E. getHealth
).
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.
@GranderStark feel free to propose this in #33 if youd like.
alternatively I think @johnstonematt might have a workaround in #44
No description provided.