Skip to content

Conversation

@prasanna-anchorage
Copy link
Contributor

@prasanna-anchorage prasanna-anchorage commented Nov 7, 2025

Summary

This PoC adds comprehensive testing infrastructure and deployment capabilities for Jupiter swap visualization on Solana, building on the foundation of improved token mapping.

Work Done

New: Solana Test Utils Crate (src/solana_test_utils/)

Complete testing framework including:

  • Fixture System: Transaction builder and manager for creating realistic test scenarios
  • Nightly Testing: Automated daily Jupiter trading pairs validation
    • Fetches live trading data from Jupiter API via Helius
    • Tests parser against real-world routes
    • Generates detailed reports and metrics
  • Surfpool Integration: Advanced transaction simulation capabilities
  • Validation Framework: Comprehensive assertion system for transaction parsing
  • Configuration: Pairs configuration for flexible test scenarios

CI/CD Enhancement

  • Nightly Jupiter Workflow (.github/workflows/nightly-jupiter.yml)
    • Runs daily at 2 AM UTC (configurable via secrets)
    • Caches cargo artifacts for performance
    • Supports optional Surfpool installation
    • Generates test reports and uploads artifacts
    • Optional Slack notifications

Deployment Artifacts

  • Docker container images (parser_app.tar, parser_host.tar)
  • Docker manifest.json for image registry
  • Parser startup script (scripts/start-parser.sh)

Minor Improvements

  • Solana core instruction parsing refinement
  • Jupiter swap preset minor adjustment

Testing

Running Tests Locally

Basic fixture and validation tests (no external dependencies):

cd src
cargo test -p solana_test_utils --lib

Transaction validation tests:

cd src
cargo test -p solana_test_utils --test surfpool_tests -- --nocapture

Nightly Jupiter trading pairs test (requires Helius API key):

export HELIUS_API_KEY=your_helius_api_key_here
cd src
cargo test -p solana_test_utils --test nightly_jupiter -- --ignored --nocapture

Surfpool Integration (Optional)

Surfpool is installed and available for advanced transaction simulation:

# Verify Surfpool is installed
surfpool -V

# Run tests that require Surfpool (currently have compatibility issues with latest Surfpool CLI)
# These are marked with #[ignore] and require Surfpool to be running separately
cd src
cargo test -p solana_test_utils --test surfpool_tests -- --ignored --nocapture

Note: Surfpool integration tests require the Surfpool binary and may need CLI updates for compatibility with the latest Surfpool version.

Configuration

Edit src/solana_test_utils/config/pairs_config.toml to customize trading pairs tested:

[[pairs]]
name = "SOL-USDC"
input_mint = "So11111111111111111111111111111111111111112"
output_mint = "EPjFWdd5AufqSSqeM2qN1xzybapC8G4wEGGkZwyTDt1v"
enabled = true
min_transactions = 5

Test Reports

Reports are generated in src/solana_test_utils/reports/nightly/:

  • latest.md - Human-readable report
  • latest.json - Structured report data
  • Timestamped archives for historical tracking

Next Steps: Multichain Testing

To make testing truly multichain, the next step is to implement the external integration testing proposal:

External Integration Testing Proposal

This will enable comprehensive cross-chain testing and validation across Solana, Ethereum, and other supported chains.

prasanna-anchorage and others added 5 commits November 7, 2025 17:46
- Add SplTransferInfo struct to VisualizerContext for carrying SPL transfer metadata
- Update VisualizerContext with new_with_transfers() constructor
- Parse transaction transfers in decode_instructions and pass to visualizers
- Update Jupiter swap parser to extract mint addresses from transfer data first
- Fall back to heuristic-based account scanning if transfers unavailable
- All Jupiter swap tests now pass with correct token identification

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

Co-Authored-By: Claude <noreply@anthropic.com>
…iter tests

This implements Phase 1 of the external integration testing framework. Key components:

- SurfpoolManager: Lifecycle management for Solana mainnet fork, reusable pattern
  for Anvil (Ethereum) and other fork tools
- TransactionBuilder: Fluent API for constructing Solana transactions
- FixtureManager: Recording and replaying transaction fixtures with JSON storage
- Validation utilities: Assertions and validators for transaction structure/state
- NightlyTestRunner: Automated testing framework for Jupiter trading pairs
  - Fetches real transactions from Helius API
  - Tests parser against current blockchain data
  - Generates detailed success/failure reports
  - GitHub Actions workflow for daily runs

Architecture follows LocalForkManager trait pattern enabling reuse across chains.
This work is part of the broader External Integration Testing Proposal documented
at https://github.com/anchorageoss/visualsign-parser/wiki/External-Integration-Testing-Proposal

Co-Authored-By: Claude <noreply@anthropic.com
  - Introduce RpcProvider trait for generic RPC implementation abstraction
  - Implement HeliusRpcProvider struct with Helius-specific API logic
  - Move all Helius API logic into HeliusRpcProvider implementation
  - Remove vendor-specific hardcoding from TransactionFetcher
  - TransactionFetcher now delegates to RpcProvider via trait
  - Enables future support for additional RPC providers and edge nodes
  - All tests pass: build succeeds, unit tests pass, nightly test works

  This enables a clean separation of concerns where:
  - RpcProvider trait: generic interface for any RPC implementation
  - HeliusRpcProvider: concrete Helius implementation of the trait
  - TransactionFetcher: consumer of trait, agnostic to RPC provider

Co-Authored-By: Claude <noreply@anthropic.com>
@prasanna-anchorage prasanna-anchorage changed the base branch from main to fix-jupiter-token-mapping November 7, 2025 17:49
@lgalabru lgalabru mentioned this pull request Nov 21, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants