feat: snapshot accountsdb even in the replica mode#1282
Conversation
|
Warning Review limit reached
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 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 configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThis 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
✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
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
📒 Files selected for processing (3)
magicblock-processor/src/scheduler/mod.rsmagicblock-processor/tests/replica_ordering.rstest-kit/src/lib.rs
* 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)
* 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)
Summary by CodeRabbit
Bug Fixes
Tests