Skip to content

Use shared types / prepare for glamsterdam - #46

Closed
yoshidan wants to merge 1 commit into
mainfrom
feature/use_shared_types
Closed

yoshidan wants to merge 1 commit into
mainfrom
feature/use_shared_types

Conversation

@yoshidan

@yoshidan yoshidan commented Jul 9, 2026 •

Copy link
Copy Markdown
Collaborator

Changes

  • Bump optimism-derivation (optimism-elc) to the revision that uses shared ethereum-light-client-types
  • Stop relying on block_number in the light client header: only block_hash is
    taken from the beacon API, and the block number is fetched from the L1 execution
    node via eth_getBlockByHash (prepare for glamsteram)
  • Bump devnet to v1.4.1, lodestar to v1.44.0

- Bump optimism-derivation (optimism-elc) to the revision that uses shared ethereum-light-client-types
- Stop relying on block_number in the light client header: fetch it from the L1 execution node via eth_getBlockByHash (new L1Client)
- Bump devnet to v1.4.1, lodestar to v1.44.0

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Signed-off-by: Naohiro Yoshida <naohiro.yoshida@datachain.jp>
@yoshidan yoshidan changed the title Use shared types Use shared types / prepare for glamsterdam Jul 9, 2026
@yoshidan
yoshidan requested a review from Copilot July 9, 2026 11:50

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

This PR updates the server to rely on the shared light-client types and prepares for “glamsterdam” by no longer trusting block_number from the beacon light-client header, instead deriving it from the L1 execution node via eth_getBlockByHash.

Changes:

  • Updates light-client header handling to use execution_block_hash and fetches L1 block numbers from an L1 JSON-RPC client.
  • Introduces an L1Client abstraction plus HttpL1Client, wires it into PreimageCollector, and extends tests accordingly.
  • Bumps optimism-derivation revision and CI devnet/lodestar versions.

Reviewed changes

Copilot reviewed 8 out of 9 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
server/tests/e2e.rs Updates assertions to the new execution_block_hash field.
server/src/main.rs Constructs and injects the new HttpL1Client into the collector.
server/src/collector.rs Uses L1 JSON-RPC to resolve block numbers by hash; updates logs and tests with MockL1Client.
server/src/client/mod.rs Exposes the new l1_client module.
server/src/client/l1_client.rs Adds L1Client trait + HttpL1Client JSON-RPC implementation.
server/src/client/beacon_client.rs Updates LightClientHeader to deserialize only the execution block hash.
server/Cargo.toml Pins optimism-derivation to the new git revision.
Cargo.lock Updates lockfile for bumped dependencies.
.github/workflows/ci.yaml Bumps devnet and lodestar versions for CI.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment on lines +73 to +79
if !response.status().is_success() {
return Err(anyhow::anyhow!(
"Request failed with status: {} body={:?}",
response.status(),
response.text().await
));
}
let request_body = serde_json::json!({
"jsonrpc": "2.0",
"method": "eth_getBlockByHash",
"params": [format!("{:?}", hash), false],
}

#[derive(Debug, Clone, serde::Deserialize)]
/// LightClientHeader where `execution.block_hash` contains the block hash.
@yoshidan yoshidan closed this Jul 9, 2026
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.

2 participants