Skip to content

Inbound ReqResp serving is never wired into the running node #1192

Description

@adust09

On main (0f5b8e5), RequestHandler's block lookup callbacks are never assigned outside of tests, so a running node cannot serve BlocksByRoot or BlocksByRange.

The three callbacks

Callback Declared Wired in src/?
block_by_slot_lookup handler.py#L179 No — assigned only in test_handler.py
block_lookup (by root) handler.py#L176 Noset_block_lookup exists but its only caller is test_live.py#L144
current_slot_lookup handler.py#L182 Yes — from run.py#L111

LiveEventSource has no set_block_by_slot_lookup — the string by_slot does not occur in live.py at all.

Consequence

handle_blocks_by_range always takes its first branch and replies SERVER_ERROR:

if self.block_by_slot_lookup is None:
logger.warning("BlocksByRange request received but no block_by_slot_lookup configured")
await response.send_error(ResponseCode.SERVER_ERROR, "Block lookup not available")
return

Meanwhile the client side is wired into the production path:

BackfillSync.request_blocks_by_rangeSyncServiceNode

So a leanSpec node issues range requests that no other leanSpec node can answer, and backfill sync between two of them cannot complete.

Note

The material for the by-root lookup already exists — signed_block_for_root reads from sync_service.store.blocks, but is passed only to ApiServer, not to the ReqResp handler.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions