Skip to content

Fix getLightClientProofByL1Height to use hex serialized alloy::U64#2544

Closed
Copilot wants to merge 1 commit intonightlyfrom
copilot/fix-2509
Closed

Fix getLightClientProofByL1Height to use hex serialized alloy::U64#2544
Copilot wants to merge 1 commit intonightlyfrom
copilot/fix-2509

Conversation

Copy link
Contributor

Copilot AI commented Jul 7, 2025

The getLightClientProofByL1Height RPC method was using a regular u64 parameter instead of hex-serialized alloy::U64, making it inconsistent with other RPC methods in the codebase and Ethereum JSON-RPC standards.

Changes Made

  • Added alloy_primitives::U64 import to the light client prover RPC module
  • Updated the trait method signature from l1_height: u64 to l1_height: U64
  • Updated the implementation to convert U64 to u64 using the .to() method when calling the database layer
  • Ensured compatibility with existing test code through automatic type conversion

Before

async fn get_light_client_proof_by_l1_height(
    &self,
    l1_height: u64,  // Plain u64 - no hex serialization
) -> RpcResult<Option<LightClientProofResponse>>;

After

async fn get_light_client_proof_by_l1_height(
    &self,
    l1_height: U64,  // alloy::U64 - proper hex serialization
) -> RpcResult<Option<LightClientProofResponse>>;

This change ensures the method follows the same pattern as other RPC methods like get_sequencer_commitments_on_slot_by_number, get_verified_batch_proofs_by_slot_height, and get_l2_block_by_number, which all use alloy_primitives::U64 for height parameters to provide proper JSON-RPC hex serialization (e.g., "0x1a2b" instead of decimal 6827).

Fixes #2509.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

@eyusufatik eyusufatik closed this Jul 7, 2025
Copilot AI changed the title [WIP] getLightClientProofByL1Height uses U64 Fix getLightClientProofByL1Height to use hex serialized alloy::U64 Jul 7, 2025
Copilot AI requested a review from eyusufatik July 7, 2025 11:48
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.

getLightClientProofByL1Height uses U64

2 participants