Skip to content

Conversation

Thegaram
Copy link

@Thegaram Thegaram commented Oct 8, 2025

1. Purpose or design rationale of this PR

With Fusaka and PeerDAS, /eth/v1/beacon/blob_sidecars is now deprecated, we should use the new /eth/v1/beacon/blobs API instead. This API does not return the KZG commitment and proof, but it does allow filtering by blob versioned hash.

References:

This PR has not been tested yet, and should not be merged at this point.

2. PR title

Your PR title must follow conventional commits (as we are doing squash merge for each PR), so it must start with one of the following types:

  • feat: A new feature

3. Deployment tag versioning

Has the version in params/version.go been updated?

  • This PR doesn't involve a new deployment, git tag, docker image tag, and it doesn't affect traces
  • Yes

4. Breaking change label

Does this PR have the breaking-change label?

  • This PR is not a breaking change
  • Yes

Summary by CodeRabbit

  • Bug Fixes

    • Switched to the latest blobs endpoint for improved compatibility with beacon nodes.
    • Updated blob response handling and added stricter validation to prevent incorrect or missing blob data (e.g., handling zero/multiple results and validating blob size).
    • Improved error handling for more reliable blob retrieval and syncing.
  • Chores

    • Bumped patch version to 6.

Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the beacon node client to use the new /eth/v1/beacon/blobs API endpoint instead of the deprecated /eth/v1/beacon/blob_sidecars endpoint. This change is necessary for compatibility with Fusaka and PeerDAS upgrades.

  • Updates API endpoint from /eth/v1/beacon/blob_sidecars to /eth/v1/beacon/blobs
  • Simplifies blob retrieval by using versioned hash filtering in the API request
  • Removes manual blob hash verification logic since the new API handles filtering server-side

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
rollup/da_syncer/blob_client/beacon_node_client.go Updates beacon node client to use new blobs API with simplified response handling
params/version.go Increments patch version from 5.9.5 to 5.9.6

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

Copy link

coderabbitai bot commented Oct 8, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Patch version bumped in params/version.go. DA syncer beacon client now queries the blobs API with versioned_hashes, decodes a single hex blob from BlobsResp, validates its count and length, and returns the blob; an unused KZG constant was removed.

Changes

Cohort / File(s) Summary
Version bump
params/version.go
Incremented VersionPatch from 5 to 6, updating derived version strings (Version, VersionWithMeta, ArchiveVersion, VersionWithCommit, etc.).
DA blob client API update
rollup/da_syncer/blob_client/beacon_node_client.go
Switched from blob_sidecars to blobs endpoint with versioned_hashes query; added BlobsResp (Data []string); decode now expects exactly one hex blob, validates length against expected lenBlobBytes, and returns kzg4844.Blob; removed BlobSidecarResp and per-blob KZG hash computation.
Constants cleanup
rollup/da_syncer/blob_client/blob_client.go
Removed unused lenKZGCommitment constant (48); retained lenBlobBytes (131072).

Sequence Diagram(s)

sequenceDiagram
  autonumber
  participant C as BlobClient
  participant BN as BeaconNode (blobs API)

  rect rgba(220,235,255,0.35)
  note over C,BN: Request single blob by versioned hash
  C->>BN: GET /eth/v1/beacon/blobs?slot=<slot>&versioned_hashes=0x...
  BN-->>C: 200 OK { data: ["0x..."] }
  end

  alt Exactly one blob returned
    C->>C: decode hex -> bytes
    C->>C: validate len == expectedBlobSize (lenBlobBytes)
    alt length valid
      C-->>Caller: return kzg4844.Blob
    else invalid length
      C-->>Caller: error "invalid blob length"
    end
  else zero or >1 blobs
    C-->>Caller: error "unexpected blob count"
  end
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Possibly related PRs

Suggested labels

bump-version

Suggested reviewers

  • colinlyguo

Poem

"I nibble code and count each tweak,
From five to six my whiskers peek.
Blobs now fetched in single streams,
Clean and whole — the devs' bright dreams.
Hop, hop, commit — the rollout gleams!" 🐇✨

Pre-merge checks and finishing touches

❌ 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%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed The description adheres to the repository’s template by including the purpose, rationale, checklist for conventional commit type, version bump confirmation, and breaking-change label, and it provides relevant references and context for the change.
Title Check ✅ Passed The title clearly and concisely describes the primary change, namely adding support to fetch blobs via the new /eth/v1/beacon/blobs endpoint from the beacon node, aligning with both the code modifications and Conventional Commits style.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat-new-beacon-blobs-api

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 and usage tips.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

♻️ Duplicate comments (1)
rollup/da_syncer/blob_client/beacon_node_client.go (1)

112-112: Fix query parameter construction.

Query parameters must not be included in the path segment passed to url.JoinPath. This can lead to improper URL encoding and API call failures. Additionally, the format versioned_hashes=[%s] appears incorrect—the brackets should not be literal characters in the URL query string.

Apply this diff to properly construct the URL with query parameters:

-	blobSidecarPath, err := url.JoinPath(c.apiEndpoint, beaconNodeBlobEndpoint, fmt.Sprintf("%d?versioned_hashes=[%s]", slot, versionedHash))
+	blobPath, err := url.JoinPath(c.apiEndpoint, beaconNodeBlobEndpoint, fmt.Sprintf("%d", slot))
 	if err != nil {
 		return nil, fmt.Errorf("failed to join path, err: %w", err)
 	}
+	
+	// Add query parameters
+	parsedURL, err := url.Parse(blobPath)
+	if err != nil {
+		return nil, fmt.Errorf("failed to parse URL, err: %w", err)
+	}
+	q := parsedURL.Query()
+	q.Add("versioned_hashes", versionedHash.Hex())
+	parsedURL.RawQuery = q.Encode()
+	blobSidecarPath := parsedURL.String()
+	
 	req, err := http.NewRequestWithContext(ctx, "GET", blobSidecarPath, nil)
🧹 Nitpick comments (1)
rollup/da_syncer/blob_client/beacon_node_client.go (1)

149-155: Direct conversion to kzg4844.Blob is safe. lenBlobBytes is 131072—exactly the [131072]byte size of kzg4844.Blob—and the runtime length check prevents any mismatch. You may optionally replace the conversion with an explicit copy for clarity:

var b kzg4844.Blob
copy(b[:], blobBytes)
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 0697268 and cbd5efc.

📒 Files selected for processing (2)
  • params/version.go (1 hunks)
  • rollup/da_syncer/blob_client/beacon_node_client.go (4 hunks)
🧰 Additional context used
🧬 Code graph analysis (1)
rollup/da_syncer/blob_client/beacon_node_client.go (2)
common/bytes.go (1)
  • FromHex (29-37)
crypto/kzg4844/kzg4844.go (1)
  • Blob (31-31)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (2)
  • GitHub Check: test
  • GitHub Check: Analyze (go)
🔇 Additional comments (4)
params/version.go (1)

27-27: LGTM!

Version patch increment is appropriate for the new blob API feature.

rollup/da_syncer/blob_client/beacon_node_client.go (3)

31-31: LGTM!

Endpoint update aligns with the new Beacon Node blobs API as specified in the PR objectives.


135-147: LGTM!

The response validation logic appropriately handles edge cases where the beacon node returns zero or multiple blobs for the requested versioned hash. Error messages provide clear context for debugging.


170-172: LGTM!

The BlobsResp type correctly models the new /eth/v1/beacon/blobs API response structure with an array of hex-encoded blob strings.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 3

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between cbd5efc and e3b2c4c.

📒 Files selected for processing (2)
  • rollup/da_syncer/blob_client/beacon_node_client.go (4 hunks)
  • rollup/da_syncer/blob_client/blob_client.go (1 hunks)
✅ Files skipped from review due to trivial changes (1)
  • rollup/da_syncer/blob_client/blob_client.go
🧰 Additional context used
🧬 Code graph analysis (1)
rollup/da_syncer/blob_client/beacon_node_client.go (2)
crypto/kzg4844/kzg4844.go (1)
  • Blob (31-31)
common/bytes.go (1)
  • FromHex (29-37)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (5)
  • GitHub Check: test
  • GitHub Check: check
  • GitHub Check: build-mock-ccc-geth
  • GitHub Check: semgrep/ci
  • GitHub Check: Analyze (go)
🔇 Additional comments (3)
rollup/da_syncer/blob_client/beacon_node_client.go (3)

31-31: LGTM: Endpoint updated to new API.

The endpoint constant correctly reflects the migration from the deprecated blob_sidecars to the new blobs API.


158-163: LGTM: Thorough response validation.

The validation ensures exactly one blob is returned, providing clear error messages for both zero and multiple blob cases. This prevents incorrect data from propagating.


186-188: LGTM: Clean response type definition.

The BlobsResp struct appropriately models the new API response format with blobs as hex strings.

@Thegaram Thegaram changed the title feat: featch blobs via /eth/v1/beacon/blobs from beacon node feat: fetch blobs via /eth/v1/beacon/blobs from beacon node Oct 9, 2025
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.

1 participant