Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
25d6599
feat(bitvm-gc): raise regtest connector_z to 60 and add the peg-in ab…
Oct 6, 2026
2a6e16a
feat: add persistent engine tables
Oct 13, 2026
c21b809
feat: add execution engine
Oct 13, 2026
4a2858a
feat: integrate engine and instance state machine
Oct 13, 2026
b25eca0
docs: add instance lifecycle model and state diagram
Oct 13, 2026
e7020e8
feat: add graph slot constraints and signing authorization
Oct 13, 2026
1844b7d
feat: add GetGraph protocol and serving limits
Oct 13, 2026
eebb89a
feat: run graph state machine on engine
Oct 13, 2026
266a742
feat: move pegout handling to graph state machine
Oct 13, 2026
676985d
feat: move pegin handling to instance state machine
Oct 13, 2026
3bfe900
refactor: remove legacy message queues
Oct 13, 2026
10128fc
refactor: keep replay protection in memory
Oct 13, 2026
9da7c37
refactor: persist registered peer messages and use NodeInfo for disco…
Oct 13, 2026
89750b8
fix: per-action poison backoff, cancelled job sweep and lease renewal…
Oct 14, 2026
88afee7
fix: keep the committee candidate scan off the verifier-set claim and…
Oct 14, 2026
824a101
fix: relayer withdraw jobs wait out Goat lag, per-branch NACK, verifi…
Oct 14, 2026
06b5bda
fix: release an abandoned built graph's session, classify job failure…
Oct 14, 2026
7adf3d6
fix: skip mint events without an instance row, report a late confirm …
Oct 14, 2026
9f54767
fix: GetGraph requests name the copy they need and the protocol moves…
Oct 14, 2026
063464e
chore: remove dead code left by the refactor and the unused proof tab…
Oct 14, 2026
74888ee
chore: squash the migrations into one baseline schema and drop the un…
Oct 14, 2026
83033d5
refactor: rename helpers and jobs after what they do
Oct 14, 2026
6ca725f
refactor: remove duplicated and roundabout logic in the jobs, scans a…
Oct 14, 2026
f87fce5
refactor: move the shared aggregate messages, probes and job helpers …
Oct 14, 2026
f8e59e0
refactor: split p2p_admission into a directory of limits, registry, r…
Oct 14, 2026
3199548
refactor: split store localdb into a directory of instance, graph, no…
Oct 14, 2026
2fda0db
refactor: split utils into a directory of chain, store, validation, p…
Oct 14, 2026
d3327c7
refactor: move current_time_secs out of rpc_service into a clock module
Oct 14, 2026
e68c98f
refactor: rename handle.rs to control.rs after the control messages i…
Oct 14, 2026
287476e
refactor: move the peg-in request monitor into instance_scan and the …
Oct 14, 2026
0697d38
refactor: rename action.rs to messages.rs and move the gossip entry, …
Oct 14, 2026
cbbcf9c
refactor: split the event watch task into a directory with the gatewa…
Oct 14, 2026
b6628a2
refactor: move the rpc_service and store engine test modules into the…
Oct 14, 2026
a8f8ddc
fix: log re-enqueues of finished engine jobs at debug
Oct 14, 2026
9d9b819
fix: skip verifier setup work for a failed instance and log the verif…
Oct 14, 2026
f828959
fix: give the proof-builder HTTP client timeouts and retry gateway er…
Oct 15, 2026
becadee
fix: log the error of a failed or retried job attempt
Oct 15, 2026
9f8257a
fix: retry the Goat RPC at boot instead of panicking at once
Oct 15, 2026
9871971
fix: redial a bootnode after its last connection closes
Oct 15, 2026
18ca1ef
fix: defer the maintenance tick when the history-sync check fails ins…
Oct 15, 2026
2d5b936
feat: track backend availability as one signal and serve GET /v1/health
Oct 15, 2026
a1a3c47
fix: keep idle event-watch ranges and RPC lookups of unknown ids out …
Oct 15, 2026
c4c4b55
feat: add read-only ops scripts for node triage, log queries and id t…
Oct 15, 2026
9d3ef35
docs: describe the health route, backend availability signal, client …
Oct 15, 2026
ae38631
feat: add the mock-gc feature and the mock proof builder
Oct 16, 2026
9dac900
feat: make the p2p listen interface configurable
Oct 16, 2026
7b398b2
feat: add the rpc-sign helper for signed debug routes
Oct 16, 2026
5eeff71
feat: add the in-repo localnet and its e2e suite
Oct 20, 2026
cfa614d
feat: run the localnet e2e suite on the self-hosted runner after push…
Oct 20, 2026
2d2ce40
fix: restore the proof storage and tables that proof-builder-rpc stil…
Oct 20, 2026
b5486ea
fix: drop the compromised emSign G3 root and distrust its intermediat…
Oct 22, 2026
354e2e5
fix: run one history sync per contract and wait instead of spinning w…
Oct 22, 2026
58c16ab
Merge dev into refactor
Oct 27, 2026
a2c2a6a
fix: pin the Ziren toolchain version in CI
Oct 27, 2026
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
33 changes: 26 additions & 7 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ on:

env:
CARGO_TERM_COLOR: always
ZKM_TOOLCHAIN_VERSION: '20260917'

concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
Expand Down Expand Up @@ -61,6 +62,7 @@ jobs:
java -jar "$JAR" -config GraphLifecycleFixed.cfg GraphLifecycle.tla
java -jar "$JAR" -config GraphLifecycleFineGrainedFixed.cfg GraphLifecycleFineGrainedFixed.tla
java -jar "$JAR" -config InstancePresignedFixed.cfg InstancePresigned.tla
java -jar "$JAR" -config InstanceLifecycle.cfg InstanceLifecycle.tla
java -jar "$JAR" -config Take2DisproveRace.cfg Take2DisproveRace.tla
java -jar "$JAR" -config MultiActorRace.cfg MultiActorRace.tla
java -jar "$JAR" -config InstanceBridgeOutRaceFixed.cfg InstanceBridgeOutRace.tla
Expand Down Expand Up @@ -141,10 +143,21 @@ jobs:
timeout-minutes: 30
with:
profile: minimal
toolchain: nightly-2025-12-11
toolchain: nightly-2026-09-17
override: true
components: clippy
- run: curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/ProjectZKM/toolchain/refs/heads/main/setup.sh | sh
- name: Install Ziren toolchain
run: |
set -euo pipefail
installer="$RUNNER_TEMP/zkmup"
curl --proto '=https' --tlsv1.2 -fsSL --retry 3 \
https://raw.githubusercontent.com/ProjectZKM/toolchain/582f7927cac0668883a86cbd02fbc18b500b1b6f/zkmup \
-o "$installer"
sh "$installer" install -v "$ZKM_TOOLCHAIN_VERSION"
SHELL=/bin/true sh "$installer" setup -v "$ZKM_TOOLCHAIN_VERSION"
source "$HOME/.zkm-toolchain/env"
rustc --version
cargo --version
- name: Install Dependencies
run: sudo apt update && sudo apt install protobuf-compiler
- run: |
Expand All @@ -154,14 +167,20 @@ jobs:
name: Cargo Test
needs: tla-plus
runs-on: ubuntu-latest
strategy:
matrix:
toolchain:
- nightly-2025-12-11
steps:
- uses: actions/checkout@v5
- name: Install Ziren toolchain
run: curl --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/ProjectZKM/toolchain/refs/heads/main/setup.sh | sh
run: |
set -euo pipefail
installer="$RUNNER_TEMP/zkmup"
curl --proto '=https' --tlsv1.2 -fsSL --retry 3 \
https://raw.githubusercontent.com/ProjectZKM/toolchain/582f7927cac0668883a86cbd02fbc18b500b1b6f/zkmup \
-o "$installer"
sh "$installer" install -v "$ZKM_TOOLCHAIN_VERSION"
SHELL=/bin/true sh "$installer" setup -v "$ZKM_TOOLCHAIN_VERSION"
source "$HOME/.zkm-toolchain/env"
rustc --version
cargo --version
- name: Install Dependencies
run: sudo apt update && sudo apt install protobuf-compiler
- name: Launch the Regtest
Expand Down
70 changes: 70 additions & 0 deletions .github/workflows/e2e_localnet.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
name: Localnet e2e

# The whole localnet e2e suite (localnet/README.md, localnet/e2e/README.md) on the self-hosted
# bitvm2-node runner: build the mock-gc binaries, rebuild a private localnet, run all 13 cases.
# ~2 h per run, so it is not a PR gate: same triggers as ci_time_consuming.yml.

on:
push:
branches: ["main", "dev"]
workflow_dispatch:

# One CI localnet per host: queue runs, never cancel one that is half way through.
concurrency:
group: localnet-e2e
cancel-in-progress: false

env:
CARGO_TERM_COLOR: always
# A localnet of its own next to any other on the host (ports PORT_BASE+0..999).
LOCALNET_DATA: /data/actions-runner-bitvm2-node/cache/localnet-e2e/data
PORT_BASE: "25000"
COMPOSE_PROJECT: bvci
# Dedicated target dir, kept between runs; only this workflow builds into it.
CARGO_TARGET_DIR: /data/actions-runner-bitvm2-node/cache/localnet-e2e/target

jobs:
e2e:
name: Localnet e2e
runs-on: [self-hosted, bitvm2-node]
timeout-minutes: 210
steps:
- uses: actions/checkout@v5
with:
submodules: recursive

- name: Build the mock-gc binaries
run: |
# results of earlier runs stay in the data dir: keep the last 10, never report a stale one
mkdir -p "$LOCALNET_DATA/results"
rm -f "$LOCALNET_DATA/results/latest"
find "$LOCALNET_DATA/results" -mindepth 1 -maxdepth 1 -type d | sort | head -n -10 | xargs -r rm -rf
localnet/build.sh

- name: Reset the localnet
run: make localnet-reset

- name: Run the e2e suite
run: make e2e

- name: Report
if: always()
run: |
run=$(readlink -f "$LOCALNET_DATA/results/latest" 2>/dev/null || true)
[ -d "$run" ] || run=""
echo "E2E_RESULTS=$run" >> "$GITHUB_ENV"
if [ -f "$run/report.md" ]; then cat "$run/report.md" >> "$GITHUB_STEP_SUMMARY"; else echo "no e2e report" >> "$GITHUB_STEP_SUMMARY"; fi

- name: Stop the localnet
if: always()
run: |
localnet/scripts/chaos.sh reset || true
localnet/scripts/down.sh infra

- name: Upload the results
if: always() && env.E2E_RESULTS != ''
uses: actions/upload-artifact@v4
with:
name: localnet-e2e-${{ github.run_id }}
path: ${{ env.E2E_RESULTS }}
retention-days: 14
1 change: 0 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,6 @@ jobs:
"target/release/send-rbf"
"target/release/pegin-request"
"target/release/pegout"
"target/release/update-db"
)

if [ "${{ runner.os }}" = "Linux" ]; then
Expand Down
11 changes: 10 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,13 @@ local_docs/
local_scripts/
scripts/testnet/
scripts/devnet/
*.DS_Store
*.DS_Store
# localnet state (default LOCALNET_DATA) and build artifacts of its tooling
localnet/.local/
localnet/subgraph/gateway/node_modules/
localnet/subgraph/gateway/build/
localnet/subgraph/gateway/generated/
localnet/contracts-local/out/
localnet/contracts-local/cache/
localnet/contracts-local/broadcast/
localnet/tools/__pycache__/
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "localnet/contracts"]
path = localnet/contracts
url = https://github.com/KSlashh/bitvm-L2-contracts.git
23 changes: 23 additions & 0 deletions Cargo.lock

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

2 changes: 2 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ members = [
"crates/cbft-rpc",
"crates/bitvm-gc",
"crates/store",
"crates/engine",
"crates/node-macros",
"crates/client",
"crates/util",
Expand Down Expand Up @@ -118,6 +119,7 @@ soldering-host = { git = "https://github.com/GOATNetwork/bitvm-gc", features = [
#garbled-snark-verifier = { path = "../bitvm-gc/garbled-snark-verifier"}
#soldering-host = { path = "../bitvm-gc/babe-programs/soldering/host" }
store = { path = "crates/store" }
engine = { path = "crates/engine" }
util = { path = "crates/util" }
client = { path = "crates/client" }
bitcoin-light-client-circuit = { path = "circuits/crates/bitcoin-light-client-circuit" }
Expand Down
27 changes: 27 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# Repo-level shortcuts for the local mock testnet under localnet/ (see localnet/README.md).
# Every target honours LOCALNET_DATA, PORT_BASE and COMPOSE_PROJECT from the environment, e.g.
# LOCALNET_DATA=/tmp/bv2 PORT_BASE=23000 COMPOSE_PROJECT=bvlocal2 make localnet-reset
LOCALNET := localnet

.PHONY: localnet-build localnet-up localnet-down localnet-reset localnet-status e2e-smoke e2e

localnet-build: ## build the mock-gc node + helper binaries into the repo target
$(LOCALNET)/build.sh

localnet-up: ## adopt / start an existing localnet (infra, miner, proof builder, 5 nodes)
$(LOCALNET)/scripts/up.sh

localnet-down: ## stop nodes + support processes (infra keeps running; `scripts/down.sh infra` stops it too)
$(LOCALNET)/scripts/down.sh

localnet-reset: ## DESTRUCTIVE: wipe $(LOCALNET_DATA) and rebuild chains, contracts, subgraph, nodes
$(LOCALNET)/scripts/reset.sh --yes

localnet-status:
$(LOCALNET)/scripts/status.sh

e2e-smoke: ## peg-in, peg-out and challenge/take-2 happy paths (~20 min)
$(LOCALNET)/e2e/run.sh pegin_happy pegout_happy challenge_take2

e2e: ## the whole suite (~110 min)
$(LOCALNET)/e2e/run.sh
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ GOAT Network's BitVM bridge implementation. See [GOAT BitVM Whitepaper](https://
- `proof-builder-rpc/`: RPC server for offloading proof generation to a separate process
- `crates/`: Shared Rust crates for common types and utilities
- `deployment`: Deployment scripts and documentation
- `scripts/ops/`: Read-only operator helpers for a running node (health triage, log queries, instance / graph traces)
- `localnet/`: clone-and-run mock testnet (five `mock-gc` nodes on regtest + anvil + graph-node) and the on-demand e2e suite, see [localnet/README.md](localnet/README.md); `make localnet-reset`, `make e2e-smoke`


## Formal verification (TLA+)
Expand Down
9 changes: 9 additions & 0 deletions crates/bitvm-gc/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,17 @@ ark-bn254 = { workspace = true }
ark-groth16 = { workspace = true }
ark-serialize = { workspace = true }
ark-ff = { workspace = true }
ark-ec = { workspace = true }
verifiable-circuit-babe = { workspace = true }
garbled-snark-verifier = { workspace = true }
soldering-host = { workspace = true }
rayon = { workspace = true }

# Only needed by the compile-time `mock-gc` feature, to wrap the mocked soldered
# output in a structurally-real `ZKMProofWithPublicValues` so the node's payload
# plumbing (compact/expand, SolderingProof::output) keeps working unchanged.
zkm-sdk = { workspace = true, optional = true }

serde-big-array = { workspace = true }
serde_json = { workspace = true }
bincode.workspace = true
Expand All @@ -46,3 +52,6 @@ tokio = { workspace = true, features = ["macros", "time"] }
[features]
default = []
ci-tests = []
# Replace the real BABE/GC/soldering machinery with deterministic, on-chain-valid
# mocks. Localnet only. See node feature `mock-gc` which forwards to this one.
mock-gc = ["dep:zkm-sdk"]
Loading
Loading