Skip to content

Adds two methods & miscellaneous clean up. Update to Ruby 3.2.10#25

Open
brianlong wants to merge 8 commits intomainfrom
20260308-method-updates
Open

Adds two methods & miscellaneous clean up. Update to Ruby 3.2.10#25
brianlong wants to merge 8 commits intomainfrom
20260308-method-updates

Conversation

@brianlong
Copy link
Copy Markdown
Contributor

Summary

This PR updates Solana RPC method coverage and request compatibility in MethodsWrapper, and refreshes documentation/method inventories.

RPC compatibility fixes

Fixed get_leader_schedule request shape to send epoch as the first positional param (instead of inside config).
Fixed get_supply request key to excludeNonCirculatingAccountsList.
Fixed get_vote_accounts request keys to:

  • keepUnstakedDelinquents
  • delinquentSlotDistance

Fixed send_transaction request key from max_retries to maxRetries.
Added missing HTTP RPC methods
Added get_recent_prioritization_fees(addresses = [])
Added get_stake_minimum_delegation(commitment: nil)

Tests

Added request payload compatibility specs that assert exact outgoing JSON-RPC method names and params for:

  • get_leader_schedule
  • get_supply
  • get_vote_accounts
  • send_transaction
  • get_recent_prioritization_fees
  • get_stake_minimum_delegation

Updated test boot ordering in spec/spec_helper.rb so RAILS_ENV=test is set before loading dummy Rails environment.

Documentation

Added explicit method inventories in README.md:

  • HTTP methods
  • Deprecated compatibility methods
  • Websocket methods

Updated generated docs method index to include:

  • get_recent_prioritization_fees
  • get_stake_minimum_delegation

Validation

bundle exec rspec passes: 146 examples, 0 failures, 25 pending (existing skipped tests).

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the solana_rpc_ruby gem's RPC method coverage and fixes request compatibility issues in MethodsWrapper. It bumps Ruby to 3.2.10, corrects camelCase parameter key names that were previously using snake_case (which would be rejected by the Solana RPC server), fixes the positional placement of the epoch parameter in getLeaderSchedule, and adds two new RPC methods. Request payload compatibility specs are added to lock in the correct wire format.

Changes:

  • Fixes RPC request parameter serialization for getLeaderSchedule, getSupply, getVoteAccounts, and sendTransaction (snake_case → camelCase keys, and epoch as positional param)
  • Adds two new HTTP RPC methods: get_recent_prioritization_fees and get_stake_minimum_delegation, with accompanying request payload specs
  • Updates Ruby version to 3.2.10, bumps gem dependencies, and expands README method inventory

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 5 comments.

Show a summary per file
File Description
lib/solana_rpc_ruby/methods_wrapper.rb Fixes parameter key names and epoch positioning; adds two new RPC methods
spec/lib/solana_rpc_ruby/methods_wrapper_spec.rb Adds request payload compatibility specs for fixed and new methods
spec/spec_helper.rb Moves ENV assignments before require_relative to ensure correct boot ordering
README.md Updates Solana docs URL, Ruby version requirement, adds method inventories
doc/method_list.html Inserts the two new methods into the HTML method list
doc/SolanaRpcRuby/MethodsWrapper.html Adds placeholder anchor divs for the two new methods
Gemfile.lock Bumps all dependency versions to latest compatible releases
.ruby-version Bumps from 3.1.4 to 3.2.10
.github/workflows/specs.yml Drops Ruby 3.1 from CI matrix, keeping only 3.2
Comments suppressed due to low confidence (1)

doc/method_list.html:565

  • After inserting the two new entries (get_recent_prioritization_fees at line 478 and get_stake_minimum_delegation at line 549), the odd/even CSS class alternation becomes inconsistent. Specifically, get_recent_performance_samples (line 486) is even and the next entry get_signature_statuses (line 494) is also even, and similarly get_supply (line 557) and get_token_account_balance (line 565) are both even. These should alternate. Since this file is generated by YARD, it should be fully regenerated rather than manually patched, which would also fix this inconsistency.
  <li class="even ">
    <div class="item">
      <span class='object_link'><a href="SolanaRpcRuby/MethodsWrapper.html#get_recent_performance_samples-instance_method" title="SolanaRpcRuby::MethodsWrapper#get_recent_performance_samples (method)">#get_recent_performance_samples</a></span>
      <small>SolanaRpcRuby::MethodsWrapper</small>
    </div>
  </li>
  

  <li class="even ">
    <div class="item">
      <span class='object_link'><a href="SolanaRpcRuby/MethodsWrapper.html#get_signature_statuses-instance_method" title="SolanaRpcRuby::MethodsWrapper#get_signature_statuses (method)">#get_signature_statuses</a></span>
      <small>SolanaRpcRuby::MethodsWrapper</small>
    </div>
  </li>
  

  <li class="odd ">
    <div class="item">
      <span class='object_link'><a href="SolanaRpcRuby/MethodsWrapper.html#get_signatures_for_address-instance_method" title="SolanaRpcRuby::MethodsWrapper#get_signatures_for_address (method)">#get_signatures_for_address</a></span>
      <small>SolanaRpcRuby::MethodsWrapper</small>
    </div>
  </li>
  

  <li class="even ">
    <div class="item">
      <span class='object_link'><a href="SolanaRpcRuby/MethodsWrapper.html#get_slot-instance_method" title="SolanaRpcRuby::MethodsWrapper#get_slot (method)">#get_slot</a></span>
      <small>SolanaRpcRuby::MethodsWrapper</small>
    </div>
  </li>
  

  <li class="odd ">
    <div class="item">
      <span class='object_link'><a href="SolanaRpcRuby/MethodsWrapper.html#get_slot_leader-instance_method" title="SolanaRpcRuby::MethodsWrapper#get_slot_leader (method)">#get_slot_leader</a></span>
      <small>SolanaRpcRuby::MethodsWrapper</small>
    </div>
  </li>
  

  <li class="even ">
    <div class="item">
      <span class='object_link'><a href="SolanaRpcRuby/MethodsWrapper.html#get_slot_leaders-instance_method" title="SolanaRpcRuby::MethodsWrapper#get_slot_leaders (method)">#get_slot_leaders</a></span>
      <small>SolanaRpcRuby::MethodsWrapper</small>
    </div>
  </li>
  

  <li class="odd deprecated">
    <div class="item">
      <span class='object_link'><a href="SolanaRpcRuby/MethodsWrapper.html#get_snapshot_slot-instance_method" title="SolanaRpcRuby::MethodsWrapper#get_snapshot_slot (method)">#get_snapshot_slot</a></span>
      <small>SolanaRpcRuby::MethodsWrapper</small>
    </div>
  </li>
  

  <li class="even ">
    <div class="item">
      <span class='object_link'><a href="SolanaRpcRuby/MethodsWrapper.html#get_stake_activation-instance_method" title="SolanaRpcRuby::MethodsWrapper#get_stake_activation (method)">#get_stake_activation</a></span>
      <small>SolanaRpcRuby::MethodsWrapper</small>
    </div>
  </li>
  
  <li class="odd ">
    <div class="item">
      <span class='object_link'><a href="SolanaRpcRuby/MethodsWrapper.html#get_stake_minimum_delegation-instance_method" title="SolanaRpcRuby::MethodsWrapper#get_stake_minimum_delegation (method)">#get_stake_minimum_delegation</a></span>
      <small>SolanaRpcRuby::MethodsWrapper</small>
    </div>
  </li>
  

  <li class="even ">
    <div class="item">
      <span class='object_link'><a href="SolanaRpcRuby/MethodsWrapper.html#get_supply-instance_method" title="SolanaRpcRuby::MethodsWrapper#get_supply (method)">#get_supply</a></span>
      <small>SolanaRpcRuby::MethodsWrapper</small>
    </div>
  </li>
  

  <li class="even ">

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

params_hash['commitment'] = commitment unless blank?(commitment)

params << epoch unless epoch.nil?
params << params_hash unless params_hash.empty?
Copy link

Copilot AI Mar 8, 2026

Choose a reason for hiding this comment

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

When epoch is nil but identity or commitment are provided, the current code sends [{"identity": "...", "commitment": "..."}] as params. According to the Solana RPC spec for getLeaderSchedule, the first positional parameter is the optional epoch slot (u64 | undefined), and the second is the config object. Passing only [{config}] without a leading null means the server may reject the request or interpret the config hash as the epoch value. To correctly omit epoch while still passing config, null should be prepended: [null, {config}].

Suggested change
params << params_hash unless params_hash.empty?
unless params_hash.empty?
params << nil if epoch.nil?
params << params_hash
end

Copilot uses AI. Check for mistakes.
README.md Outdated
Comment on lines +211 to +216
`get_recent_performance_samples`, `get_signatures_for_address`, `get_signature_statuses`, `get_slot`,
`get_slot_leader`, `get_slot_leaders`, `get_stake_activation`, `get_stake_minimum_delegation`, `get_supply`,
`get_token_account_balance`, `get_token_accounts_by_delegate`, `get_token_accounts_by_owner`,
`get_token_largest_accounts`, `get_token_supply`, `get_transaction`, `get_transaction_count`, `get_version`,
`get_vote_accounts`, `is_blockhash_valid`, `minimum_ledger_slot`, `request_airdrop`, `send_transaction`,
`simulate_transaction`, `get_recent_prioritization_fees`.
Copy link

Copilot AI Mar 8, 2026

Choose a reason for hiding this comment

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

The method get_recent_prioritization_fees is appended at the end of the HTTP methods list, after simulate_transaction, breaking the alphabetical ordering of the rest of the list. It should be placed between get_recent_performance_samples and get_signatures_for_address to maintain the alphabetical order used for all other methods.

Suggested change
`get_recent_performance_samples`, `get_signatures_for_address`, `get_signature_statuses`, `get_slot`,
`get_slot_leader`, `get_slot_leaders`, `get_stake_activation`, `get_stake_minimum_delegation`, `get_supply`,
`get_token_account_balance`, `get_token_accounts_by_delegate`, `get_token_accounts_by_owner`,
`get_token_largest_accounts`, `get_token_supply`, `get_transaction`, `get_transaction_count`, `get_version`,
`get_vote_accounts`, `is_blockhash_valid`, `minimum_ledger_slot`, `request_airdrop`, `send_transaction`,
`simulate_transaction`, `get_recent_prioritization_fees`.
`get_recent_performance_samples`, `get_recent_prioritization_fees`, `get_signatures_for_address`, `get_signature_statuses`, `get_slot`,
`get_slot_leader`, `get_slot_leaders`, `get_stake_activation`, `get_stake_minimum_delegation`, `get_supply`,
`get_token_account_balance`, `get_token_accounts_by_delegate`, `get_token_accounts_by_owner`,
`get_token_largest_accounts`, `get_token_supply`, `get_transaction`, `get_transaction_count`, `get_version`,
`get_vote_accounts`, `is_blockhash_valid`, `minimum_ledger_slot`, `request_airdrop`, `send_transaction`,
`simulate_transaction`.

Copilot uses AI. Check for mistakes.
Comment on lines +1929 to +1930
<div id="get_recent_prioritization_fees-instance_method"></div>
<div id="get_stake_minimum_delegation-instance_method"></div>
Copy link

Copilot AI Mar 8, 2026

Choose a reason for hiding this comment

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

The new methods get_recent_prioritization_fees and get_stake_minimum_delegation are only added as empty anchor <div> elements (with no method signature, description, parameter documentation, or source code listing) rather than as full YARD-generated method entries. All other methods in this file (e.g. simulate_transaction ending at line 9074) have complete generated documentation including signatures, docstrings, parameter tables, and source code. These stubs will produce broken or missing links in the method list HTML and will not render any documentation for these methods. The YARD docs should be fully regenerated to include proper entries for the two new methods.

Suggested change
<div id="get_recent_prioritization_fees-instance_method"></div>
<div id="get_stake_minimum_delegation-instance_method"></div>

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 31 out of 34 changed files in this pull request and generated 1 comment.

Comments suppressed due to low confidence (1)

doc/SolanaRpcRuby/MethodsWrapper.html:5086

  • The generated HTML documentation for get_leader_schedule in doc/SolanaRpcRuby/MethodsWrapper.html shows an outdated/incomplete version of the source code. It displays:
params << epoch unless epoch.nil?
params << params_hash unless params_hash.empty?

But the actual implementation in lib/solana_rpc_ruby/methods_wrapper.rb uses a different, more complex control flow with unless params_hash.empty? wrapping both the params << nil if epoch.nil? and params << params_hash lines. The doc HTML should be regenerated to reflect the actual source code.

  <span class='id identifier rubyid_params_hash'>params_hash</span><span class='lbracket'>[</span><span class='tstring'><span class='tstring_beg'>&#39;</span><span class='tstring_content'>commitment</span><span class='tstring_end'>&#39;</span></span><span class='rbracket'>]</span> <span class='op'>=</span> <span class='id identifier rubyid_commitment'>commitment</span> <span class='kw'>unless</span> <span class='id identifier rubyid_blank?'>blank?</span><span class='lparen'>(</span><span class='id identifier rubyid_commitment'>commitment</span><span class='rparen'>)</span>

  <span class='id identifier rubyid_params'>params</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_epoch'>epoch</span> <span class='kw'>unless</span> <span class='id identifier rubyid_epoch'>epoch</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
  <span class='id identifier rubyid_params'>params</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_params_hash'>params_hash</span> <span class='kw'>unless</span> <span class='id identifier rubyid_params_hash'>params_hash</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>

  <span class='id identifier rubyid_body'>body</span> <span class='op'>=</span> <span class='id identifier rubyid_create_json_body'>create_json_body</span><span class='lparen'>(</span><span class='id identifier rubyid_method'>method</span><span class='comma'>,</span> <span class='label'>method_params:</span> <span class='id identifier rubyid_params'>params</span><span class='rparen'>)</span>

  <span class='id identifier rubyid_send_request'>send_request</span><span class='lparen'>(</span><span class='id identifier rubyid_body'>body</span><span class='comma'>,</span> <span class='id identifier rubyid_http_method'>http_method</span><span class='rparen'>)</span>
<span class='kw'>end</span></pre>

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

brianlong and others added 2 commits March 8, 2026 10:19
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 31 out of 34 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Comment on lines 5080 to 5081
<span class='id identifier rubyid_params'>params</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_epoch'>epoch</span> <span class='kw'>unless</span> <span class='id identifier rubyid_epoch'>epoch</span><span class='period'>.</span><span class='id identifier rubyid_nil?'>nil?</span>
<span class='id identifier rubyid_params'>params</span> <span class='op'>&lt;&lt;</span> <span class='id identifier rubyid_params_hash'>params_hash</span> <span class='kw'>unless</span> <span class='id identifier rubyid_params_hash'>params_hash</span><span class='period'>.</span><span class='id identifier rubyid_empty?'>empty?</span>
Copy link

Copilot AI Mar 8, 2026

Choose a reason for hiding this comment

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

The generated HTML documentation for get_leader_schedule in doc/SolanaRpcRuby/MethodsWrapper.html (lines 5080–5081) does not include the unless params_hash.empty? block with the params << nil if epoch.nil? insertion that was added to methods_wrapper.rb. Instead, the doc shows the simpler two-line form without the nil-insertion logic. The documentation appears to have been generated from a different version of the code than what was actually committed — the HTML doc should be regenerated from the final methods_wrapper.rb to keep it in sync.

Copilot uses AI. Check for mistakes.
Comment on lines +1375 to +1380
it 'supports getRecentPrioritizationFees' do
wrapper.get_recent_prioritization_fees(['11111111111111111111111111111111'])

expect(captured_request.dig(:body, 'method')).to eq('getRecentPrioritizationFees')
expect(captured_request.dig(:body, 'params')).to eq([['11111111111111111111111111111111']])
end
Copy link

Copilot AI Mar 8, 2026

Choose a reason for hiding this comment

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

The test description for get_recent_prioritization_fees at line 1375 uses the vague pattern 'supports getRecentPrioritizationFees', inconsistent with every other test in this new describe block which uses an action-oriented format like 'sends getRecentPrioritizationFees with ...'. A more descriptive name like 'sends getRecentPrioritizationFees with addresses param' would improve readability and consistency.

Copilot uses AI. Check for mistakes.
Comment on lines +1382 to +1387
it 'supports getStakeMinimumDelegation' do
wrapper.get_stake_minimum_delegation(commitment: 'finalized')

expect(captured_request.dig(:body, 'method')).to eq('getStakeMinimumDelegation')
expect(captured_request.dig(:body, 'params')).to eq([{ 'commitment' => 'finalized' }])
end
Copy link

Copilot AI Mar 8, 2026

Choose a reason for hiding this comment

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

The test description for get_stake_minimum_delegation at line 1382 uses the vague pattern 'supports getStakeMinimumDelegation', inconsistent with the other tests in the same describe block that use a more explicit format (e.g., 'sends getStakeMinimumDelegation with commitment param').

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 32 out of 35 changed files in this pull request and generated 1 comment.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review. Take the survey.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
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.

2 participants