fix(multicall): resolve critical multicall parsing corruption issues
- Added comprehensive bounds checking to prevent buffer overruns in multicall parsing - Implemented graduated validation system (Strict/Moderate/Permissive) to reduce false positives - Added LRU caching system for address validation with 10-minute TTL - Enhanced ABI decoder with missing Universal Router and Arbitrum-specific DEX signatures - Fixed duplicate function declarations and import conflicts across multiple files - Added error recovery mechanisms with multiple fallback strategies - Updated tests to handle new validation behavior for suspicious addresses - Fixed parser test expectations for improved validation system - Applied gofmt formatting fixes to ensure code style compliance - Fixed mutex copying issues in monitoring package by introducing MetricsSnapshot - Resolved critical security vulnerabilities in heuristic address extraction - Progress: Updated TODO audit from 10% to 35% complete 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -160,7 +160,7 @@ func (eq *ExecutionQueue) AddOpportunity(opportunity *pkgtypes.ArbitrageOpportun
|
||||
profitFloat, accuracy = profitEth.Float64()
|
||||
// Check if the conversion was exact (accuracy == 0) or if there was a loss of precision
|
||||
if accuracy != big.Exact {
|
||||
eq.logger.Warn("NetProfit conversion to float64 may have lost precision, accuracy: %v", accuracy)
|
||||
eq.logger.Warn(fmt.Sprintf("NetProfit conversion to float64 may have lost precision, accuracy: %v", accuracy))
|
||||
}
|
||||
}
|
||||
eq.logger.Info(fmt.Sprintf("📋 Added arbitrage opportunity to queue: %.6f ETH profit, priority: %.2f",
|
||||
@@ -180,7 +180,7 @@ func (eq *ExecutionQueue) calculatePriority(opp *pkgtypes.ArbitrageOpportunity)
|
||||
profitScore, accuracy = profitEth.Float64()
|
||||
// Check if the conversion was exact (accuracy == 0) or if there was a loss of precision
|
||||
if accuracy != big.Exact {
|
||||
eq.logger.Warn("NetProfit conversion to float64 may have lost precision, accuracy: %v", accuracy)
|
||||
eq.logger.Warn(fmt.Sprintf("NetProfit conversion to float64 may have lost precision, accuracy: %v", accuracy))
|
||||
}
|
||||
profitScore *= ProfitScoreScaleFactor // Scale by factor
|
||||
}
|
||||
@@ -250,7 +250,7 @@ func (eq *ExecutionQueue) processNext() {
|
||||
profitFloat, accuracy = profitEth.Float64()
|
||||
// Check if the conversion was exact (accuracy == 0) or if there was a loss of precision
|
||||
if accuracy != big.Exact {
|
||||
eq.logger.Warn("NetProfit conversion to float64 may have lost precision, accuracy: %v", accuracy)
|
||||
eq.logger.Warn(fmt.Sprintf("NetProfit conversion to float64 may have lost precision, accuracy: %v", accuracy))
|
||||
}
|
||||
}
|
||||
eq.totalProfitUSD += profitFloat
|
||||
@@ -289,7 +289,7 @@ func (eq *ExecutionQueue) executeOpportunity(item *ExecutionItem) bool {
|
||||
profitFloat, accuracy = profitEth.Float64()
|
||||
// Check if the conversion was exact (accuracy == 0) or if there was a loss of precision
|
||||
if accuracy != big.Exact {
|
||||
eq.logger.Warn("NetProfit conversion to float64 may have lost precision, accuracy: %v", accuracy)
|
||||
eq.logger.Warn(fmt.Sprintf("NetProfit conversion to float64 may have lost precision, accuracy: %v", accuracy))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user