Skip to content

fix: release malloc-backed Nock VM stacks - #22

Merged
yapishu merged 1 commit into
masterfrom
fix/nockster-wasm-stack-release
Sep 24, 2026
Merged

yapishu merged 1 commit into
masterfrom
fix/nockster-wasm-stack-release

Conversation

@yapishu

@yapishu yapishu commented Sep 23, 2026

Copy link
Copy Markdown
Contributor

Repeated transaction construction in WebAssembly exhausts memory because Memory::Malloc owns a raw allocation without releasing it. Each temporary Tip5 hashing context allocates an 8 MiB Nock VM stack. Drop now frees malloc-backed storage using the allocation’s original size and alignment; mmap-backed storage uses MmapMut’s destructor.

The regression test tracks outstanding stack allocations across 32 create/drop cycles. It fails with the destructor removed and passes with the fix.

Validation:

  • cargo +nightly-2025-02-14 test -p tx-types passes.
  • Nockster’s browser test constructs and verifies 32 multi-input bridge drafts using the patched WASM dependency; it passes without exhausting memory.

@yapishu
yapishu merged commit 08132da into master Sep 24, 2026
1 check passed
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.

1 participant