Skip to content

feat: snapshot accountsdb even in the replica mode#1282

Merged
bmuddha merged 3 commits into
masterfrom
bmuddha/feat/always-snapshot-accountsdb
Jun 4, 2026
Merged

feat: snapshot accountsdb even in the replica mode#1282
bmuddha merged 3 commits into
masterfrom
bmuddha/feat/always-snapshot-accountsdb

Conversation

@bmuddha
Copy link
Copy Markdown
Collaborator

@bmuddha bmuddha commented Jun 3, 2026

Summary by CodeRabbit

  • Bug Fixes

    • Refined replica-mode handling to avoid superblock replication being broadcast incorrectly
    • Improved lifecycle of database pause permits during replica block application to ensure correct notifications
  • Tests

    • Added integration test verifying replica-mode snapshot behavior without publishing superblock messages
    • Added configurable replica-mode test environment to support superblock-size scenarios

@bmuddha bmuddha requested a review from lucacillario June 3, 2026 11:41
@bmuddha bmuddha self-assigned this Jun 3, 2026
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Jun 3, 2026

Review Change Stack

Warning

Review limit reached

@bmuddha, we couldn't start this review because you've reached your PR review rate limit.

More reviews will be available in 3 minutes and 39 seconds. Learn how PR review limits work.

Your organization has run out of usage credits. Purchase more in the billing tab.

⌛ How to resolve this issue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans include higher PR review limits than trial, open-source, and free plans. In all cases, reviews become available again over time. During sustained high-volume PR review activity, CodeRabbit may temporarily slow when the next review becomes available.

Please see our Fair Usage Limits Policy for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 30107c2f-3f3e-4913-8929-e54f68eacfd5

📥 Commits

Reviewing files that changed from the base of the PR and between ddc8540 and 2515fc8.

📒 Files selected for processing (1)
  • magicblock-processor/src/scheduler/mod.rs
📝 Walkthrough

Walkthrough

This PR modifies the scheduler to gate superblock replication messages to primary mode only, while adding superblock handling at two new trigger points in replica mode: after slot transitions on incoming blocks and after successful executor notification during block replays. The replica block replay path now explicitly manages the exclusive DB-access permit by retaining it during executor notification and then dropping it before calling superblock handling. Test infrastructure is extended to support custom superblock sizes, enabling an integration test that validates replica mode does not publish superblock messages while still creating accountsdb snapshots at superblock boundaries.

Suggested reviewers

  • GabrielePicco
  • taco-paco
  • lucacillario
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch bmuddha/feat/always-snapshot-accountsdb

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.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@magicblock-processor/src/scheduler/mod.rs`:
- Around line 273-275: The code calls handle_superblock for the same slot twice:
once via the block_produced.recv() branch after apply_replayed_block() updates
latest_block, and again after transition_to_new_slot() in the replay path.
Remove or guard the redundant handle_superblock call in the replay path (the
second invocation after transition_to_new_slot) so that handle_superblock is
only invoked by the block_produced.recv() branch; alternatively, add a simple
check (e.g., compare the slot returned by transition_to_new_slot or inspect
latest_block) before calling handle_superblock to avoid duplicate handling.
Ensure changes reference apply_replayed_block, transition_to_new_slot, and
handle_superblock.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 3658830c-2b90-485e-8d38-e9fd1bcff407

📥 Commits

Reviewing files that changed from the base of the PR and between ab56862 and 372e576.

📒 Files selected for processing (3)
  • magicblock-processor/src/scheduler/mod.rs
  • magicblock-processor/tests/replica_ordering.rs
  • test-kit/src/lib.rs

Comment thread magicblock-processor/src/scheduler/mod.rs
Copy link
Copy Markdown
Contributor

@lucacillario lucacillario left a comment

Choose a reason for hiding this comment

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

LGTM

@bmuddha bmuddha merged commit c73b5b0 into master Jun 4, 2026
33 checks passed
@bmuddha bmuddha deleted the bmuddha/feat/always-snapshot-accountsdb branch June 4, 2026 08:34
thlorenz added a commit that referenced this pull request Jun 5, 2026
* master:
  fix: reject short account responses (#1290)
  fix: wait for pubsub listeners before reconnect (#1253)
  fix: retry failed program subscriptions (#1268)
  release: 0.12.0 (#1299)
  Ignore compute unit price in processor fees (#1298)
  Recover recent pending intents on restart (#1296)
  chore: adjust log level (#1297)
  release: v0.11.4 (#1292)
  fix(scheduler): remove block subscription in the scheduler (#1293)
  fix(committor): race-condition on cleanup (#1291)
  Handle ALT extend invalid instruction data (#1287)
  fix: use provided compute limits instead of defaults (#1289)
  feat: snapshot accountsdb even in the replica mode (#1282)
  feat: added vrf ephemeral test queue, delegation record and metadata for mb-test-validator (#1281)
  fix: use wire size (1232), not encoded size (1644), for tx fit checks! (#1285)
  chore: simplify, rename out_of_order_slot and add a comment (#1284)
  fix: execute post-delegation actions after clone (#1278)
  Handle oversized single-stage committor transactions (#1277)
  Reduce committor RPC confirmation calls (#1271)
  fix: preserve streams on optimize failure (#1273)
thlorenz added a commit that referenced this pull request Jun 5, 2026
* master:
  fix: reject short account responses (#1290)
  fix: wait for pubsub listeners before reconnect (#1253)
  fix: retry failed program subscriptions (#1268)
  release: 0.12.0 (#1299)
  Ignore compute unit price in processor fees (#1298)
  Recover recent pending intents on restart (#1296)
  chore: adjust log level (#1297)
  release: v0.11.4 (#1292)
  fix(scheduler): remove block subscription in the scheduler (#1293)
  fix(committor): race-condition on cleanup (#1291)
  Handle ALT extend invalid instruction data (#1287)
  fix: use provided compute limits instead of defaults (#1289)
  feat: snapshot accountsdb even in the replica mode (#1282)
  feat: added vrf ephemeral test queue, delegation record and metadata for mb-test-validator (#1281)
  fix: use wire size (1232), not encoded size (1644), for tx fit checks! (#1285)
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