Skip to content

Add nil-element validation for Collection transactions in ChunkDataPack - #8690

Merged
zhangchiqing merged 1 commit into
leo/nil-validation-execution-result-payloadfrom
leo/nil-validation-chunk-data-pack
Sep 23, 2026
Merged

zhangchiqing merged 1 commit into
leo/nil-validation-execution-result-payloadfrom
leo/nil-validation-chunk-data-pack

Conversation

@zhangchiqing

@zhangchiqing zhangchiqing commented Sep 4, 2026 •

Copy link
Copy Markdown
Member

Add nil-element validation for [Collection.Transactions] in the [ChunkDataPack] constructor, rejecting CBOR-decoded null transaction elements.

This PR depends on #8689 (and transitively on #8688). It is part of a PR stack that splits up #8668.


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

Summary by CodeRabbit

  • Bug Fixes
    • Invalid collection data is now rejected when processing chunk data.
    • Clear validation errors are returned for collections containing invalid transactions.
    • Valid collections are checked before being included in processed chunk data.

@zhangchiqing
zhangchiqing requested a review from a team as a code owner September 4, 2026 23:24
@coderabbitai

coderabbitai Bot commented Sep 4, 2026 •

Copy link
Copy Markdown
Contributor

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: cae0efa4-67b3-4ebb-8eca-787979669137

📥 Commits

Reviewing files that changed from the base of the PR and between e46fddf and 257b32f.

📒 Files selected for processing (2)
  • model/flow/chunk.go
  • model/flow/chunk_test.go

Included review availability: Your plan provides up to 4 included reviews per hour; 2 remain after this review.


📝 Walkthrough

Walkthrough

NewChunkDataPack now validates non-nil collections before storing them. Invalid collections return a wrapped error. A test covers a collection containing a nil transaction.

Changes

Chunk data pack validation

Layer / File(s) Summary
Collection reconstruction and validation
model/flow/chunk.go, model/flow/chunk_test.go
NewChunkDataPack reconstructs non-nil collections through NewCollection. It preserves nil collections, wraps validation errors with "invalid collection: %w", and returns no pack for invalid input. The test covers a nil transaction entry.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: tim-barry

Merge Risk: ⚪ Minimal · up to 543fe

The constructor now validates collections and rejects nil transactions with test coverage; no merge-blocking behavior is established.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
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 2 functions across 2 files.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: adding nil-element validation for Collection transactions in the ChunkDataPack constructor.
✨ Finishing Touches 💡 1
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch leo/nil-validation-chunk-data-pack

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.

@zhangchiqing
zhangchiqing force-pushed the leo/nil-validation-chunk-data-pack branch from b5e3710 to 4aaf05a Compare September 15, 2026 19:19
@zhangchiqing
zhangchiqing removed this pull request from stack #8691 September 15, 2026 19:26
@zhangchiqing
zhangchiqing added this pull request to stack #8700 September 15, 2026 19:28
@zhangchiqing
zhangchiqing force-pushed the leo/nil-validation-chunk-data-pack branch from 4aaf05a to 257b32f Compare September 15, 2026 19:28
@github-actions

Copy link
Copy Markdown
Contributor

Dependency Review

✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.

Scanned Files

None

@codecov-commenter

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@blacksmith-sh

This comment has been minimized.

@zhangchiqing
zhangchiqing force-pushed the leo/nil-validation-chunk-data-pack branch from 257b32f to 9f4e1a1 Compare September 15, 2026 20:43
@zhangchiqing
zhangchiqing force-pushed the leo/nil-validation-chunk-data-pack branch from 9f4e1a1 to 543fecf Compare September 16, 2026 00:40
@zhangchiqing
zhangchiqing added this pull request to the merge queue Sep 23, 2026
Merged via the queue into master with commit 617340c Sep 23, 2026
65 of 76 checks passed
@zhangchiqing
zhangchiqing deleted the leo/nil-validation-chunk-data-pack branch September 23, 2026 22:51
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.

4 participants