Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .config/forest.dic
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
303
304
ABI
Algorand/M
API's
Expand Down Expand Up @@ -64,6 +64,7 @@ coreos
CPUs
cron
crypto
Curio
daemon
daemonize
Datacap
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lotus-api-bump.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ jobs:
for env in ./scripts/tests/api_compare/.env ./scripts/tests/bootstrapper/.env ./scripts/tests/snapshot_parity/.env; do
sed -i "s/\(LOTUS_IMAGE=filecoin.*\):.*/\1:$TAG-calibnet/" "$env"
done
for env in ./scripts/devnet/.env ./scripts/devnet-forest-miner/.env; do
for env in ./scripts/devnet/.env ./scripts/devnet-forest-miner/.env ./scripts/devnet-forest-curio/.env; do
sed -i "s/\(LOTUS_IMAGE=filecoin.*\):.*/\1:$TAG-2k/" "$env"
done
else
Expand Down
19 changes: 11 additions & 8 deletions .github/workflows/miner-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,18 +77,21 @@ jobs:
if-no-files-found: error

miner-tests:
name: Miner integration tests (${{ matrix.group }})
name: Miner integration tests (${{ matrix.devnet }}, ${{ matrix.group }})
needs: build
runs-on: ubuntu-24.04
strategy:
fail-fast: false
matrix:
# The `forest-dev devnet miner --group` values. Add groups as more Lotus itests are ported.
# Add groups as more Lotus itests are ported.
group: [onboarding]
devnet: [devnet-forest-miner, devnet-forest-curio]
env:
# We use a custom Dockerfile for CI to speed up the build process.
FOREST_DOCKERFILE_OVERRIDE: scripts/devnet/forest_ci.dockerfile
MINER_TEST_GROUP: ${{ matrix.group }}
DEVNET_DIR: scripts/${{ matrix.devnet }}
SCRIPT_TIMEOUT_MINUTES: 90
steps:
- uses: actions/cache@v6
id: cache
Expand All @@ -98,9 +101,9 @@ jobs:
- name: Load cache into volume
if: steps.cache.outputs.cache-hit == 'true'
run: |
docker volume create devnet-forest-miner_filecoin-proofs
docker volume create "${{ matrix.devnet }}_filecoin-proofs"
docker run --rm \
-v devnet-forest-miner_filecoin-proofs:/proofs \
-v "${{ matrix.devnet }}_filecoin-proofs":/proofs \
-v "$FIL_PROOFS_PARAMETER_CACHE":/cache \
"$SHELL_IMAGE" \
sh -c "cp /cache/* /proofs"
Expand All @@ -111,10 +114,10 @@ jobs:
with:
name: "forest-${{ runner.os }}"
- name: Devnet setup
run: ./scripts/devnet-forest-miner/setup.sh
run: ./${{ env.DEVNET_DIR }}/setup.sh
timeout-minutes: ${{ fromJSON(env.SCRIPT_TIMEOUT_MINUTES) }}
- name: Devnet check
run: ./scripts/devnet-forest-miner/check.sh
run: ./${{ env.DEVNET_DIR }}/check.sh
timeout-minutes: ${{ fromJSON(env.SCRIPT_TIMEOUT_MINUTES) }}
- name: Add forest binaries to PATH
run: |
Expand All @@ -123,7 +126,7 @@ jobs:
- name: Miner tests
run: |
set -euo pipefail
export DEVNET_DIR=scripts/devnet-forest-miner
export DEVNET_DIR="${{ env.DEVNET_DIR }}"
source ./scripts/devnet/test_harness.sh
devnet_test_env_init
forest-dev devnet miner --group "$MINER_TEST_GROUP"
Expand All @@ -135,7 +138,7 @@ jobs:
if: steps.cache.outputs.cache-hit != 'true'
run: |
docker run --rm \
-v devnet-forest-miner_filecoin-proofs:/proofs \
-v "${{ matrix.devnet }}_filecoin-proofs":/proofs \
-v "$FIL_PROOFS_PARAMETER_CACHE":/cache \
"$SHELL_IMAGE" \
sh -c "cp /proofs/* /cache"
Expand Down
11 changes: 8 additions & 3 deletions docs/docs/users/guides/running_with_curio.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@ title: Running Forest With Curio
sidebar_position: 99
---

:::note
[Curio](https://curiostorage.org/) is the successor to Lotus Miner. Forest can act as Curio's chain node (the same "Forest, Curio, YugabyteDB" layout Curio documents).

[Curio](https://curiostorage.org/) is the successor to Lotus-miner under active development by Curio Storage Inc. Compatibility with Forest is not yet confirmed.
Verified on the local stack in [`scripts/devnet-forest-curio`](https://github.com/ChainSafe/forest/tree/main/scripts/devnet-forest-curio) against **Curio v1.29.0**:

:::
- Put an admin token in `FULLNODE_API_INFO` and keep the miner worker key in Forest's wallet (`MinerCreateBlock` and message signing use it).
Comment thread
sudo-shashank marked this conversation as resolved.
Resolved
- On a private network, the genesis name must start with `local` or `test` (Curio drops other chain nodes). The stack uses `localnet`.

```shell
mise run test:devnet:miner:curio
```
4 changes: 2 additions & 2 deletions docs/docs/users/reference/cli.md

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 6 additions & 2 deletions mise.toml
Original file line number Diff line number Diff line change
Expand Up @@ -249,10 +249,14 @@ run = "scripts/devnet/with_devnet.sh scripts/devnet devnet_integration_tests"
description = "Run the integration test suites against the Forest-produced local docker devnet."
run = "scripts/devnet/with_devnet.sh scripts/devnet-forest-miner devnet_integration_tests"

[tasks."test:devnet:miner"]
description = "Run the Lotus Miner integration tests against the Forest-produced local docker devnet."
[tasks."test:devnet:miner:lotus"]
description = "Run the Miner integration tests against the Forest-produced local docker devnet with Lotus Miner."
run = "scripts/devnet/with_devnet.sh scripts/devnet-forest-miner forest-dev devnet miner"

[tasks."test:devnet:miner:curio"]
description = "Run the Miner integration tests against the Forest-produced local docker devnet with Curio."
run = "scripts/devnet/with_devnet.sh scripts/devnet-forest-curio forest-dev devnet miner"

[tasks."codecov:nextest"]
description = "Run codecov with nextest"
run = '''
Expand Down
17 changes: 17 additions & 0 deletions scripts/devnet-forest-curio/.env
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
17 changes: 17 additions & 0 deletions scripts/devnet-forest-curio/README.md
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
```
21 changes: 21 additions & 0 deletions scripts/devnet-forest-curio/build_image.sh
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}"
19 changes: 19 additions & 0 deletions scripts/devnet-forest-curio/check.sh
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
58 changes: 58 additions & 0 deletions scripts/devnet-forest-curio/curio.dockerfile
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"]
Loading
Loading