Skip to content

refactor: remove invariant panic paths - #107

Merged
bmuddha merged 1 commit into
devfrom
refactor/remove-invariant-panics
Aug 28, 2026
Merged

refactor: remove invariant panic paths#107
bmuddha merged 1 commit into
devfrom
refactor/remove-invariant-panics

Conversation

@bmuddha

@bmuddha bmuddha commented Aug 28, 2026

Copy link
Copy Markdown
Collaborator

What changed

Remove production invariant panics from ledger block reads, replication control handoff, and Legacy/v0 transaction framing. Replication now uses one flat ordered handoff and one decode-to-message path, while transaction framing reuses a single empty address-lookup representation.

Closes #96

Impact

Public ledger and transaction-view APIs, persisted formats, and replication wire behavior are unchanged. Internal invariant drift no longer aborts production through unreachable!.

Reviewer notes

Ingest must flush every preceding transaction batch before handing Control a block, superblock, or reset. Legacy/v0 header parsing remains the boundary that determines whether address-table bytes are present.

@bmuddha bmuddha added the techdebt Shortcut was taken, that needs to be addressed in the future label Aug 28, 2026
@bmuddha bmuddha self-assigned this Aug 28, 2026
@coderabbitai

coderabbitai Bot commented Aug 28, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: c506b4db-41fb-464d-aac9-cff3ee2d41dc

📥 Commits

Reviewing files that changed from the base of the PR and between ea0a158 and d6661a5.

📒 Files selected for processing (5)
  • ledger/src/reader.rs
  • replicator/src/client.rs
  • solana/transaction-view/src/address_table_lookup_frame.rs
  • solana/transaction-view/src/message_header_frame.rs
  • solana/transaction-view/src/transaction_frame.rs

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


📝 Walkthrough

Walkthrough

The ledger reader now builds bare block responses for absent details. Replication uses dedicated block, superblock, and reset messages, with direct validation and transaction batching. Transaction parsing now restricts legacy/V0 header handling and uses default address-table lookup frames for legacy and V1 transactions. The message-header constructor and related tests use a legacy/V0-specific name.

Merge Risk: ⚪ Minimal · up to d6661

This refactor removes production invariant panic paths without identified changes to public behavior or persisted formats. No actionable merge-blocking risk remains beyond normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Linked Issues check ✅ Passed The changes address issue #96 by removing production invariant panic paths, narrowing replication and transaction types, handling BlockDetails::None without a panic, and preserving public behavior.
Out of Scope Changes check ✅ Passed All changes are related to issue #96. The default derivation and constructor rename support the transaction-framing refactor, and no unrelated code changes are identified.
Docstring Coverage ✅ Passed Docstring coverage is 80.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 15 functions across 5 files.
Title check ✅ Passed The title clearly summarizes the main change: removing invariant panic paths through a refactor.
Description check ✅ Passed The description directly explains the removal of production invariant panics, the replication and transaction-framing changes, and the preserved behavior.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch refactor/remove-invariant-panics

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 August 28, 2026 10:34
@bmuddha
bmuddha merged commit a0444ae into dev Aug 28, 2026
4 checks passed
@bmuddha
bmuddha deleted the refactor/remove-invariant-panics branch August 28, 2026 10:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

techdebt Shortcut was taken, that needs to be addressed in the future

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Eliminate invariant panic paths with narrower internal types

1 participant