Skip to content

Commit aab96e3

Browse files
committed
js: increase max stack size to 0x1E84800 bytes (32MiB)
Increase max stack size to fix "RuntimeError: memory access out of bounds" WASM error. Fixes #467 Signed-off-by: Yuki Kishimoto <[email protected]>
1 parent 28c545f commit aab96e3

File tree

3 files changed

+13
-0
lines changed

3 files changed

+13
-0
lines changed

CHANGELOG.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
* pool: use per-purpose dedicated relay channels ([Yuki Kishimoto])
3434
* pool: return relay urls to which `messages`/`events` have or not been sent for `send_*` and `batch_*` methods ([Yuki Kishimoto])
3535
* ffi(sdk): convert `RelayPool::handle_notifications` method to async/future ([Yuki Kishimoto])
36+
* js: increase max stack size to `0x1E84800` bytes (32 MiB) ([Yuki Kishimoto])
3637

3738
### Added
3839

@@ -45,6 +46,7 @@
4546
### Fixed
4647

4748
* nostr: fix NIP-47 `list_transactions` response deserialization ([Yuki Kishimoto] and [lnbc1QWFyb24])
49+
* js: fix "RuntimeError: memory access out of bounds" WASM error ([Yuki Kishimoto])
4850

4951
### Removed
5052

bindings/nostr-js/build.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,7 @@ fn main() {
1111
println!("cargo:rustc-env=GIT_HASH={git_hash}");
1212
}
1313
}
14+
15+
// 0x1E84800 bytes = 32MiB
16+
println!("cargo:rustc-link-arg=-zstack-size=0x1E84800");
1417
}

bindings/nostr-sdk-js/build.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// Copyright (c) 2022-2023 Yuki Kishimoto
2+
// Copyright (c) 2023-2024 Rust Nostr Developers
3+
// Distributed under the MIT software license
4+
5+
fn main() {
6+
// 0x1E84800 bytes = 32MiB
7+
println!("cargo:rustc-link-arg=-zstack-size=0x1E84800");
8+
}

0 commit comments

Comments
 (0)