Repository navigation
feat: run miner integration tests with Curio #7836
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
sudo-shashank
wants to merge
5
commits into
main
Choose a base branch
from
shashank/run-with-curio
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| LOTUS_IMAGE=filecoin/lotus-all-in-one:v1.38.3-2k | ||
| # Curio rejects chain nodes whose network name does not start with local or test. | ||
| NETWORK_NAME=localnet | ||
| FOREST_DATA_DIR=/forest_data | ||
| LOTUS_DATA_DIR=/lotus_data | ||
| FIL_PROOFS_PARAMETER_CACHE=/var/tmp/filecoin-proof-parameters | ||
| MINER_ACTOR_ADDRESS=t01000 | ||
| MINER_BACKEND=curio | ||
| LOTUS_RPC_PORT=1234 | ||
| LOTUS_P2P_PORT=1235 | ||
| # Unused here; compose interpolates the extended forest-miner file which references it. | ||
| MINER_RPC_PORT=2345 | ||
| FOREST_RPC_PORT=3456 | ||
| FOREST_P2P_PORT=4903 | ||
| CURIO_COMMIT=v1.29.0 | ||
| CURIO_REPO_PATH=/var/lib/curio | ||
| YUGABYTE_IMAGE=yugabytedb/yugabyte:2025.2.2.2-b11@sha256:1fdda2ae928facf0b7b25b7c1183c540567c33730cce10a557c81c33a8e18422 |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| # Forest-produced devnet (Curio seals and mines) | ||
|
|
||
| Same chain topology as [`../devnet-forest-miner`](../devnet-forest-miner), with Curio in place of Lotus Miner: | ||
|
|
||
| | | this stack | | ||
| | --------------- | ---------------------- | | ||
| | Block producer | **Forest** + **Curio** | | ||
| | Validating node | Lotus | | ||
| | HarmonyDB | Yugabyte | | ||
|
|
||
| `NETWORK_NAME=localnet` — Curio rejects names that do not start with `local` or `test`. Upgrade heights are shared via [`../devnet/upgrade_heights.env`](../devnet/upgrade_heights.env) (a plain `2k` Curio binary assumes the wrong genesis schedule). | ||
|
|
||
| `setup.sh` builds `forest/curio-devnet:<CURIO_COMMIT>` once from that release tag (about 15 minutes) and reuses it afterward. | ||
|
|
||
| ```shell | ||
| mise run test:devnet:miner:curio | ||
| ``` |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,21 @@ | ||
| #!/bin/bash | ||
| # Build forest/curio-devnet:${CURIO_COMMIT} when that tag is missing. | ||
| set -euo pipefail | ||
|
|
||
| PARENT_PATH=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) | ||
| # shellcheck source=/dev/null | ||
| source "${PARENT_PATH}/.env" | ||
|
|
||
| IMAGE="forest/curio-devnet:${CURIO_COMMIT}" | ||
| if docker image inspect "${IMAGE}" >/dev/null 2>&1; then | ||
| echo "Using existing ${IMAGE}" | ||
| exit 0 | ||
| fi | ||
|
|
||
| echo "Building ${IMAGE} (linux/amd64) ..." | ||
| docker build \ | ||
| --platform linux/amd64 \ | ||
| --build-arg "CURIO_COMMIT=${CURIO_COMMIT}" \ | ||
| -f "${PARENT_PATH}/curio.dockerfile" \ | ||
| -t "${IMAGE}" \ | ||
| "${PARENT_PATH}" |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| #!/bin/bash | ||
| # Forest + Lotus past TARGET_HEIGHT (Curio mining via Forest). | ||
|
|
||
| set -eu | ||
|
|
||
| PARENT_PATH=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd) | ||
| pushd "${PARENT_PATH}" | ||
| set -a | ||
| # shellcheck source=/dev/null | ||
| source .env | ||
| # shellcheck source=/dev/null | ||
| source "${PARENT_PATH}/../devnet/upgrade_heights.env" | ||
| set +a | ||
| # shellcheck source=/dev/null | ||
| source "${PARENT_PATH}/../devnet/chain_height.sh" | ||
|
|
||
| wait_forest_and_lotus_past_target "Lotus validated Forest/Curio-produced blocks" "$(check_timeout_secs)" | ||
|
|
||
| popd |
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,58 @@ | ||
| # Curio 2k image for the Forest-produced Curio devnet. Tags and GOAMD64 must be | ||
| # set explicitly: Curio's Dockerfile clears CURIO_TAGS, and its Makefile hardcodes | ||
| # GOAMD64=v3 which SIGILLs under QEMU. | ||
| ARG CURIO_COMMIT | ||
| FROM rust:1.86.0-slim-bookworm AS rust-toolchain | ||
|
|
||
| FROM golang:1.26-trixie AS curio-builder | ||
| SHELL ["/bin/bash", "-o", "pipefail", "-c"] | ||
| ARG CURIO_COMMIT | ||
| RUN test -n "$CURIO_COMMIT" | ||
|
|
||
| RUN apt-get update && \ | ||
| apt-get install --no-install-recommends -y ca-certificates build-essential clang \ | ||
| ocl-icd-opencl-dev ocl-icd-libopencl1 jq libhwloc-dev git && \ | ||
| rm -rf /var/lib/apt/lists/* | ||
|
|
||
| COPY --from=rust-toolchain /usr/local/cargo /usr/local/cargo | ||
| COPY --from=rust-toolchain /usr/local/rustup /usr/local/rustup | ||
| ENV RUSTUP_HOME=/usr/local/rustup \ | ||
| CARGO_HOME=/usr/local/cargo \ | ||
| PATH=/usr/local/cargo/bin:$PATH | ||
|
|
||
| WORKDIR /opt/curio | ||
| RUN git clone https://github.com/filecoin-project/curio.git . && \ | ||
| git checkout "$CURIO_COMMIT" && \ | ||
| git submodule update --init | ||
|
|
||
| # Portable BLST so the binary runs under QEMU; rewrite GOAMD64=v3 -> v1. | ||
| RUN sed -i 's/GOAMD64=v3/GOAMD64=v1/g' scripts/makefiles/30-build.mk | ||
|
|
||
| ENV FFI_USE_OPENCL=1 \ | ||
| CURIO_TAGS="cunative nosupraseal 2k" \ | ||
| CGO_CFLAGS_ALLOW="-D__BLST_PORTABLE__" \ | ||
| CGO_CFLAGS="-D__BLST_PORTABLE__" \ | ||
| FFI_USE_BLST_PORTABLE=1 \ | ||
| FFI_USE_GPU=0 | ||
|
|
||
| RUN make clean deps && make build && strip curio sptool | ||
|
|
||
| FROM ubuntu:24.04 | ||
| RUN apt-get update && \ | ||
| apt-get install --no-install-recommends -y ca-certificates curl jq dnsutils && \ | ||
| rm -rf /var/lib/apt/lists/* | ||
|
|
||
| COPY --from=curio-builder /etc/ssl/certs /etc/ssl/certs | ||
| COPY --from=curio-builder /lib/*/libdl.so.2 /lib/ | ||
| COPY --from=curio-builder /lib/*/librt.so.1 /lib/ | ||
| COPY --from=curio-builder /lib/*/libgcc_s.so.1 /lib/ | ||
| COPY --from=curio-builder /lib/*/libutil.so.1 /lib/ | ||
| COPY --from=curio-builder /usr/lib/*/libltdl.so.7 /lib/ | ||
| COPY --from=curio-builder /usr/lib/*/libnuma.so.1 /lib/ | ||
| COPY --from=curio-builder /usr/lib/*/libhwloc.so.* /lib/ | ||
| COPY --from=curio-builder /usr/lib/*/libOpenCL.so.1 /lib/ | ||
| COPY --from=curio-builder /opt/curio/curio /opt/curio/sptool /usr/local/bin/ | ||
|
|
||
| RUN curio --version && ! command -v lotus-miner | ||
|
|
||
| CMD ["/bin/bash"] |
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.