Skip to content

Add DataColumnSidecarSelectorFactory test#10333

Open
zilm13 wants to merge 3 commits intoConsensys:masterfrom
zilm13:data-column-sidecar-selector-factory-test
Open

Add DataColumnSidecarSelectorFactory test#10333
zilm13 wants to merge 3 commits intoConsensys:masterfrom
zilm13:data-column-sidecar-selector-factory-test

Conversation

@zilm13
Copy link
Contributor

@zilm13 zilm13 commented Feb 5, 2026

PR Description

Fixed Issue(s)

Documentation

  • I thought about documentation and added the doc-change-required label to this PR if updates are required.

Changelog

  • I thought about adding a changelog entry, and added one if I deemed necessary.

Note

Low Risk
Mostly adds tests plus straightforward milestone gating that reduces when storage is queried; low blast radius but changes API behavior for pre-Fulu slots/blocks (now returns empty).

Overview
Adds a comprehensive unit test suite for DataColumnSidecarSelectorFactory, covering head, finalized, genesis, slot, and blockRoot selector behaviors plus metadata assertions and error/unsupported selector cases.

Updates selector fetching to only query data column sidecars starting at the FULU milestone, and to return an empty list (without calling storage) for valid FULU Deneb blocks that contain no blob KZG commitments.

Written by Cursor Bugbot for commit 55e6c20. This will update automatically on new commits. Configure here.

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

final DataColumnSidecarSelectorFactory dataColumnSidecarSelectorFactory =
new DataColumnSidecarSelectorFactory(ctx.getSpec(), client);

final SignedBlockAndState blockAndState = data.randomSignedBlockAndState(100);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test uses wrong DataStructureUtil for cross-milestone template

Low Severity

In shouldLookForDataColumnSidecarsByHeadOnlyAfterFulu, blockAndState is created via the class-level data field (which uses a FULU spec), while the factory is correctly constructed with ctx.getSpec(). This creates a spec mismatch when running with non-FULU milestones (e.g., Phase0 factory holding a FULU-structured ChainHead). The sibling test shouldLookForDataColumnSidecarsBySlotOnlyAfterFulu correctly uses new DataStructureUtil(ctx.getSpec()) to generate context-appropriate data — this test needs the same treatment.

Additional Locations (1)

Fix in Cursor Fix in Web

Copy link
Contributor

@tbenr tbenr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not a fan of these if(fulu)s

end returning empty the API will return a 404 even if the request is invalid, so we should trigger a 400 at API level, imo.

@zilm13
Copy link
Contributor Author

zilm13 commented Feb 9, 2026

@tbenr It depends on selector if we know this info at the certain phase:
genesis, slot - we know at the beginning
head, blockRoot, finalized - we need to get block info to be aware if slot is in fulu
So we defintely cannot do it on earlier stage in all cases and it depends on selector and should be in selector logic.

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