feat(docker): add checkpoint-sync node image and CI#1940
Conversation
|
Commit: beddfd3 SP1 Execution Results
|
Codecov Report✅ All modified and coverable lines are covered by tests. @@ Coverage Diff @@
## main #1940 +/- ##
==========================================
- Coverage 84.42% 84.41% -0.01%
==========================================
Files 637 637
Lines 76805 76805
==========================================
- Hits 64840 64838 -2
- Misses 11965 11967 +2
Flags with carried forward coverage won't be shown. Click here to find out more.
... and 4 files with indirect coverage changes 🚀 New features to boost your workflow:
|
| # Patch rollup-params.json: update genesis_l1_view.blk | ||
| PATCHED_PARAMS="/app/data/rollup-params.json" | ||
| jq --argjson h "${TIP_HEIGHT}" --arg id "${TIP_HASH}" \ | ||
| '.genesis_l1_view.blk.height = $h | .genesis_l1_view.blk.blkid = $id' \ | ||
| "${PARAM_PATH}" > "${PATCHED_PARAMS}" | ||
| PARAM_PATH="${PATCHED_PARAMS}" | ||
|
|
||
| # Patch ol-params.json if provided | ||
| if [ -n "${OL_PARAMS_PATH}" ] && [ -f "${OL_PARAMS_PATH}" ]; then | ||
| PATCHED_OL="/app/data/ol-params.json" | ||
| jq --argjson h "${TIP_HEIGHT}" --arg id "${TIP_HASH}" \ | ||
| '.last_l1_block.height = $h | .last_l1_block.blkid = $id' \ | ||
| "${OL_PARAMS_PATH}" > "${PATCHED_OL}" | ||
| OL_PARAMS_PATH="${PATCHED_OL}" | ||
| fi | ||
|
|
||
| # Patch asm-params.json if provided | ||
| if [ -n "${ASM_PARAMS_PATH}" ] && [ -f "${ASM_PARAMS_PATH}" ]; then | ||
| PATCHED_ASM="/app/data/asm-params.json" | ||
| jq --argjson h "${TIP_HEIGHT}" --arg id "${TIP_HASH}" \ | ||
| '.l1_view.blk.height = $h | .l1_view.blk.blkid = $id' \ | ||
| "${ASM_PARAMS_PATH}" > "${PATCHED_ASM}" | ||
| ASM_PARAMS_PATH="${PATCHED_ASM}" | ||
| fi |
There was a problem hiding this comment.
@bewakes lets not patch params here because OL genesis blk ID is a function of L1 genesis height, blkid, ... so that must be recomputed and injected in asm-params. Its easier to expect correct params must be loaded.
| elif [ "${CURRENT_GENESIS_HEIGHT}" -gt 0 ]; then | ||
| echo "genesis height is ${CURRENT_GENESIS_HEIGHT} — params already initialized, skipping patching" | ||
| fi |
There was a problem hiding this comment.
We may not neeed this with above assumption.
| # Checkpoint-sync (non-sequencer) node. Reconstructs OL state from L1-buried | ||
| # checkpoints. Built without the sequencer feature; reuses the sequencer's | ||
| # generated params and the same bitcoind. | ||
| strata-checkpoint-sync: | ||
| build: | ||
| context: .. | ||
| dockerfile: docker/strata-checkpoint-sync/Dockerfile | ||
| image: strata-checkpoint-sync:latest | ||
| env_file: | ||
| - .env | ||
| environment: | ||
| CONFIG_PATH: /app/configs/config.sync.toml | ||
| PARAM_PATH: /app/configs/generated/rollup-params.json | ||
| OL_PARAMS_PATH: /app/configs/generated/ol-params.json | ||
| ASM_PARAMS_PATH: /app/configs/generated/asm-params.json | ||
| RUST_BACKTRACE: 1 | ||
| volumes: | ||
| # Committed config: | ||
| - ./configs/config.sync.toml:/app/configs/config.sync.toml:ro | ||
| # Generated by init: | ||
| - ./configs/generated/rollup-params.json:/app/configs/generated/rollup-params.json:ro | ||
| - ./configs/generated/ol-params.json:/app/configs/generated/ol-params.json:ro | ||
| - ./configs/generated/asm-params.json:/app/configs/generated/asm-params.json:ro | ||
| - strata-checkpoint-sync-data:/app/data | ||
| ports: | ||
| - "8433:8432" | ||
| - "9616:9615" | ||
| networks: | ||
| - alpen_network | ||
| entrypoint: ["/usr/local/bin/entrypoint.sh"] | ||
| healthcheck: | ||
| test: ["CMD-SHELL", "curl -sf http://localhost:8080/healthz"] | ||
| interval: 5s | ||
| timeout: 5s | ||
| retries: 30 | ||
| start_period: 10s |
There was a problem hiding this comment.
I think checkpoint sync node should not be placed in this file because it only depends on a bitcoin chain so its better to separate it out.
| [exec.reth] | ||
| rpc_url = "reth:8551" | ||
| secret = "configs/jwt.hex" |
There was a problem hiding this comment.
This is misleading for checkpoint sync node. If these are non-optional then lets add a ticket to clean this up later.
| admin_rpc_host = "0.0.0.0" | ||
| admin_rpc_port = 8434 | ||
| admin_rpc_bearer_token = "dev-only-change-me" |
There was a problem hiding this comment.
These should be removed from here as checkpoint-sync won't need it and it either has defaults or is optional?
| RUN --mount=type=cache,target=/usr/local/cargo/git \ | ||
| --mount=type=cache,target=/usr/local/cargo/registry \ | ||
| --mount=type=cache,sharing=private,target=/app/target \ | ||
| cargo chef cook --release --recipe-path recipe.json |
There was a problem hiding this comment.
We may not need to cook non-default dependencies.
Description
This PR creates a new docker config for checkpoint sync node. This is done by passing
--no-default-featureswhile building strata as default feature issequencerand we don't want that for a checkpoint sync node.AI Usage
This is created by using claude code I request to have more eyes on this.
Type of Change
Notes to Reviewers
Is this PR addressing any specification, design doc or external reference document?
If yes, please add relevant links:
Checklist
Related Issues