- 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>
53 lines
1.0 KiB
Docker
53 lines
1.0 KiB
Docker
# Dockerfile for MEV Bot
|
|
|
|
# Build stage
|
|
FROM golang:1.25-alpine AS builder
|
|
|
|
# Install build dependencies for CGO-enabled packages such as sqlite3
|
|
RUN apk add --no-cache git build-base
|
|
|
|
# Set working directory
|
|
WORKDIR /app
|
|
|
|
# Ensure Go uses vendored dependencies inside the container
|
|
ENV GOFLAGS=-mod=vendor
|
|
ENV GOCACHE=/go/cache
|
|
|
|
# Copy source code
|
|
COPY . .
|
|
|
|
# Build the application
|
|
ENV CGO_ENABLED=1
|
|
RUN go build -o bin/mev-bot cmd/mev-bot/main.go
|
|
|
|
# Final stage
|
|
FROM alpine:latest
|
|
|
|
# Install ca-certificates for HTTPS requests
|
|
RUN apk --no-cache add ca-certificates
|
|
|
|
# Create a non-root user
|
|
RUN adduser -D -s /bin/sh mevbot
|
|
|
|
# Set working directory
|
|
WORKDIR /app
|
|
|
|
# Copy the binary from builder stage
|
|
COPY --from=builder /app/bin/mev-bot .
|
|
|
|
# Copy config files
|
|
COPY --from=builder /app/config ./config
|
|
|
|
# Change ownership to non-root user
|
|
RUN chown -R mevbot:mevbot .
|
|
|
|
# Switch to non-root user
|
|
USER mevbot
|
|
|
|
# Expose port (if needed for any web interfaces)
|
|
EXPOSE 8080
|
|
|
|
# Command to run the application
|
|
ENTRYPOINT ["./mev-bot"]
|
|
CMD ["start"]
|