feat: support for aptos#39
Conversation
| fn build_evm_bridge_client( | ||
| config: &config::Config, | ||
| chain_kind: ChainKind, | ||
| mpc_finalities: Option<&HashMap<ChainKind, MpcFinality>>, |
There was a problem hiding this comment.
mpc_finalities are dropped for now, because of dependency conflict. Out omni-types use near-mpc-sdk v0.0.1, when I set it to updated version that knows about AptosFinality, it requires our omni-bridge to use near-sdk-rs v5.28.0+, but this version already requires rustc v1.88.0+, but mainnet is not updated yet to support contract compilation with rust version higher than 1.86.0
There was a problem hiding this comment.
Pull request overview
This PR adds Aptos as a supported chain in omni-relayer, following the existing MPC-proof-based finalization flow already used for Starknet. It also updates the shared bridge-indexer-types event/document schema to represent Aptos-origin transactions and messages, and bumps bridge-sdk-rs / omni-types revisions to pick up Aptos support in the SDK. Additionally, it introduces a GitHub Actions workflow + scripts/prompts for automated Claude-based PR review.
Changes:
- Add an Aptos worker and wire Aptos init/fin/deploy event handling through the relayer pipeline (including config/env plumbing).
- Extend
bridge-indexer-typesto include Aptos transaction origins, transfer messages, and meta events. - Update dependencies (bridge SDK + omni-types) and add a Claude PR review workflow + helper script/prompt.
Reviewed changes
Copilot reviewed 19 out of 20 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| omni-relayer/src/workers/near.rs | Add Aptos handling to NEAR-side sign/finalize flow. |
| omni-relayer/src/workers/mod.rs | Introduce Aptos variants for Transfer/FinTransfer/DeployToken and route them to the new worker. |
| omni-relayer/src/workers/aptos.rs | New Aptos worker implementing init/fin/deploy processing using MPC-proof transactions. |
| omni-relayer/src/utils/storage.rs | Allow Aptos token address parsing when resolving NEAR token IDs. |
| omni-relayer/src/utils/nonce.rs | Explicitly treat Aptos as unsupported for EVM nonce managers. |
| omni-relayer/src/utils/kyt.rs | Update KYT blockchain tag mapping to account for Aptos. |
| omni-relayer/src/startup/native_indexers/solana.rs | Populate chain_kind in Solana FinTransfer/DeployToken events (incidental fix). |
| omni-relayer/src/startup/native_indexers/evm.rs | Fix unsupported-chain bail arm to include missing chain kinds (incidental fix). |
| omni-relayer/src/startup/mod.rs | Build and register an Aptos bridge client; remove MPC finality wiring for EVM/Starknet clients (documented limitation). |
| omni-relayer/src/startup/event_handlers.rs | Whitelist + enqueue Aptos init/fin/deploy events from the indexer stream. |
| omni-relayer/src/config.rs | Add [aptos] config section + env var accessors for Aptos key/address. |
| omni-relayer/example-testnet-config.toml | Add commented Aptos config example. |
| omni-relayer/example-mainnet-config.toml | Add commented Aptos config example. |
| omni-relayer/Cargo.toml | Bump bridge-sdk-rs revs and add aptos-bridge-client. |
| Cargo.toml | Update omni-types revision. |
| Cargo.lock | Lockfile updates for new/updated dependencies (incl. aptos-bridge-client). |
| bridge-indexer-types/src/documents_types.rs | Add Aptos transaction origin + transfer/meta event types. |
| .github/workflows/claude-pr-review.yml | New Claude PR review workflow. |
| .github/scripts/fetch-pr-comments.sh | Helper script to fetch existing PR discussion context via GraphQL. |
| .github/prompts/pr-review.prompt.md | Prompt instructions for Claude-based PR reviews. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
kiseln
left a comment
There was a problem hiding this comment.
After you fix conflicts don't forget to update logging to spans
Add Aptos chain support
Adds Aptos as a supported chain to the omni-relayer, following the same MPC-proof-based finalization pattern used by Starknet.
What's included
New worker (
omni-relayer/src/workers/aptos.rs): handles all three event types —process_init_transfer_event— finalizes inbound Aptos→NEAR transfers usingNearFinTransferWithMpcProofprocess_fin_transfer_event— claims relayer fee usingClaimFeeWithMpcProofTxprocess_deploy_token_event— binds token metadata usingBindTokenWithMpcProofTxIndexer types (
bridge-indexer-types): addsAptosTransactionorigin,AptosInitTransferMessage,AptosFinTransferMessage,AptosDeployToken, andAptosLogMetadatato the shared document types.Config: new optional
[aptos]section withrpc_http_urlandomni_bridge_address; relayer account address read fromAPTOS_ACCOUNT_ADDRESS, private key fromAPTOS_PRIVATE_KEY.Dependency updates: bumps
omni-typesand allbridge-sdk-rscrates to revisions that include Aptos support (aptos-bridge-clientadded).Known limitation
MPC finality is not currently wired to the EVM and Starknet bridge clients (it was previously). This is caused by a diamond dependency conflict:
omni-typespullsnear-mpc-contract-interfacefrom crates.io while the new bridge clients pull it from git, making theMpcFinalitytype incompatible at the crate boundary. The clients fall back to their safe default finality thresholds — behavior is correct, just not optimized. This will be restored once the upstreamnear/mpcdep is published to crates.io or the workspace is unified.Pre-existing fixes (incidental)
native_indexers/solana.rs:FinTransfer::SolanaandDeployToken::Solanawere missing thechain_kindfieldnative_indexers/evm.rs:ChainKind::Fogowas missing from the non-EVM bail armTesting
Upstream PRs this depends on:
bridge-sdk-rsfeat: support for aptos bridge-sdk-rs#294 —aptos-bridge-clientcrateomni-bridgefeat: Aptos support omni-bridge#626 — Aptos inomni-types