project(sidecar): Add oracle E2E test harness with mock and solanarpc sidecar specs#1407
Draft
boraerincplusplus wants to merge 3 commits into
Draft
Conversation
6e6dba2 to
29e4ac1
Compare
e368980 to
290e53e
Compare
b324085 to
606330c
Compare
86df22d to
191a836
Compare
606330c to
f074af9
Compare
191a836 to
75d443b
Compare
f074af9 to
4a64d45
Compare
75d443b to
b5cb326
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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:
OracleSidecarservice and accepts everyVerifyrequest unconditionally, without needing a real sidecar or Solana RPC. Built intobuild/oracle-sidecaralongside the other ICM service binaries.icm-contracts/tests/suites/oracle/: A Ginkgo suite with two specs:OracleAttestationwith dummy data.SOLANA_RPC_URLis set. Builds the real sidecar/ binary from theboraplusplus/oracle-sidecarbranch 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 viareceiveCrossChainMessage, 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 aLocalAvalancheNetworkwith one or two L1s depending on whether SOLANA_RPC_URL is set. AfterSuite kills both sidecar processes and tears down the network. One L1 testsMockSidecarone 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.