Handle ALT extend invalid instruction data#1287
Conversation
|
Warning Review limit reached
More reviews will be available in 39 minutes and 49 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 ignored due to path filters (2)
📒 Files selected for processing (2)
✨ 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 |
|
@CodeRabbit review |
✅ Action performedReview finished.
|
There was a problem hiding this comment.
Actionable comments posted: 2
🤖 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-table-mania/src/manager.rs`:
- Around line 393-397: The code treats any InvalidInstructionData at
EXTEND_LOOKUP_TABLE_INSTRUCTION_INDEX as ExtendTableErrorAction::CreateNewTable
without reducing the retry budget, which can cause many tiny tables to be
created; add a small cap (e.g. MAX_CONSECUTIVE_FORCED_NEW_TABLES constant) and
track a consecutive_create_new_table counter in the loop that handles extend
errors (the same area using err.is_sent_transaction_invalid_instruction_data_at
and ExtendTableErrorAction::CreateNewTable); when the counter exceeds the cap,
change the fallback behavior to a bounded alternative (e.g. treat as
BubbleExtend/other ExtendTableErrorAction or return a hard error) and reset the
counter when a different error or a successful extend occurs, and ensure
FALLBACK_NEW_TABLE_INIT_PUBKEYS/remaining logic is respected so we don’t consume
all remaining pubkeys by repeated forced-new-table creations.
- Line 288: The variable extend_errors in reserve_new_pubkeys currently
accumulates across all tables/iterations causing a global retry budget; change
its scope/behavior so the retry budget is per-table or per-attempt: either move
the declaration/initialization of extend_errors inside the per-table loop (or
inside the retry loop that wraps calls like extend_table or extend_pubkeys) or
reset extend_errors to 0 whenever successful progress is made (e.g., after a
successful extend operation in reserve_new_pubkeys and related loops). Update
any related loops (the sections around the other extend logic mentioned) to
follow the same per-table/per-attempt reset so transient failures on different
tables do not aggregate and abort the whole reservation.
🪄 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: 3a17c1a0-8987-4465-b9f9-f3e97e6096e2
⛔ Files ignored due to path filters (2)
Cargo.lockis excluded by!**/*.locktest-integration/Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (3)
magicblock-table-mania/Cargo.tomlmagicblock-table-mania/src/error.rsmagicblock-table-mania/src/manager.rs
thlorenz
left a comment
There was a problem hiding this comment.
LGTM with a minor concern. You can decide if that is an issue or not:
This fallback only skips the failed table for the current reservation attempt. Since the table is not marked non-extendable, it can be selected again later if it becomes active_tables.last() again, e.g. after the fallback table is released while the original table still has reservations. Should we persistently quarantine/mark the table as no-longer-extendable after InvalidInstructionData, while still allowing it to satisfy existing lookups?
If it is ok to try to extend the same table again in the future and then end up in the same fallback then it is not an issue, but wanted to point it ou.
Step-by-step details of the issue:
-
reserve_new_pubkeysonly attempts to extendactive_tables.last()when that table is not full.- See
magicblock-table-mania/src/manager.rs:300-303.
- See
-
When extending Table A fails with
InvalidInstructionData, the PR setsforce_new_table = true.- See
magicblock-table-mania/src/manager.rs:317-324.
- See
-
force_new_tableis only a local variable for the current loop iteration.- It is initialized on each iteration at
magicblock-table-mania/src/manager.rs:294. - Nothing is stored on Table A to indicate that future extends should be skipped.
- It is initialized on each iteration at
-
The fallback then creates Table B and pushes it to
active_tables.- See
magicblock-table-mania/src/manager.rs:376-377.
- See
-
Immediately after this, future reservations will try Table B first because it is now
active_tables.last(). -
However, Table A remains active and is not marked full/non-extendable.
- Fullness is based only on local pubkey count:
magicblock-table-mania/src/lookup_table_rc.rs:350-357.
- Fullness is based only on local pubkey count:
-
If Table B is later released while Table A still has reservations,
release_pubkeyscan remove B fromactive_tablesand keep A.- See
magicblock-table-mania/src/manager.rs:552-563.
- See
-
At that point,
active_tablesmay become[A]again. -
Since A is still not full locally and is again
active_tables.last(), a new reservation can try to extend A again. -
So the fallback avoids retrying A only in the immediate flow, but does not persistently prevent future attempts to extend A.
Fair point, added a |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 460bae6ec1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
* 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
Problem: Table Mania retried the same active lookup table when an ALT extend transaction failed with
InstructionError(2, InvalidInstructionData). That could keep replaying the same rejected extend path and let committor preparation fail instead of moving the reservation forward.Solution: classify
InvalidInstructionDataat the existing-table ALT extend instruction, skip the normal retry path for that table, and create a fresh lookup table with a minimal one-key init payload. Other extend failures still use the existing bounded retry behavior.Summary by CodeRabbit
Improvements
Chores