Repository navigation
Conversation
- 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>
There was a problem hiding this comment.
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_hashand fetches L1 block numbers from an L1 JSON-RPC client. - Introduces an
L1Clientabstraction plusHttpL1Client, wires it intoPreimageCollector, and extends tests accordingly. - Bumps
optimism-derivationrevision 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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Changes
optimism-derivation(optimism-elc) to the revision that uses sharedethereum-light-client-typesblock_numberin the light client header: onlyblock_hashistaken from the beacon API, and the block number is fetched from the L1 execution
node via
eth_getBlockByHash(prepare for glamsteram)