Skip to content

Conversation

@fridrik01
Copy link
Contributor

@fridrik01 fridrik01 commented Dec 4, 2025

Issue #2992

Context

Block signatures were missing from the beacon header RPC endpoints (/eth/v1/beacon/headers and /eth/v1/beacon/headers/{block_id}), returning empty strings instead of the actual BLS signatures. This was because the block store only persisted block metadata (roots, timestamps) but not signatures.

This PR extends the in-memory block store to also cache block signatures during finalization, and updates the header handler to retrieve and include them in API responses.

Signatures are available for blocks within the availability window. For genesis or blocks outside this window, an empty string is returned (like its currenltly).

Test plan

> make start
> make start-geth
> curl -s http://localhost:3500/eth/v1/beacon/headers | jq
{
  "execution_optimistic": false,
  "finalized": true,
  "data": [
    {
      "root": "0xbd6a1cef0ce2f3bc49cefcb4ea1e73ba551005e5d9b16218958534e0729b8178",
      "canonical": true,
      "header": {
        "message": {
          "slot": "4",
          "proposer_index": "0",
          "parent_root": "0x39218bb0854655d64eb60167b470fa0047a941cf5b8f2ee54c85e775a73653fa",
          "state_root": "0xcc26439d46b0eed3b7ca3e1bea7dea71b2393d2581d27ad6bc8009c0b22e5cec",
          "body_root": "0xbd6a1cef0ce2f3bc49cefcb4ea1e73ba551005e5d9b16218958534e0729b8178"
        },
        "signature": "0xa2db3b4c2cd220eb8ecdaf047514c100d09ea63560925efa88004f9a820d5aaa057b658d1b43583b2d0aedeb63dc9f15185edd1b9cde1205a2395a92575fee5142f03fc40bb
241b045f6b97d9682a0f2e65ec5efc7ccae8ba5093305b16140f9"
      }
    }
  ]
}

On a restart, querying the slot 4 again results in a null signature (since this PR uses in-memory store)

> curl -s http://localhost:3500/eth/v1/beacon/headers/4 | jq
{
  "execution_optimistic": false,
  "finalized": true,
  "data": {
    "root": "0xbd6a1cef0ce2f3bc49cefcb4ea1e73ba551005e5d9b16218958534e0729b8178",
    "canonical": true,
    "header": {
      "message": {
        "slot": "4",
        "proposer_index": "0",
        "parent_root": "0x39218bb0854655d64eb60167b470fa0047a941cf5b8f2ee54c85e775a73653fa",
        "state_root": "0xcc26439d46b0eed3b7ca3e1bea7dea71b2393d2581d27ad6bc8009c0b22e5cec",
        "body_root": "0xbd6a1cef0ce2f3bc49cefcb4ea1e73ba551005e5d9b16218958534e0729b8178"
      },
      "signature": ""
    }
  }
}

@codecov
Copy link

codecov bot commented Dec 4, 2025

Codecov Report

❌ Patch coverage is 35.48387% with 20 lines in your changes missing coverage. Please review.
✅ Project coverage is 62.46%. Comparing base (44333a9) to head (b7ee7e0).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
storage/block/store.go 21.42% 10 Missing and 1 partial ⚠️
node-api/handlers/beacon/header.go 50.00% 4 Missing and 1 partial ⚠️
node-api/backend/getters.go 0.00% 2 Missing ⚠️
beacon/blockchain/finalize_block.go 75.00% 0 Missing and 1 partial ⚠️
consensus/cometbft/service/finalize_block.go 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2997      +/-   ##
==========================================
- Coverage   62.54%   62.46%   -0.08%     
==========================================
  Files         353      353              
  Lines       17099    17117      +18     
==========================================
- Hits        10694    10692       -2     
- Misses       5558     5576      +18     
- Partials      847      849       +2     
Files with missing lines Coverage Δ
beacon/blockchain/finalize_block.go 65.18% <75.00%> (-0.26%) ⬇️
consensus/cometbft/service/finalize_block.go 51.32% <0.00%> (ø)
node-api/backend/getters.go 35.82% <0.00%> (-1.11%) ⬇️
node-api/handlers/beacon/header.go 75.00% <50.00%> (-4.55%) ⬇️
storage/block/store.go 69.33% <21.42%> (-11.32%) ⬇️

... and 1 file with indirect coverage changes

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

@fridrik01 fridrik01 marked this pull request as ready for review December 8, 2025 17:58
@fridrik01 fridrik01 requested a review from a team as a code owner December 8, 2025 17:58
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.

3 participants