Skip to content

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

Merged
merged 3 commits into from
Oct 14, 2024
Merged

RPC errors #40

merged 3 commits into from
Oct 14, 2024

Conversation

johnstonematt
Copy link
Contributor

No description provided.

@johnstonematt johnstonematt changed the base branch from master to fee-rewards October 9, 2024 13:44
@johnstonematt johnstonematt mentioned this pull request Oct 9, 2024
@johnstonematt johnstonematt marked this pull request as draft October 9, 2024 13:45
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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Warnf maybe?

Copy link
Contributor Author

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?

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") {
Copy link
Contributor

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 🙏

Copy link
Contributor Author

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

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Base automatically changed from fee-rewards to master October 14, 2024 09:01
@johnstonematt johnstonematt marked this pull request as ready for review October 14, 2024 09:02
@johnstonematt johnstonematt merged commit b2cde35 into master Oct 14, 2024
2 checks passed
@johnstonematt johnstonematt deleted the rpc-errors branch October 14, 2024 09:03
response[T any] struct {
jsonrpc string
Result T `json:"result"`
Error rpcError `json:"error"`
Error RPCError `json:"error"`
Copy link
Contributor

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).

Copy link
Contributor

@SEJeff SEJeff Oct 16, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants