-
Notifications
You must be signed in to change notification settings - Fork 719
Configurable native stack size for Stylus with auto-retry on overflow #4538
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
48 commits
Select commit
Hold shift + click to select a range
59944a8
Configurable native stack size for Stylus with auto-retry on overflow
bragaigor e52f4ac
add validation check and avoid infinite loop
bragaigor 7ecbee1
temporarily bump global stack size
bragaigor 9a8988b
add per thread stack size override
bragaigor 5c01282
cleanup and update comments
bragaigor 5f23b03
Merge branch 'master' into nm004-config-stylus-stack-size
bragaigor f02adf1
update wasmer pin
bragaigor c5d7598
Merge branch 'master' into nm004-config-stylus-stack-size
bragaigor c08d636
replace set_thread_stack_size with drain_stack_pool
bragaigor 0ca8979
update comments and add tests
bragaigor 35473be
add retries count log and update tests
bragaigor b60a623
add test for give-up path
bragaigor 81800a5
Merge branch 'master' into nm004-config-stylus-stack-size
bragaigor fd2ae52
update wasmer pin
bragaigor 3be8c15
apply new fallback stack overflow logic
bragaigor 7e2f334
fix race condition and update tests
bragaigor 065d30b
make lint happy and fix snapshot
bragaigor 11db344
fix test race
bragaigor 93fca7d
improve tests
bragaigor 4fd0576
return error if we hit native stack overflow
bragaigor 043e63f
Consolidate cranelift targets with non-cranelift targets
bragaigor 72d0cba
fix tests and save UsedMultiGas
bragaigor 988d29c
Merge branch 'master' into nm004-config-stylus-stack-size
bragaigor 730c7ce
make lint happy
bragaigor 3ecad5e
only call stylus with cranelift if not compiled again
bragaigor c5e37cc
cleanup and fix program stack overflow tests
bragaigor 16682ac
update comments and add error logs
bragaigor f0610d4
update go-ethereum pin
bragaigor f166a5c
always run with cranelift on retry first unconditionally
bragaigor 619e251
make getCraneliftAsm also return an error and add test for it
bragaigor 030edf9
return ErrNativeStackOverflow for userNativeStackOverflow
bragaigor e928d36
typo
bragaigor 6de4c20
fix comments
bragaigor e8d60b3
also save state for openPages and everPages
bragaigor 746454b
add consistency tests and bring GetAllowFallback() earlier
bragaigor db48a58
Merge branch 'master' into nm004-config-stylus-stack-size
bragaigor 3edb1d9
Merge branch 'master' into nm004-config-stylus-stack-size
bragaigor ee1898f
allow fallback to be applied for both all targets
bragaigor b4cd4e8
update retryOnStackOverflow to handleNativeStackOverflow
bragaigor d32d8ef
update comments to reflect new logic
bragaigor 5b3f15d
introduce doubleNativeStackSize() and try cranelift first
bragaigor 41e87c6
update comments and add restoreState helper
bragaigor d9ec033
Merge branch 'master' into nm004-config-stylus-stack-size
bragaigor 68673e9
on first overflow, double stack and try again
bragaigor bcc3cdc
update comment and improve test
bragaigor 20aea22
move cranelift target registration to PopulateStylusTargetCache
bragaigor 9dc0493
encapsulate savedState and more compareAndSwap to the end
bragaigor 56e26a6
Merge branch 'master' into nm004-config-stylus-stack-size
eljobe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| ### Configuration | ||
| - Add `--stylus-target.native-stack-size` config to set the initial Wasmer coroutine stack size for Stylus execution. | ||
|
|
||
| ### Fixed | ||
| - Fix Wasmer stack pool reusing stale smaller stacks after a stack size change. | ||
| - Automatically detect native stack overflow during Stylus execution, grow the stack size (doubling each retry, capped at 100 MB), and retry. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule wasmer
updated
2 files
| +2 −2 | lib/vm/src/trap/mod.rs | |
| +23 −8 | lib/vm/src/trap/traphandlers.rs |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.