Add self-contained WAL WSC export - #614
Conversation
|
Warning Review limit reached
More reviews will be available in 57 minutes and 32 seconds. Learn how PR review limits work. Your organization has run out of usage credits. Purchase more credits in the billing tab to continue. ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. 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 (5)
✨ 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.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 58be28d7b4
ℹ️ 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".
| let submission_index = RecoveredSubmissionIndex::from_acceptance_and_receipt_records( | ||
| accepted_submissions.iter().copied(), | ||
| receipt_records.receipts.iter().copied(), | ||
| ) |
There was a problem hiding this comment.
Reject sidecars that do not match embedded WAL records
For self-contained imports with malformed or adversarial sidecar envelopes, validation replays the embedded segment bytes but then builds the returned submission index solely from the accepted-submission/receipt WSC sidecars. Because those sidecars are only checked for internal consistency, an export can embed valid WAL bytes containing accepted submissions and receipts while passing empty or fabricated sidecars, and this function will still return a WscSelfContainedWalImport whose indexes disagree with the causal WAL history. Please derive these records from segment_recoveries (or compare the sidecars against the records recovered from the embedded WAL bytes) before accepting the import.
Useful? React with 👍 / 👎.
| if actual_previous_commit_digest != Some(segment.previous_commit_digest) | ||
| || actual_final_commit_digest != Some(segment.final_commit_digest) |
There was a problem hiding this comment.
Validate every embedded commit-chain link
For an embedded segment with four or more committed transactions, this endpoint-only check accepts reordered intermediate commit records such as 1,3,2,4: the first previous digest, final digest, LSN range, segment digest, and sorted anchor set still match, but the recovered transaction order no longer follows each commit's previous_committed_transaction_digest. Since recover_from_frames_and_commits preserves the commit-marker order it reads, validate each adjacent commit link before accepting the segment as matching the projected commit chain.
Useful? React with 👍 / 👎.
| for node_index in 0..view.nodes().len() { | ||
| for attachment in view.node_attachments(node_index) { |
There was a problem hiding this comment.
Reject non-canonical segment-material WSC graphs
When importing a self-contained export from untrusted WSC bytes, this parser accepts any graph with the right schema and attachment type because it only scans every node's attachments; it never checks the expected warp id/root node, node types, edge membership, or that the bytes equal the canonical segment-material graph. As a result, validate_wsc_self_contained_wal_export can bless an envelope whose digest contains extra or miswired graph facts that are not represented in the returned segment materials, breaking the deterministic evidence boundary for this new segment-material schema.
Useful? React with 👍 / 👎.
Summary
Closes #565
Validation