Skip to content

fix(ledger): base replay slot has to be next slot after last persisted one#1229

Draft
taco-paco wants to merge 1 commit into
masterfrom
fix/replay-base-slot
Draft

fix(ledger): base replay slot has to be next slot after last persisted one#1229
taco-paco wants to merge 1 commit into
masterfrom
fix/replay-base-slot

Conversation

@taco-paco
Copy link
Copy Markdown
Contributor

@taco-paco taco-paco commented May 20, 2026

Summary

Base replay slot has to be next slot after last persisted one

Breaking Changes

  • None
  • Yes — migration path described below

Test Plan

Summary by CodeRabbit

Bug Fixes

  • Adjusted ledger synchronization behavior to correct the processing start position when the database falls behind, ensuring proper consistency during ledger replay operations.

Review Change Stack

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 20, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: a7e1f1c0-847a-478b-a247-a59e07c60d83

📥 Commits

Reviewing files that changed from the base of the PR and between f001043 and af6af0c.

📒 Files selected for processing (1)
  • magicblock-api/src/magic_validator.rs

📝 Walkthrough

Walkthrough

This PR adjusts the ledger replay logic in magicblock-api/src/magic_validator.rs. When the accounts database lags behind the ledger, the replay process now begins at the slot immediately following the accounts database slot (accountsdb_slot + 1) rather than at the accounts database slot itself. The change introduces a new variable full_process_starting_slot to compute and pass this adjusted boundary into the process_ledger function.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/replay-base-slot

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@GabrielePicco GabrielePicco changed the title fix(F-10): base replay slot has to be next slot after last persisted one fix(ledger): base replay slot has to be next slot after last persisted one May 20, 2026
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.

1 participant