fix: stop appending endpoint path to checkpoint sync URL#148
fix: stop appending endpoint path to checkpoint sync URL#148MegaRedHand merged 1 commit intomainfrom
Conversation
The --checkpoint-sync-url flag now expects the complete URL (e.g., http://peer:5052/lean/v0/states/finalized) instead of a base URL with /lean/v0/states/finalized appended automatically. This decouples the CLI from a specific API path convention, making it work with any checkpoint provider regardless of endpoint layout.
🤖 Kimi Code ReviewReview SummaryThe PR makes checkpoint sync URL handling more flexible by removing the hardcoded Issues Found1. Breaking Change Without Backward Compatibility (checkpoint_sync.rs:68-75)The removal of automatic path suffixing breaks existing deployments that expect to provide just the base URL. Consider:
2. Missing URL Validation (checkpoint_sync.rs:68)The function now accepts any URL without validating it contains the expected endpoint. Add validation: if !url.ends_with("/lean/v0/states/finalized") {
return Err(CheckpointSyncError::InvalidUrl(
"URL must point to /lean/v0/states/finalized endpoint".to_string()
));
}3. Documentation Inconsistency (docs/checkpoint_sync.md:29)The documentation states "Any running node that serves the finalized state as SSZ can be used" but then immediately specifies the ethlambda endpoint. This could be clearer - explicitly state that non-ethlambda nodes must expose their finalized state at the same endpoint path. 4. Potential Security Issue (checkpoint_sync.rs:68)With full URL control, users could accidentally point to:
5. CLI Help Text Could Be More Explicit (main.rs:50)The help text mentions the ethlambda endpoint but doesn't clearly state this is required for ethlambda peers. Consider: /// URL to download checkpoint state from (e.g., http://peer:5052/lean/v0/states/finalized)
/// Must serve SSZ-encoded finalized state at this exact path.
Minor Suggestions
Automated review by Kimi (Moonshot AI) · custom prompt |
🤖 Codex Code ReviewOverall looks fine; the change is small and aligns docs/help with behavior. One correctness/UX concern to consider. Findings:
No other correctness, security, or performance issues spotted in this diff. Automated review by OpenAI Codex · custom prompt |
Greptile SummaryThis PR refactors the checkpoint sync URL handling to require the full endpoint URL instead of automatically appending Changes:
Impact:
Confidence Score: 5/5
|
| Filename | Overview |
|---|---|
| bin/ethlambda/src/checkpoint_sync.rs | Simplified fetch_checkpoint_state to accept full URL instead of base URL, removing path construction logic |
| bin/ethlambda/src/main.rs | Updated CLI documentation to clarify that full URL is required including the endpoint path |
| docs/checkpoint_sync.md | Updated documentation to reflect that any SSZ-serving node can be used, with endpoint path specified by the provider |
Last reviewed commit: edf5722
🤖 Claude Code ReviewNow I have a complete picture of the PR. Here is my review: PR Review: refactor: stop appending endpoint path to checkpoint sync URLSummaryA small, focused refactor. The implementation is clean and correct. My notes below, roughly ordered by importance. Breaking Change — Not FlaggedThis is a breaking CLI change. Any deployment or script using the old format: will now silently make a GET to The PR description calls this out, but there's no migration hint in the docs or CLI help. It's worth adding a note to the Trailing-Slash RegressionThe old code had they get a 404 from the server instead of a graceful error. The fix is trivial if desired: let url = url.trim_end_matches('/');Not a blocker, but a usability regression worth noting. URL Validity Error QualityThere's no validation that the string is a parseable URL before making the request. If someone passes a typo like Counter to the Kimi review: Adding Code QualityThe actual code changes are clean:
Docs
Test CoverageThe test plan has Bottom LineThe refactor logic is correct and the motivation is valid. The two things worth resolving before merge:
Everything else is minor. Automated review by Claude (Anthropic) · custom prompt |
## Summary - `--checkpoint-sync-url` now expects the full URL (e.g., `http://peer:5052/lean/v0/states/finalized`) instead of just the base URL with `/lean/v0/states/finalized` appended automatically - Decouples the CLI from a specific API path convention, so it works with any checkpoint provider regardless of endpoint layout ## Test plan - [x] `cargo check` passes - [ ] Verify checkpoint sync works end-to-end with the full URL in a devnet
Summary
--checkpoint-sync-urlnow expects the full URL (e.g.,http://peer:5052/lean/v0/states/finalized) instead of just the base URL with/lean/v0/states/finalizedappended automaticallyTest plan
cargo checkpasses