Skip to content

fix: record committed balances for failed transactions - #165

Merged
bmuddha merged 1 commit into
devfrom
fix/failed-transaction-post-balances
Sep 30, 2026
Merged

bmuddha merged 1 commit into
devfrom
fix/failed-transaction-post-balances

Conversation

@bmuddha

@bmuddha bmuddha commented Sep 30, 2026

Copy link
Copy Markdown
Collaborator

What changed

Failed transactions no longer record lamport moves from earlier successful instructions in their postBalances. Keeper now records the pre-execution balances as post balances when execution fails, matching the account state Engine commits. Fees are currently zero on the ER.

Closes #164

@bmuddha bmuddha self-assigned this Sep 30, 2026
@coderabbitai

coderabbitai Bot commented Sep 30, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

Navigate logical layers of code changes, visualize relationships, and explore their blast radius.

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository: magicblock-labs/magicblock-engine/.coderabbit.yaml

Review profile: ASSERTIVE

Plan: Advanced

Run ID: 3b847e5f-269c-4608-a346-6e94dc41c605

📥 Commits

Reviewing files that changed from the base of the PR and between b37f057 and e53128b.

📒 Files selected for processing (1)
  • keeper/src/util.rs

Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

When execution fails, execution_details now sets post-balances to a copy of pre-balances. For successful execution, it retains the collected post-balances or uses the default balances when none were collected.

Priority: ➖ Normal

Change: Bug fix · Severity of issue fixed: Low

Merge Risk: ⚪ Minimal · up to e5312

Failed transaction receipts now report balances consistent with rolled-back account state. No concrete merge-blocking issue remains; the change is mergeable after normal checks.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Issue #164 requires failed receipts to report committed balances. keeper/src/util.rs now replaces collected post-balances with pre-balances when details.status.is_err(). This removes reverted inst…
Out of Scope Changes check ✅ Passed The reviewed change is limited to failed-transaction balance projection in keeper/src/util.rs. This change directly implements issue #164. No unrelated production change is shown.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 1 functions across 1 files.
Title check ✅ Passed The title clearly and concisely describes the main change: recording committed balances for failed transactions.
Description check ✅ Passed The description directly explains the balance-recording fix, its effect on failed transactions, and the relationship to committed account state.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

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.

@bmuddha
bmuddha marked this pull request as ready for review September 30, 2026 11:37
@bmuddha
bmuddha merged commit 7c95d6a into dev Sep 30, 2026
9 checks passed
@bmuddha
bmuddha deleted the fix/failed-transaction-post-balances branch September 30, 2026 13:36
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.

Failed transactions report post balances from before the rollback

1 participant