Skip to content

Conversation

@sprites0
Copy link
Contributor

@sprites0 sprites0 commented Oct 6, 2025

Description

This PR adds support for custom headers in the reth db get static-file headers <N> command, to make it more consistent with other parts of StaticFileProviderRW which uses NodePrimitives::BlockHeader.

Motivation

This patch is particularly relevant for NodeBuilder API usages e.g., reth-hl, which will rely on a custom header type with a dedicated Compact trait implementation.

Example output

# target/debug/reth-hl db get static-file headers 1
2025-10-06T04:12:10.012167Z  INFO Initialized tracing, debug log directory: /root/.cache/reth/logs/hyperliquid
2025-10-06T04:12:10.045997Z  INFO Opening storage db_path="/root/.local/share/reth/hyperliquid/db" sf_path="/root/.local/share/reth/hyperliquid/static_files"
2025-10-06T04:12:10.100576Z  INFO Verifying storage consistency.
Header
{
  "inner": {
    "parentHash": "0xd8fcc13b6a195b88b7b2da3722ff6cad767b13a8c1e9ffb1c73aa9d216d895f0",
    "sha3Uncles": "0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347",
    "miner": "0x0000000000000000000000000000000000000000",
    "stateRoot": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "transactionsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
    "receiptsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
    "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    "difficulty": "0x0",
    "number": "0x1",
    "gasLimit": "0x1e8480",
    "gasUsed": "0x0",
    "timestamp": "0x67b40034",
    "extraData": "0x",
    "mixHash": "0x0000000000000000000000000000000000000000000000000000000000000000",
    "nonce": "0x0000000000000000",
    "baseFeePerGas": "0x5f5e100",
    "withdrawalsRoot": "0x56e81f171bcc55a6ff8345e692c0f86e5b48e01b996cadc001622fb5e363b421",
    "blobGasUsed": "0x0",
    "excessBlobGas": "0x0",
    "parentBeaconBlockRoot": "0x0000000000000000000000000000000000000000000000000000000000000000"
  },
  "extras": {
    "logs_bloom_with_system_txs": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    "system_tx_count": 0
  }
}

BlockHash
"0xde151843548b88d06f201d86e860e45fbf07d49612f1934fba5746abd942fb01"

Copy link
Collaborator

@shekhirin shekhirin left a comment

Choose a reason for hiding this comment

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

nice!

@github-project-automation github-project-automation bot moved this from Backlog to In Progress in Reth Tracker Oct 6, 2025
@shekhirin shekhirin enabled auto-merge October 6, 2025 10:01
@shekhirin shekhirin added C-enhancement New feature or request A-cli Related to the reth CLI A-static-files Related to static files labels Oct 6, 2025
@shekhirin shekhirin added this pull request to the merge queue Oct 6, 2025
Merged via the queue into paradigmxyz:main with commit d77bfd8 Oct 6, 2025
43 checks passed
@github-project-automation github-project-automation bot moved this from In Progress to Done in Reth Tracker Oct 6, 2025
sprites0 added a commit to hl-archive-node/reth that referenced this pull request Oct 9, 2025
CarlBeek added a commit to CarlBeek/reth that referenced this pull request Oct 10, 2025
* main: (280 commits)
  refactor: remove needless collect() calls in trie tests (paradigmxyz#18937)
  chore(grafana): use precompile address as legend (paradigmxyz#18913)
  perf(tree): worker pooling for storage in multiproof generation (paradigmxyz#18887)
  feat: wait for new blocks when build is in progress (paradigmxyz#18831)
  chore: align node_config threshold constant (paradigmxyz#18914)
  docs: duplicate comment in Eip4844PoolTransactionError (paradigmxyz#18858)
  ci: cache hive simulator images to reduce prepare-hive job time (paradigmxyz#18899)
  refactor: replace collect().is_empty() with next().is_none() in tests (paradigmxyz#18902)
  feat(provider): add get_account_before_block to ChangesetReader (paradigmxyz#18898)
  refactor(engine): separate concerns in on_forkchoice_updated for better maintainability (paradigmxyz#18661)
  chore(node): simplify EngineApiExt bounds by removing redundant constraints (paradigmxyz#18905)
  fix(trie): Reveal extension child when extension is last remaining child of a branch (paradigmxyz#18891)
  chore: make clippy happy (paradigmxyz#18900)
  chore: relax `ChainSpec` impls (paradigmxyz#18894)
  refactor: eliminate redundant allocation in precompile cache example (paradigmxyz#18886)
  fix(era-utils): fix off-by-one for Excluded end bound in process_iter (paradigmxyz#18731)
  docs: yellowpaper sections in consensus implementation (paradigmxyz#18881)
  feat(storage): read headers and transactions only from static files (paradigmxyz#18788)
  feat: Use generic `HeaderTy` for `reth db get static-file headers` (paradigmxyz#18870)
  fix: streamline payload conversion in custom engine API (paradigmxyz#18864)
  ...
theochap pushed a commit to theochap/reth that referenced this pull request Oct 13, 2025
mattsse pushed a commit that referenced this pull request Oct 14, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cli Related to the reth CLI A-static-files Related to static files C-enhancement New feature or request

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants