-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Adjustable stack size for EVM #2483
Conversation
Changes Unknown when pulling f2186f5 on stack-evm into * on master*. |
/// TODO [todr] We probably need some more sophisticated calculations here (limit on my machine 132) | ||
/// Maybe something like here: `https://github.com/ethereum/libethereum/blob/4db169b8504f2b87f7d5a481819cfb959fc65f6c/libethereum/ExtVM.cpp` | ||
const MAX_VM_DEPTH_FOR_THREAD: usize = 64; | ||
const STACK_SIZE_PER_DEPTH: usize = 256*1024; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
256kb per recursion frame? That's too much. Before the change it was 512k / 64 = 8kb
512k is the minimum stack size that we supported
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
before change it was 2MB/64 = 32kb
i just used 16MB/64 instead, my bad
/// Stack size | ||
/// Should be modified if it is changed in Rust since it is no way | ||
/// to know or get it | ||
pub static LOCAL_STACK_SIZE: Cell<usize> = Cell::new(::std::env::var("RUST_MIN_STACK").ok().and_then(|s| s.parse().ok()).unwrap_or(2 * 1024 * 1024)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
minimum should be 512k, that's the default on OS X
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
512k must be default for the main thread only
this expression exactly the same value which rust uses for spawned threads:
https://github.com/rust-lang/rust/blob/master/src/libstd/sys/common/util.rs#L18
|
||
use std::sync::{Condvar as SCondvar, Mutex as SMutex}; | ||
|
||
const STACK_SIZE: usize = 16*1024*1024; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like with 8kb frame the stack of 8mb should be enough
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this might be so, but previously we used 32kb
see above
Changes Unknown when pulling be2307f on stack-evm into * on master*. |
well 16kb was not enough |
Changes Unknown when pulling 841401e on stack-evm into * on master*. |
Changes Unknown when pulling 7b956a8 on stack-evm into * on master*. |
* stack size for io workers & evm threshold * rust way to remember stack size * right value * 24kb size * some stack reduction
* RocksDB version bump * Preserve cache on reverting the snapshot (#2488) * Preserve cache on reverting the snapshot * Renamed merge_with into replace_with * Renamed and documented snapshotting methods * Track dirty accounts in the state (#2461) * State to track dirty accounts * Removed clone_for_snapshot * Renaming stuff * Documentation and other minor fixes * Replaced MaybeAccount with Option * Adjustable stack size for EVM (#2483) * stack size for io workers & evm threshold * rust way to remember stack size * right value * 24kb size * some stack reduction * Fixed overflow panic in handshake_panic (#2495)
* js: (228 commits) registration in place Backports to master (#2530) lookup hash ethcore_hashContent call single input for commit/filename basic githubhint layout Handle reorganizations in the state cache (#2490) terminate after 30 seconds (#2513) allow updates of the secure token Using pending block only if not old (#2514) Caching optimizations (#2505) rework connection display basic test for manual token Fixed overflow panic in handshake_panic (#2495) Trim password from file (#2503) Fixing RPC Filter conversion to EthFilter (#2500) init token updates take place initial token connection - WIP Fixing error message for transactions (#2496) Adjustable stack size for EVM (#2483) ... # Conflicts: # js/src/dapps/registry/Application/application.js # js/src/dapps/registry/Container.js # js/src/dapps/registry/actions.js # js/src/dapps/registry/reducers.js
#2482