Skip to content

Use fail-closed WASM random backend - #533

Draft
prozacchiwawa wants to merge 2 commits into
20260413-update-clvmr-main-0-17-5from
cursor/fix-npm-wasm-random-e8e8
Draft

Use fail-closed WASM random backend#533
prozacchiwawa wants to merge 2 commits into
20260413-update-clvmr-main-0-17-5from
cursor/fix-npm-wasm-random-e8e8

Conversation

@prozacchiwawa

@prozacchiwawa prozacchiwawa commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Summary

  • select getrandom_backend="unsupported" for the WASM build
  • remove all direct getrandom 0.4/JavaScript-binding dependencies introduced by the earlier fix
  • retain the existing MVP CPU target setting

Cause

The previous custom backend selection had no implementation, leaving an unresolved WASM env import that wasm-bindgen emitted as require("env").

Strategy

The unsupported backend is fail-closed: it introduces no JavaScript randomness interface and returns an explicit error if the WASM surface requests entropy. This avoids both an unresolved custom import and an insecure deterministic fallback.

The existing transitive dependency graph still contains getrandom 0.3 and 0.4 through clvmr's crypto dependencies, but neither receives the wasm_js feature and the package contains no JavaScript crypto bindings.

Validation

  • built and packed with the exact workflow flags
  • node wasm/tests/index.js passed
  • clvm-js interface suite passed: 2 suites, 26 tests
  • generated Node wrapper contains no getRandomValues, crypto, or require("env") binding
Open in Web Open in Cursor 

cursoragent and others added 2 commits July 27, 2026 17:08
Co-authored-by: arty <prozacchiwawa@users.noreply.github.com>
Co-authored-by: arty <prozacchiwawa@users.noreply.github.com>
@cursor cursor Bot changed the title Fix npm WASM test random backend Use fail-closed WASM random backend Jul 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants