Skip to content

fix(syncing): reject DA signed data without metadata - #3500

Merged
damiannolan merged 2 commits into
mainfrom
fix/da-retriever-nil-metadata
Oct 27, 2026
Merged

damiannolan merged 2 commits into
mainfrom
fix/da-retriever-nil-metadata

Conversation

@damiannolan

@damiannolan damiannolan commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Overview

tryDecodeData used Data accessors (DACommitment, Height) that dereference Metadata, but a decoded blob may carry nil Metadata. Guard for it after signature validation and skip the blob instead of dereferencing.

Adds a regression test for a validly-signed blob with no metadata.

Summary by CodeRabbit

  • Bug Fixes
    • Signed data without metadata is now rejected after its signature is validated. It is no longer processed using missing metadata or marked as included in data availability, helping synchronization handle incomplete data safely.

tryDecodeData used Data accessors (DACommitment, Height) that dereference
Metadata, but a decoded blob may carry nil Metadata. Guard for it after
signature validation and skip the blob instead of dereferencing.

Adds a regression test for a validly-signed blob with no metadata.
@damiannolan
damiannolan marked this pull request as ready for review October 27, 2026 13:59
@coderabbitai

coderabbitai Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent review info
Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 7650530f-fc5b-4ed6-9f69-3c619393955a
Commits

Reviewing files that changed from the base of the PR and between dc05110 and af24208.

Files selected for processing: 1
  • block/internal/syncing/da_retriever.go

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

Walkthrough

tryDecodeData now rejects signed data with nil metadata after signature validation. A regression test verifies that the method returns nil for this input.

Changes: Nil metadata handling

Layer / File(s) Summary
Metadata validation and regression test
block/internal/syncing/da_retriever.go, block/internal/syncing/da_retriever_test.go
tryDecodeData logs and rejects signed data with nil metadata before accessing commitment or height fields. The regression test checks that the method returns nil.

Priority: Normal

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

Change: Bug fix

Suggested reviewers: tac0turtle

Merge Risk: Minimal · up to af242

No actionable merge-blocking risk remains from the reviewed change.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within survi… Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title clearly and concisely identifies the main change: rejecting DA signed data that lacks metadata. It follows the repository's semantic commit format.
Description check Passed The description includes the required Overview section and explains the context, cause, behavior change, and regression test. No issue link is required because the author does not reference an issue.
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.
Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Documentation-only edits and deletions within surviving functions are included; unchanged diff context and fully deleted functions are excluded. Analyzed 1 functions across 2 files.

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

Finishing Touches: 💡 1
📝 Generate docstrings: 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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.

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

The latest Buf updates on your PR. Results from workflow CI / buf-check (pull_request).

BuildFormatLintBreakingUpdated (UTC)
✅ passed⏩ skipped✅ passed⏩ skippedOct 27, 2026, 2:19 PM

@codecov

codecov Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 69.31%. Comparing base (dce05e7) to head (af24208).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3500      +/-   ##
==========================================
- Coverage   69.31%   69.31%   -0.01%     
==========================================
  Files         122      122              
  Lines       12216    12219       +3     
==========================================
+ Hits         8468     8470       +2     
- Misses       3748     3749       +1     
Flag Coverage Δ
combined 69.31% <100.00%> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@damiannolan

Copy link
Copy Markdown
Contributor Author

Fixing lint

staticcheck QF1008: SignedData embeds Data, so signedData.Metadata is enough.
@damiannolan
damiannolan added this pull request to the merge queue Oct 27, 2026
Merged via the queue into main with commit 28d2714 Oct 27, 2026
32 checks passed
@damiannolan
damiannolan deleted the fix/da-retriever-nil-metadata branch October 27, 2026 15:26
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.

2 participants