fix: Resolve fuzzing script issues with gas limits and CSV symlinks

- Increased gas limit to 100M to prevent out-of-gas errors during large swaps
- Fixed symlink path for profitable_scenario.csv to work with visualizer
- Position CSVs are now always generated when recording profitable scenarios

The out-of-gas error was occurring when large KRAIKEN sells tried to traverse
many tick ranges in Uniswap V3. The visualizer couldn't display data because
the CSV symlink was created in the wrong directory.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
johba 2025-08-18 21:14:48 +02:00
parent c1627dd4c9
commit fbd8170198
22 changed files with 6373 additions and 4 deletions

View file

@ -59,7 +59,7 @@ echo -e "${YELLOW}Starting recorded fuzzing analysis...${NC}"
FUZZING_RUNS=$RUNS_VALUE \
OPTIMIZER_CLASS=$OPTIMIZER \
RUN_ID=$RUN_ID \
forge script analysis/RecordedFuzzingAnalysis.s.sol:RecordedFuzzingAnalysis -vv 2>&1 | tee $OUTPUT_DIR/fuzzing.log
forge script analysis/RecordedFuzzingAnalysis.s.sol:RecordedFuzzingAnalysis --gas-limit 100000000 -vv 2>&1 | tee $OUTPUT_DIR/fuzzing.log
# Check for generated scenario files
SCENARIO_COUNT=$(ls -1 recorded_scenario_*.json 2>/dev/null | wc -l)
@ -169,13 +169,13 @@ if [ $POSITION_CSV_COUNT -gt 0 ] && [ $SCENARIO_COUNT -gt 0 ]; then
FIRST_CSV=$(ls -1 $OUTPUT_DIR/improved_positions_*.csv 2>/dev/null | head -1)
echo "CSV file: $FIRST_CSV"
# Create a temporary symlink to the CSV for the viewer
TEMP_LINK="profitable_scenario.csv"
# Create a temporary symlink to the CSV for the viewer in the analysis directory
TEMP_LINK="analysis/profitable_scenario.csv"
if [ -f "$TEMP_LINK" ] || [ -L "$TEMP_LINK" ]; then
rm -f "$TEMP_LINK"
fi
# Use absolute path for the symlink
ln -s "$(pwd)/$FIRST_CSV" "$TEMP_LINK"
ln -s "$(realpath $FIRST_CSV)" "$TEMP_LINK"
# Check if server is already running on common ports
SERVER_RUNNING=false