change spawned thread stack size to 8mb - #1509
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Want fixes drafted automatically? Bugbot Autofix can create code changes for findings. A team admin can enable Autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 124f280. Configure here.
| use std::sync::OnceLock; | ||
|
|
||
| /// Stack size for worker threads created by chia_rs. | ||
| const THREAD_STACK_SIZE: usize = 8 * 1024 * 1024; |
There was a problem hiding this comment.
Triplicated stack size constant risks silent drift
Low Severity
THREAD_STACK_SIZE is defined identically in three separate crates (chia-datalayer, chia-tools, and chia-consensus tests). If this value is later tuned in one location, the others will silently remain at 8 MiB, leading to inconsistent thread stack sizes across components. A shared workspace-level constant or a tiny shared crate would prevent drift.
Additional Locations (2)
Reviewed by Cursor Bugbot for commit 124f280. Configure here.
Coverage Report for CI Build 32681834545Warning No base build found for commit Coverage: 80.984%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsRequires a base build to compare against. How to fix this → Coverage Stats
💛 - Coveralls |


DO NOT MERGE
testing stack size
Note
Medium Risk
Changes thread stack configuration for parallel CLVM/block and datalayer work. Larger stacks raise per-thread memory use and could still miss other thread pools.
Overview
Gives worker threads an 8MB stack instead of the default, to reduce stack overflows when running generators and related work.
chia-toolsnow exportsTHREAD_STACK_SIZEand applies it to theblocking_threadpoolused by analyze-chain, gen-corpus, test-block-generators, and validate-blockchain-db (plus the compressed-block test).Datalayer
DeltaReaderparallel blob collection no longer uses the global rayon pool. It installs a dedicated pool with the same 8MB stack.Reviewed by Cursor Bugbot for commit 124f280. Bugbot is set up for automated code reviews on this repo. Configure here.