@@ -9,7 +9,20 @@ SCRIPTS_REPO="${CKB_IDL_SCRIPTS_REPO:-$REPO_ROOT/../ckb_sudt_script}"
99
1010DERIVE_COMMIT=" e7ee35766b9084099e9d840ccd37d2b5d40074a1"
1111CLIENT_COMMIT=" 7d883e0abccba56d423449b673567ee817747936"
12- SCRIPTS_COMMIT=" 33bc56d84e8a181d855da5b82a87740825017f29"
12+ SCRIPTS_COMMIT=" c20ce3f4813100b78076fd447a0234bb5ad46bbb"
13+ RUNTIME_RUST_TOOLCHAIN=" 1.97.1"
14+ RUNTIME_PARENT=" "
15+ RUNTIME_REPO=" "
16+
17+ cleanup_runtime_worktree () {
18+ if [[ -n " $RUNTIME_REPO " && -d " $RUNTIME_REPO " ]]; then
19+ git -C " $SCRIPTS_REPO " worktree remove --force " $RUNTIME_REPO " > /dev/null 2>&1 || true
20+ fi
21+ if [[ -n " $RUNTIME_PARENT " && -d " $RUNTIME_PARENT " ]]; then
22+ rmdir " $RUNTIME_PARENT " > /dev/null 2>&1 || true
23+ fi
24+ }
25+ trap cleanup_runtime_worktree EXIT
1326
1427usage () {
1528 cat << 'USAGE '
@@ -18,8 +31,10 @@ Usage: scripts/cellscript_ls_idl_upstream_acceptance.sh \
1831
1932Runs the opt-in LS-IDL compatibility check against clean, pinned upstream
2033checkouts. It validates upstream IDL bytes, runs upstream schema/wire tests,
21- and executes the actual ckb-idl-client Rust crate against CellScript Registry's
22- /idl/:code_hash compatibility handler.
34+ executes the actual ckb-idl-client Rust crate against CellScript Registry's
35+ /idl/:code_hash compatibility handler, and builds the merged upstream runtime
36+ fixes in a disposable worktree before binding and running the example Lock
37+ Scripts in CKB-VM.
2338
2439This script is not part of any CellScript release gate.
2540USAGE
@@ -63,7 +78,7 @@ while [[ $# -gt 0 ]]; do
6378 esac
6479done
6580
66- for command in cargo git node npm sha256sum; do
81+ for command in cargo git make mktemp node npm sha256sum; do
6782 if ! command -v " $command " > /dev/null 2>&1 ; then
6883 echo " missing required command: $command " >&2
6984 exit 127
@@ -146,4 +161,27 @@ CELLSCRIPT_LS_IDL_CARGO_TARGET_DIR="$REPO_ROOT/target/ls-idl-upstream-client" \
146161 npm --prefix " $REPO_ROOT /services/registry-api" test -- \
147162 test/registry-api.test.ts -t " interoperates with the pinned upstream Rust client"
148163
164+ RUNTIME_PARENT=" $( mktemp -d " ${TMPDIR:-/ tmp} /cellscript-ls-idl-runtime.XXXXXX" ) "
165+ RUNTIME_REPO=" $RUNTIME_PARENT /ckb_sudt_script"
166+ git -C " $SCRIPTS_REPO " worktree add --quiet --detach " $RUNTIME_REPO " " $SCRIPTS_COMMIT "
167+
168+ RUSTUP_TOOLCHAIN=" $RUNTIME_RUST_TOOLCHAIN " RUSTC_WRAPPER= \
169+ make -C " $RUNTIME_REPO " build CARGO_ARGS=--locked
170+
171+ BOUND_DIR=" $RUNTIME_REPO /build/ls-idl-bound"
172+ mkdir -p " $BOUND_DIR "
173+ for script_name in simple-lock timelock-lock; do
174+ idl_path=" $RUNTIME_REPO /contracts/$script_name /idl.json"
175+ executable_path=" $RUNTIME_REPO /build/release/$script_name "
176+ bound_path=" $BOUND_DIR /$script_name "
177+ cargo run --quiet --locked --manifest-path " $REPO_ROOT /Cargo.toml" -p cellscript --bin cellc -- \
178+ artifact ls-idl bind --idl " $idl_path " --executable " $executable_path " --output " $bound_path "
179+ cargo run --quiet --locked --manifest-path " $REPO_ROOT /Cargo.toml" -p cellscript --bin cellc -- \
180+ artifact ls-idl validate --idl " $idl_path " --executable " $bound_path "
181+ cp " $bound_path " " $executable_path "
182+ done
183+
184+ RUSTUP_TOOLCHAIN=" $RUNTIME_RUST_TOOLCHAIN " RUSTC_WRAPPER= \
185+ cargo test --locked --manifest-path " $RUNTIME_REPO /Cargo.toml" -p tests -- --test-threads=1
186+
149187echo " Pinned LS-IDL upstream compatibility acceptance passed."
0 commit comments