Skip to content

Comments

feat: add debug_getRawHeader method#4926

Merged
natanasow merged 41 commits intomainfrom
4891-add-debug-get-raw-header-method
Feb 24, 2026
Merged

feat: add debug_getRawHeader method#4926
natanasow merged 41 commits intomainfrom
4891-add-debug-get-raw-header-method

Conversation

@natanasow
Copy link
Member

@natanasow natanasow commented Feb 16, 2026

Description

Currently, we're missing the debug_getRawHeader method.

Solution

  • Implement debug_getRawHeader method
  • Check conformity tests
  • Edit openrpc.json and rpc-api.md
  • Add tests (if needed)

Missing fields in the Hedera concept:

fee_recipient

  • Address that receives transaction priority fees and MEV for the block
  • Set by the block proposer
  • Separates who proposes the block from who gets paid

prev_randao

  • On-chain randomness value from the Proof-of-Stake RANDAO
  • Used for validator selection and committee assignments
  • Represents accumulated randomness up to the previous step (not perfectly random)

withdrawal_root

  • Merkle root committing to all validator withdrawals in the block
  • Links consensus-layer withdrawals to execution-layer processing

RPC method:

{
  "id": 1,
  "jsonrpc": "2.0",
  "method": "debug_getRawHeader",
  "params": [
    "latest" // block number or block hash
  ]
}

Response:

{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0xf90211a0..." // RLP encoded header
}

Note:

  • fee_recipient - use 0.0.801 based on https://hips.hedera.com/hip/hip-1259
  • prevRandao - use block.difficulty - 0x0
  • withdrawal_root - use computed hash of an empty Trie object - 0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421

Related issue(s)

Fixes #4891

Testing Guide

Changes from original design (optional)

N/A

Additional work needed (optional)

N/A

Checklist

  • I've assigned an assignee to this PR and related issue(s) (if applicable)
  • I've assigned a label to this PR and related issue(s) (if applicable)
  • I've assigned a milestone to this PR and related issue(s) (if applicable)
  • I've updated documentation (code comments, README, etc. if applicable)
  • I've done sufficient testing (unit, integration, etc.)

Signed-off-by: nikolay <n.atanasow94@gmail.com>
Signed-off-by: nikolay <n.atanasow94@gmail.com>
Signed-off-by: nikolay <n.atanasow94@gmail.com>
# Conflicts:
#	packages/relay/src/lib/debug.ts
Signed-off-by: nikolay <n.atanasow94@gmail.com>
Signed-off-by: nikolay <n.atanasow94@gmail.com>
Signed-off-by: nikolay <n.atanasow94@gmail.com>
Signed-off-by: nikolay <n.atanasow94@gmail.com>
Signed-off-by: nikolay <n.atanasow94@gmail.com>
Signed-off-by: nikolay <n.atanasow94@gmail.com>
Signed-off-by: nikolay <n.atanasow94@gmail.com>
# Conflicts:
#	docs/rpc-api.md
#	scripts/openrpc-json-updater/config.js
Signed-off-by: nikolay <n.atanasow94@gmail.com>
Signed-off-by: nikolay <n.atanasow94@gmail.com>
Signed-off-by: nikolay <n.atanasow94@gmail.com>
Signed-off-by: nikolay <n.atanasow94@gmail.com>
Signed-off-by: nikolay <n.atanasow94@gmail.com>
Signed-off-by: nikolay <n.atanasow94@gmail.com>
@natanasow natanasow self-assigned this Feb 16, 2026
@natanasow natanasow added the enhancement New feature or request label Feb 16, 2026
@natanasow natanasow added this to the 0.76.0 milestone Feb 16, 2026
@natanasow natanasow changed the base branch from main to 4890-add-debug-getrawblock-method February 16, 2026 14:01
@github-actions
Copy link

github-actions bot commented Feb 16, 2026

Test Results

0 tests  ±0   0 ✅ ±0   0s ⏱️ ±0s
0 suites ±0   0 💤 ±0 
0 files   ±0   0 ❌ ±0 

Results for commit 230e9ca. ± Comparison against base commit c0f85f4.

♻️ This comment has been updated with latest results.

Signed-off-by: nikolay <n.atanasow94@gmail.com>
Signed-off-by: nikolay <n.atanasow94@gmail.com>
# Conflicts:
#	packages/relay/src/index.ts
Signed-off-by: nikolay <n.atanasow94@gmail.com>
@natanasow natanasow marked this pull request as ready for review February 17, 2026 13:54
@natanasow natanasow requested a review from a team as a code owner February 17, 2026 13:54
@natanasow natanasow requested a review from simzzz February 19, 2026 14:10
@natanasow natanasow changed the base branch from 4890-add-debug-getrawblock-method to main February 19, 2026 17:38
@natanasow natanasow dismissed jasuwienas’s stale review February 19, 2026 17:38

The base branch was changed.

# Conflicts:
#	docs/openrpc.json
#	docs/rpc-api.md
#	packages/relay/src/index.ts
#	packages/relay/src/lib/debug.ts
#	packages/relay/src/lib/factories/blockFactory.ts
#	packages/relay/tests/lib/debug.spec.ts
#	packages/server/tests/acceptance/debug.spec.ts
#	scripts/openrpc-json-updater/config.js
Signed-off-by: nikolay <n.atanasow94@gmail.com>
Signed-off-by: nikolay <n.atanasow94@gmail.com>
Signed-off-by: nikolay <n.atanasow94@gmail.com>
Signed-off-by: nikolay <n.atanasow94@gmail.com>
simzzz
simzzz previously approved these changes Feb 20, 2026
jasuwienas
jasuwienas previously approved these changes Feb 20, 2026
Copy link
Contributor

@jasuwienas jasuwienas left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Contributor

@BartoszSolkaBD BartoszSolkaBD left a comment

Choose a reason for hiding this comment

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

Looks good. I wonder if we should have better coverage for synthetic transactions in these debug methods. Please let me know what is your opinion.

Signed-off-by: nikolay <n.atanasow94@gmail.com>
jasuwienas
jasuwienas previously approved these changes Feb 23, 2026
Copy link
Contributor

@jasuwienas jasuwienas left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@quiet-node quiet-node left a comment

Choose a reason for hiding this comment

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

LG with some items

Signed-off-by: nikolay <n.atanasow94@gmail.com>
Copy link
Contributor

@quiet-node quiet-node left a comment

Choose a reason for hiding this comment

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

Nice one LGTM!

Copy link
Contributor

@jasuwienas jasuwienas left a comment

Choose a reason for hiding this comment

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

lgtm

@natanasow natanasow merged commit 5b976ef into main Feb 24, 2026
100 of 121 checks passed
@natanasow natanasow deleted the 4891-add-debug-get-raw-header-method branch February 24, 2026 09:53
@codecov
Copy link

codecov bot commented Feb 24, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

@@            Coverage Diff             @@
##             main    #4926      +/-   ##
==========================================
+ Coverage   95.86%   95.99%   +0.13%     
==========================================
  Files         143      143              
  Lines       23968    24063      +95     
  Branches     1900     1910      +10     
==========================================
+ Hits        22977    23100     +123     
+ Misses        967      939      -28     
  Partials       24       24              
Flag Coverage Δ
config-service 98.63% <ø> (ø)
relay 92.38% <100.00%> (+0.20%) ⬆️
server 88.39% <ø> (ø)
ws-server 97.90% <ø> (ø)

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

Files with missing lines Coverage Δ
packages/relay/src/index.ts 100.00% <100.00%> (ø)
packages/relay/src/lib/debug.ts 97.87% <100.00%> (+0.09%) ⬆️
packages/relay/src/lib/factories/blockFactory.ts 98.78% <100.00%> (+13.06%) ⬆️

... 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.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add debug_getRawHeader method

5 participants