Skip to content

Boxes rpc client_error::Error's ErrorKind field#6293

Merged
brooksprumo merged 1 commit intoanza-xyz:masterfrom
brooksprumo:rpc/box-error-kind
Jun 16, 2025
Merged

Boxes rpc client_error::Error's ErrorKind field#6293
brooksprumo merged 1 commit intoanza-xyz:masterfrom
brooksprumo:rpc/box-error-kind

Conversation

@brooksprumo
Copy link
Copy Markdown

@brooksprumo brooksprumo commented May 22, 2025

Problem

Issue #6278: The rpc client_error::Error struct triggers the result_large_err clippy lint. This is because the kind field is of type ErrorKind, which is 232 bytes. To fix this, and since this is only needed in the error case, we can box the ErrorKind.

Please see #6290 (comment) for the full context.

Summary of Changes

Boxes solana_rpc_client_api::client_error::Error's ErrorKind field, kind.

Important

Since the ErrorKind field is public and exported1, this is an API-BREAKING CHANGE. As such, the earliest it can be merged is in v3.0.

Footnotes

  1. https://docs.rs/solana-rpc-client-api/2.2.7/solana_rpc_client_api/client_error/struct.Error.html

@brooksprumo brooksprumo self-assigned this May 22, 2025
@mergify
Copy link
Copy Markdown

mergify Bot commented May 22, 2025

If this PR represents a change to the public RPC API:

  1. Make sure it includes a complementary update to rpc-client/ (example)
  2. Open a follow-up PR to update the JavaScript client @solana/kit (example)

Thank you for keeping the RPC clients in sync with the server API @brooksprumo.

@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 22, 2025

Codecov Report

❌ Patch coverage is 41.66667% with 7 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.8%. Comparing base (5f15e1f) to head (6778e53).
⚠️ Report is 3198 commits behind head on master.

Additional details and impacted files
@@           Coverage Diff            @@
##           master    #6293    +/-   ##
========================================
  Coverage    82.8%    82.8%            
========================================
  Files         847      847            
  Lines      379488   379488            
========================================
+ Hits       314367   314524   +157     
+ Misses      65121    64964   -157     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@brooksprumo brooksprumo force-pushed the rpc/box-error-kind branch from 92fec40 to 6778e53 Compare June 6, 2025 14:05
@brooksprumo brooksprumo removed the 3.0 label Jun 6, 2025
@brooksprumo brooksprumo marked this pull request as ready for review June 6, 2025 19:36
Copy link
Copy Markdown

@steveluscher steveluscher left a comment

Choose a reason for hiding this comment

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

giphy

Yeah. I was wondering about that lint, but didn't know enough about Rust to assess the implications of acting on it.

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.

New result_large_err clippy lint blocks upgrading Rust to 1.87.0

3 participants