Skip to content

Commit 9defc8c

Browse files
committed
Accept merged upstream LS-IDL runtime fixes
1 parent 7ed0aaf commit 9defc8c

5 files changed

Lines changed: 85 additions & 22 deletions

File tree

‎CHANGELOG.md‎

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,15 @@
4242
compatibility `/idl/:code_hash` route all enforce the same schema and
4343
executable-suffix contract. Pin all 17 current upstream client vectors and
4444
seven derive/example IDLs, and add an opt-in test that runs the actual
45-
upstream Rust client against Registry's compatibility handler. Add a runnable
46-
Rust example, website lookup/detail surfaces, and VS Code validate/bind/fetch
47-
commands. Name the website tab `LS-IDL` rather than the ambiguous
48-
`Interface`, and align its lookup panel with the full-width Browse surface.
45+
upstream Rust client against Registry's compatibility handler. Extend that
46+
opt-in acceptance through the fixes merged upstream in `ckb_sudt_script`
47+
PR #7, real RISC-V contract builds, LS-IDL-bound ELFs, and all 25 example
48+
CKB-VM tests without a local compatibility overlay. Add a
49+
runnable Rust example, website lookup/detail surfaces, and VS Code
50+
validate/bind/fetch commands. Name the website tab `LS-IDL` rather than the
51+
ambiguous `Interface`, give it the canonical `/registry/LS-IDL` route with a
52+
permanent redirect from `/registry/interface`, and align its lookup panel
53+
with the full-width Browse surface.
4954
Keep implementation correctness and security review outside this
5055
byte-identity claim.
5156
- Ship the 0.24 package and Registry trust closure, informed by Sui Move's

‎docs/CELLSCRIPT_GATE_POLICY.md‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -433,7 +433,8 @@ use:
433433
a sibling CKB checkout; see `docs/CELLSCRIPT_CKB_STD_COMPAT.md`.
434434
- `./scripts/cellscript_ls_idl_upstream_acceptance.sh` — exact-pinned LS-IDL
435435
derive, client, and example-script compatibility, including the actual
436-
upstream Rust client calling the Registry compatibility handler; see
436+
upstream Rust client calling the Registry compatibility handler, unmodified
437+
upstream RISC-V builds, LS-IDL-bound ELFs, and example CKB-VM execution; see
437438
`docs/CELLSCRIPT_LS_IDL_REGISTRY_PROFILE.md`.
438439
- `./scripts/cellscript_cellfabric_bridge_smoke.sh` — CellFabric bridge smoke
439440
test; see `docs/CELLSCRIPT_CELLFABRIC_BRIDGE.md`.

‎docs/CELLSCRIPT_LS_IDL_REGISTRY_PROFILE.md‎

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,9 @@ cellc artifact ls-idl fetch \
177177

178178
The VS Code extension exposes the validate, bind, and fetch operations through
179179
the command palette. The Registry website exposes package-bound LS-IDL facts
180-
and a direct Script-identity lookup under an explicit `LS-IDL` tab.
180+
and a direct Script-identity lookup under an explicit `LS-IDL` tab at
181+
`https://cellscript.dev/registry/LS-IDL`. The retired
182+
`/registry/interface` route redirects permanently to that canonical address.
181183

182184
## Storage And Admission
183185

@@ -203,7 +205,7 @@ proposal:
203205
- `ckb-idl-client` commit
204206
`7d883e0abccba56d423449b673567ee817747936`;
205207
- `ckb_sudt_script` commit
206-
`33bc56d84e8a181d855da5b82a87740825017f29`; and
208+
`c20ce3f4813100b78076fd447a0234bb5ad46bbb`; and
207209
- upstream `test-vectors.json` SHA-256
208210
`a9a6dca4fd0c5fcd2ca7aea6468784be7fdb29d6274049f07090cbab0ce9c1bb`.
209211

@@ -226,15 +228,21 @@ The script requires clean checkouts at the pinned commits, checks every raw
226228
fixture hash, runs the derive and client library tests plus the example
227229
scripts' structural witness tests, validates all seven upstream IDLs with
228230
`cellc`, and runs the actual upstream Rust client against the Registry
229-
`/idl/:code_hash` handler. That final probe covers fetch, raw-byte SHA-256
230-
verification, cache use, and linear witness decoding.
231+
`/idl/:code_hash` handler. That probe covers fetch, raw-byte SHA-256
232+
verification, cache use, and linear witness decoding. It then creates a
233+
disposable worktree, builds all three example contracts from the unmodified
234+
merged upstream source with Rust 1.97.1, binds the simple and timelock ELF files
235+
to their exact IDL bytes, and runs all 25 upstream CKB-VM tests against the
236+
bound executables.
231237

232238
This remains an opt-in compatibility tool rather than release-gate evidence.
233239
At the pinned client commit, the complete vector and library tests pass; the
234240
repository's separate property-test suite still contains Blake2b commitment
235-
fixtures even though production `verify` uses SHA-256. The full example-script
236-
VM suite also requires its RISC-V contracts to be built first. These upstream
237-
conditions are recorded rather than hidden or promoted into Registry claims.
241+
fixtures even though production `verify` uses SHA-256. [Upstream PR
242+
#7](https://github.com/OWK50GA/ckb_sudt_script/pull/7) merged CKB's
243+
`passes=lower-atomic` build setting and the explicit timelock `HeaderDep`
244+
loading path, so the acceptance pin now tests the unmodified upstream source
245+
without a CellScript compatibility overlay.
238246

239247
The upstream mini Registry example parses and reserialises JSON, so it is not
240248
used as the byte-preserving production storage contract. CellScript follows

‎scripts/cellscript_ls_idl_upstream_acceptance.sh‎

Lines changed: 42 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,20 @@ SCRIPTS_REPO="${CKB_IDL_SCRIPTS_REPO:-$REPO_ROOT/../ckb_sudt_script}"
99

1010
DERIVE_COMMIT="e7ee35766b9084099e9d840ccd37d2b5d40074a1"
1111
CLIENT_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

1427
usage() {
1528
cat <<'USAGE'
@@ -18,8 +31,10 @@ Usage: scripts/cellscript_ls_idl_upstream_acceptance.sh \
1831
1932
Runs the opt-in LS-IDL compatibility check against clean, pinned upstream
2033
checkouts. 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
2439
This script is not part of any CellScript release gate.
2540
USAGE
@@ -63,7 +78,7 @@ while [[ $# -gt 0 ]]; do
6378
esac
6479
done
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+
149187
echo "Pinned LS-IDL upstream compatibility acceptance passed."

‎tests/compat/ls_idl/README.md‎

Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ Pinned repositories:
1111
- [`OWK50GA/ckb-idl-client`](https://github.com/OWK50GA/ckb-idl-client) at
1212
`7d883e0abccba56d423449b673567ee817747936`; and
1313
- [`OWK50GA/ckb_sudt_script`](https://github.com/OWK50GA/ckb_sudt_script) at
14-
`33bc56d84e8a181d855da5b82a87740825017f29`.
14+
`c20ce3f4813100b78076fd447a0234bb5ad46bbb`.
1515

1616
Raw-byte SHA-256 pins:
1717

@@ -35,8 +35,19 @@ decodes them before hashing or validating them.
3535
one unknown-type vector still fails closed at Registry schema admission. The
3636
separate `scripts/cellscript_ls_idl_upstream_acceptance.sh` test uses clean
3737
checkouts at these commits and runs the actual upstream Rust client against
38-
the Registry compatibility handler.
39-
40-
This evidence establishes schema compatibility, exact-byte preservation, and
41-
the SHA-256 suffix contract. It does not establish Lock Script semantics,
42-
signature correctness, transaction validity, or a security audit.
38+
the Registry compatibility handler. It then creates a disposable worktree,
39+
builds all three example contracts from the unmodified merged upstream source,
40+
binds the two Lock Script ELFs to their exact IDL bytes, and runs all 25
41+
upstream CKB-VM tests against the bound artifacts.
42+
43+
[Upstream PR #7](https://github.com/OWK50GA/ckb_sudt_script/pull/7) merged the
44+
two runtime fixes first identified by this acceptance work: the contract
45+
Makefiles enable CKB's `lower-atomic` LLVM pass, and the timelock reads the
46+
transaction `HeaderDep` included by its tests. CellScript no longer applies a
47+
compatibility overlay for these paths.
48+
49+
This evidence establishes schema compatibility, exact-byte preservation, the
50+
SHA-256 suffix contract, and local CKB-VM execution of the unmodified upstream
51+
examples.
52+
It does not establish signature correctness, production transaction validity,
53+
or a security audit.

0 commit comments

Comments
 (0)