Skip to content

v4.0: Bank::get_slot_history() is fallible (backport of #12598)#12629

Merged
brooksprumo merged 2 commits into
v4.0from
mergify/bp/v4.0/pr-12598
May 25, 2026
Merged

v4.0: Bank::get_slot_history() is fallible (backport of #12598)#12629
brooksprumo merged 2 commits into
v4.0from
mergify/bp/v4.0/pr-12598

Conversation

@mergify
Copy link
Copy Markdown

@mergify mergify Bot commented May 20, 2026

Problem

Bank::get_slot_history() double unwraps, which causes a panic on error. Instead, let the caller decide if this error is fatal or not.

Summary of Changes

  • Makes Bank::get_slot_history() return an Option
  • Updates callers to call .unwrap() (this maintains the current behavior--happy to adjust!)
  • Add a new RPC error
    This is an automatic backport of pull request Bank::get_slot_history() is fallible #12598 done by Mergify.

@mergify mergify Bot requested a review from a team as a code owner May 20, 2026 16:11
@mergify mergify Bot added the conflicts label May 20, 2026
@mergify
Copy link
Copy Markdown
Author

mergify Bot commented May 20, 2026

Cherry-pick of ddb592b has failed:

On branch mergify/bp/v4.0/pr-12598
Your branch is up to date with 'origin/v4.0'.

You are currently cherry-picking commit ddb592b10.
  (fix conflicts and run "git cherry-pick --continue")
  (use "git cherry-pick --skip" to skip this patch)
  (use "git cherry-pick --abort" to cancel the cherry-pick operation)

Changes to be committed:
	modified:   core/src/replay_stage.rs
	modified:   core/src/validator.rs
	modified:   rpc-client-api/src/custom_error.rs
	modified:   rpc/src/rpc.rs
	modified:   runtime/src/bank.rs

Unmerged paths:
  (use "git add <file>..." to mark resolution)
	both modified:   runtime/src/snapshot_bank_utils.rs

To fix up this pull request, you can check it out locally. See documentation: https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/reviewing-changes-in-pull-requests/checking-out-pull-requests-locally

@mergify
Copy link
Copy Markdown
Author

mergify Bot commented May 20, 2026

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 @mergify[bot].

@brooksprumo brooksprumo requested a review from AshwinSekar May 20, 2026 16:20
@brooksprumo
Copy link
Copy Markdown

@Mergifyio rebase

@mergify
Copy link
Copy Markdown
Author

mergify Bot commented May 20, 2026

rebase

☑️ Nothing to do, the required conditions are not met

Details
  • any of:
    • #commits-behind > 0 [📌 rebase requirement]
    • -linear-history [📌 rebase requirement]
  • -closed [📌 rebase requirement]
  • -conflict [📌 rebase requirement]
  • queue-position = -1 [📌 rebase requirement]

@brooksprumo
Copy link
Copy Markdown

In v4.0, do we now bump the version as the final commit before tagging?

Compared to v3.1, we bump as the first commit after a tag.

Here's the current error:

> channel version check
latest channel tag: v4.0.0
current version: v4.0.0
Error: A release has been tagged since your feature branch was last rebased. <current version> must be greater than <latest channel tag>..
        Possible solutions (in the order they should be tried):
        1. rebase your feature branch on the base branch
        2. merge the PR: "Bump Version to ..." once it has passed ci/checks, then rebase
        3. ask for help in #devops on discord
🚨 Error: The command exited with status 1

@levsha
Copy link
Copy Markdown

levsha commented May 21, 2026

In v4.0, do we now bump the version as the final commit before tagging?

Compared to v3.1, we bump as the first commit after a tag.

Here's the current error:

> channel version check
latest channel tag: v4.0.0
current version: v4.0.0
Error: A release has been tagged since your feature branch was last rebased. <current version> must be greater than <latest channel tag>..
        Possible solutions (in the order they should be tried):
        1. rebase your feature branch on the base branch
        2. merge the PR: "Bump Version to ..." once it has passed ci/checks, then rebase
        3. ask for help in #devops on discord
🚨 Error: The command exited with status 1

#12648 should fix the check to match it the new procedures

@brooksprumo
Copy link
Copy Markdown

I think now we're waiting on #12663.

@t-nelson
Copy link
Copy Markdown

@Mergifyio rebase

(cherry picked from commit ddb592b)

# Conflicts:
#	runtime/src/snapshot_bank_utils.rs
@mergify
Copy link
Copy Markdown
Author

mergify Bot commented May 21, 2026

rebase

✅ Branch has been successfully rebased

@t-nelson t-nelson force-pushed the mergify/bp/v4.0/pr-12598 branch from f799322 to 7db9941 Compare May 21, 2026 18:14
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 21, 2026

Codecov Report

❌ Patch coverage is 52.63158% with 9 lines in your changes missing coverage. Please review.
✅ Project coverage is 82.9%. Comparing base (2f1922e) to head (7db9941).

Additional details and impacted files
@@            Coverage Diff            @@
##             v4.0   #12629     +/-   ##
=========================================
- Coverage    82.9%    82.9%   -0.1%     
=========================================
  Files         842      842             
  Lines      317968   317981     +13     
=========================================
+ Hits       263856   263858      +2     
- Misses      54112    54123     +11     
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@brooksprumo brooksprumo merged commit 85b0de6 into v4.0 May 25, 2026
51 checks passed
@brooksprumo brooksprumo deleted the mergify/bp/v4.0/pr-12598 branch May 25, 2026 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants