Skip to content

feat: support for aptos#39

Open
frolvanya wants to merge 10 commits into
mainfrom
feat/aptos
Open

feat: support for aptos#39
frolvanya wants to merge 10 commits into
mainfrom
feat/aptos

Conversation

@frolvanya

Copy link
Copy Markdown
Contributor

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 using NearFinTransferWithMpcProof
  • process_fin_transfer_event — claims relayer fee using ClaimFeeWithMpcProofTx
  • process_deploy_token_event — binds token metadata using BindTokenWithMpcProofTx

Indexer types (bridge-indexer-types): adds AptosTransaction origin, AptosInitTransferMessage, AptosFinTransferMessage, AptosDeployToken, and AptosLogMetadata to the shared document types.

Config: new optional [aptos] section with rpc_http_url and omni_bridge_address; relayer account address read from APTOS_ACCOUNT_ADDRESS, private key from APTOS_PRIVATE_KEY.

Dependency updates: bumps omni-types and all bridge-sdk-rs crates to revisions that include Aptos support (aptos-bridge-client added).

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-types pulls near-mpc-contract-interface from crates.io while the new bridge clients pull it from git, making the MpcFinality type 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 upstream near/mpc dep is published to crates.io or the workspace is unified.

Pre-existing fixes (incidental)

  • native_indexers/solana.rs: FinTransfer::Solana and DeployToken::Solana were missing the chain_kind field
  • native_indexers/evm.rs: ChainKind::Fogo was missing from the non-EVM bail arm

Testing

Upstream PRs this depends on:

@frolvanya
frolvanya requested a review from a team as a code owner June 12, 2026 11:05
@frolvanya
frolvanya requested a review from Copilot June 12, 2026 11:05
fn build_evm_bridge_client(
config: &config::Config,
chain_kind: ChainKind,
mpc_finalities: Option<&HashMap<ChainKind, MpcFinality>>,

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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-types to 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.

Comment thread .github/workflows/claude-pr-review.yml
Comment thread .github/workflows/claude-pr-review.yml
Comment thread .github/workflows/claude-pr-review.yml
Comment thread omni-relayer/src/config.rs Outdated

@kiseln kiseln left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After you fix conflicts don't forget to update logging to spans

@frolvanya
frolvanya requested a review from kiseln July 1, 2026 20:55
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.

3 participants