Skip to content

project(sidecar): Add oracle E2E test harness with mock and solanarpc sidecar specs#1407

Draft
boraerincplusplus wants to merge 3 commits into
boraplusplus/oracle-aggregatorfrom
boraplusplus/oracle-e2e-harness
Draft

project(sidecar): Add oracle E2E test harness with mock and solanarpc sidecar specs#1407
boraerincplusplus wants to merge 3 commits into
boraplusplus/oracle-aggregatorfrom
boraplusplus/oracle-e2e-harness

Conversation

@boraerincplusplus

@boraerincplusplus boraerincplusplus commented Jul 9, 2026

Copy link
Copy Markdown
Collaborator

NOTE: (PR3)

This is a draft. This is a draft, not to be merged just yet. I'm opening this up to mark it for review.

Why this should be merged

PRs #1405 and #1406 introduced the contracts and signature aggregator endpoint for oracle attestation, but had no integration test covering the full pipeline. This PR closes that gap with an E2E test suite that exercises the complete path from Solana event -> BLS signature collection -> warp message delivery -> on-chain callback.

How this works:

  • tests/cmd/oracle-sidecar/: A minimal mock gRPC binary that implements the OracleSidecar service and accepts every Verify request unconditionally, without needing a real sidecar or Solana RPC. Built into build/oracle-sidecar alongside the other ICM service binaries.
  • icm-contracts/tests/suites/oracle/: A Ginkgo suite with two specs:
    1. Mock sidecar spec, which always runs. Spins up the mock sidecar on port 9900 and runs OracleAttestation with dummy data.
    2. Solanarpc sidecar spec, which only runs if SOLANA_RPC_URL is set. Builds the real sidecar/ binary from the boraplusplus/oracle-sidecar branch of AvalancheGo, writes a config pointing at the given RPC endpoint, and passes it to a second L1.
  • icm-contracts/tests/flows/oracle/oracle_attestation.go: The shared test flow, parameterized by L1 and an optional Solana RPC URL. Covers the full pipeline in eight steps:
    1) deploy OracleAdapter, 2) deploy TeleporterMessengerV2, 3) deploy MockOracleReceiver, 4) start the signature aggregator, 5) construct and ABI-encode an OracleMessage, 6) call POST /oracle/aggregate-signatures, 7) submit the signed warp message via receiveCrossChainMessage, and finally, 8) assert MockOracleReceiver recorded the correct payload, source address, and chain ID. Includes two sad-path cases delivery from a non-allowlisted source reverts with SourceNotAllowed, and replay of an already-delivered nonce reverts with AlreadyProcessed.
  • icm-contracts/tests/flows/oracle/solana.go: Discovers a recent Memo Program transaction from a live Solana RPC endpoint, walking up to 20 candidates (an arbitrary upper limit) until it finds one with an actual Memo instruction (handling both top-level and CPI inner instructions, and v0 transactions with address lookup tables). The raw Ed25519 signature bytes become the justification field passed to validators.
  • BeforeSuitestarts the required sidecar process(es), TCP polls until they are ready, writes the validator chain config files pointing to their sidecar endpoints, and brings up a LocalAvalancheNetwork with one or two L1s depending on whether SOLANA_RPC_URL is set. AfterSuite kills both sidecar processes and tears down the network. One L1 tests MockSidecar one tests the real one.

How this was tested

The mock sidecar path runs in CI as part of the services E2E suite. The solanarpc path was validated manually by setting SOLANA_RPC_URL=https://api.devnet.solana.com and AVALANCHEGO_PATH pointing to a binary from the oracle sidecar branch, confirming a real Memo Program transaction is fetched, signatures are collected at handler ID 4, and the signed message is delivered and accepted on-chain.

@boraerincplusplus boraerincplusplus force-pushed the boraplusplus/oracle-aggregator branch from 6e6dba2 to 29e4ac1 Compare July 10, 2026 18:34
@boraerincplusplus boraerincplusplus force-pushed the boraplusplus/oracle-e2e-harness branch from e368980 to 290e53e Compare July 13, 2026 12:43
@boraerincplusplus boraerincplusplus force-pushed the boraplusplus/oracle-aggregator branch from b324085 to 606330c Compare July 13, 2026 14:00
@boraerincplusplus boraerincplusplus force-pushed the boraplusplus/oracle-e2e-harness branch from 86df22d to 191a836 Compare July 13, 2026 14:01
@boraerincplusplus boraerincplusplus changed the title Add oracle E2E test harness with mock and solanarpc sidecar specs project(sidecar): Add oracle E2E test harness with mock and solanarpc sidecar specs Jul 13, 2026
@boraerincplusplus boraerincplusplus force-pushed the boraplusplus/oracle-aggregator branch from 606330c to f074af9 Compare July 13, 2026 19:51
@boraerincplusplus boraerincplusplus force-pushed the boraplusplus/oracle-e2e-harness branch from 191a836 to 75d443b Compare July 13, 2026 19:51
@boraerincplusplus boraerincplusplus force-pushed the boraplusplus/oracle-aggregator branch from f074af9 to 4a64d45 Compare July 13, 2026 20:08
@boraerincplusplus boraerincplusplus force-pushed the boraplusplus/oracle-e2e-harness branch from 75d443b to b5cb326 Compare July 13, 2026 20:10
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.

1 participant