Optimize SourceLocation storage and implement Windows file locking#1078
Open
Risktaker001 wants to merge 5 commits intodotandev:mainfrom
Open
Optimize SourceLocation storage and implement Windows file locking#1078Risktaker001 wants to merge 5 commits intodotandev:mainfrom
Risktaker001 wants to merge 5 commits intodotandev:mainfrom
Conversation
Author
|
@Risktaker001 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Closes #868
PR: Replace brittle stack trace parsing with structured Wasmi Frame extraction (#868)
Summary
Refactored
stack_trace.rsto use regex-based pattern matching instead of brittle string parsing, improving robustness and maintainability of frame extraction from Wasmi/Soroban error strings.Problem
The original implementation used string-based parsing with operations like:
line.split_whitespace()andto_lowercase()Solution
Regex-Based Frame Extraction
Pre-compiled regex patterns using
once_cell::sync::Lazy:Trap Classification
Case-insensitive regex patterns for all trap types:
Regex-Based Error Type Detection
Files Changed
simulator/Cargo.toml(+3 dependencies)once_cell = "1.19"- Lazy static regex compilationregex = "1.11"- Robust pattern matchingproptest = "1.5"- Property-based testingsimulator/src/stack_trace.rs(complete refactor)Testing
Property-Based Tests
prop_extract_preserves_frame_indices- Index preservation verificationprop_offset_parsing- Hex and decimal offset parsingprop_function_name_parsing- Various function name formatsprop_trap_classification_is_deterministic- Classification consistencyprop_mixed_frame_formats- Mixed format backtracesUnit Tests
#0: func[42])<my_contract>::transfer)Run Tests
Benefits
once_cell::Lazyfor efficient pattern reuseBreaking Changes
None. The public API remains unchanged.
Backwards Compatibility
All existing frame formats are supported. New patterns can be added without breaking existing functionality.