diff --git a/omni-relayer/Cargo.lock b/omni-relayer/Cargo.lock index fc71b4aa..03898262 100644 --- a/omni-relayer/Cargo.lock +++ b/omni-relayer/Cargo.lock @@ -133,9 +133,9 @@ dependencies = [ [[package]] name = "alloy-chains" -version = "0.1.56" +version = "0.1.57" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a725039ef382d1b6b4e2ebcb15b1efff6cde9af48c47a1bdce6fb67b9456c34b" +checksum = "4ab9d1367c6ffb90c93fb4a9a4989530aa85112438c6f73a734067255d348469" dependencies = [ "alloy-primitives", "num_enum", @@ -1173,9 +1173,9 @@ checksum = "ace50bade8e6234aa140d9a2f552bbee1db4d353f69b8217bc503490fc1a9f26" [[package]] name = "aws-config" -version = "1.5.14" +version = "1.5.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f40e82e858e02445402906e454a73e244c7f501fcae198977585946c48e8697" +checksum = "dc47e70fc35d054c8fcd296d47a61711f043ac80534a10b4f741904f81e73a90" dependencies = [ "aws-credential-types", "aws-runtime", @@ -1236,14 +1236,14 @@ dependencies = [ "percent-encoding", "pin-project-lite", "tracing", - "uuid 1.12.0", + "uuid 1.12.1", ] [[package]] name = "aws-sdk-s3" -version = "1.69.0" +version = "1.71.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a88f1c30e4ffa2464f910297c24736ff68cca9e8d2b7d52596b54efd99b9c1e" +checksum = "705cb534fb7b620f540d2fac268d378918dc67d25b173f67edcab3851fe19392" dependencies = [ "aws-credential-types", "aws-runtime", @@ -1275,9 +1275,9 @@ dependencies = [ [[package]] name = "aws-sdk-sso" -version = "1.54.0" +version = "1.56.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "921a13ed6aabe2d1258f65ef7804946255c799224440774c30e1a2c65cdf983a" +checksum = "12e057fdcb8842de9b83592a70f5b4da0ee10bc0ad278247da1425a742a444d7" dependencies = [ "aws-credential-types", "aws-runtime", @@ -1297,9 +1297,9 @@ dependencies = [ [[package]] name = "aws-sdk-ssooidc" -version = "1.55.0" +version = "1.57.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "196c952738b05dfc917d82a3e9b5ba850822a6d6a86d677afda2a156cc172ceb" +checksum = "a120ade4a44691b3c5c2ff2fa61b14ed331fdc218397f61ab48d66593012ae2a" dependencies = [ "aws-credential-types", "aws-runtime", @@ -1319,9 +1319,9 @@ dependencies = [ [[package]] name = "aws-sdk-sts" -version = "1.55.0" +version = "1.57.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ef5b73a927ed80b44096f8c20fb4abae65469af15198367e179ae267256e9d" +checksum = "115fd4fb663817ed595a5ee4f1649d7aacd861d47462323cb37576ce89271b93" dependencies = [ "aws-credential-types", "aws-runtime", @@ -1815,7 +1815,7 @@ dependencies = [ [[package]] name = "bridge-connector-common" version = "0.1.0" -source = "git+https://github.com/Near-One/bridge-sdk-rs?branch=feat%2Fadded-gas-estimation#bfffa661b94b0f59de3ddd8bceaf67f26f4c673f" +source = "git+https://github.com/Near-One/bridge-sdk-rs#b205ad874cab977864e10290e9c14a01778a39e1" dependencies = [ "eth-proof", "ethers", @@ -1840,9 +1840,9 @@ dependencies = [ [[package]] name = "brotli-decompressor" -version = "4.0.1" +version = "4.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a45bd2e4095a8b518033b128020dd4a55aab1c0a381ba4404a472630f4bc362" +checksum = "74fa05ad7d803d413eb8380983b092cbbaf9a85f151b871360e7b00cd7060b37" dependencies = [ "alloc-no-stdlib", "alloc-stdlib", @@ -2427,9 +2427,9 @@ checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" [[package]] name = "crunchy" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +checksum = "43da5946c66ffcc7745f48db692ffbb10a83bfe0afd96235c5c2a4fb23994929" [[package]] name = "crypto-bigint" @@ -3183,7 +3183,7 @@ dependencies = [ [[package]] name = "eth-proof" version = "0.1.0" -source = "git+https://github.com/Near-One/bridge-sdk-rs?branch=feat%2Fadded-gas-estimation#bfffa661b94b0f59de3ddd8bceaf67f26f4c673f" +source = "git+https://github.com/Near-One/bridge-sdk-rs#b205ad874cab977864e10290e9c14a01778a39e1" dependencies = [ "borsh 1.5.5", "cita_trie", @@ -3552,7 +3552,7 @@ dependencies = [ [[package]] name = "evm-bridge-client" version = "0.1.0" -source = "git+https://github.com/Near-One/bridge-sdk-rs?branch=feat%2Fadded-gas-estimation#bfffa661b94b0f59de3ddd8bceaf67f26f4c673f" +source = "git+https://github.com/Near-One/bridge-sdk-rs#b205ad874cab977864e10290e9c14a01778a39e1" dependencies = [ "borsh 1.5.5", "bridge-connector-common", @@ -4625,13 +4625,13 @@ checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" [[package]] name = "is-terminal" -version = "0.4.13" +version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "261f68e344040fbd0edea105bef17c66edf46f984ddb1115b775ce31be948f4b" +checksum = "e19b23d53f35ce9f56aebc7d1bb4e6ac1e9c0db7ac85c8d1760c04379edced37" dependencies = [ "hermit-abi 0.4.0", "libc", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -5063,7 +5063,7 @@ dependencies = [ [[package]] name = "near-bridge-client" version = "0.1.0" -source = "git+https://github.com/Near-One/bridge-sdk-rs?branch=feat%2Fadded-gas-estimation#bfffa661b94b0f59de3ddd8bceaf67f26f4c673f" +source = "git+https://github.com/Near-One/bridge-sdk-rs#b205ad874cab977864e10290e9c14a01778a39e1" dependencies = [ "borsh 1.5.5", "bridge-connector-common", @@ -5292,7 +5292,7 @@ dependencies = [ [[package]] name = "near-light-client-on-eth" version = "0.1.0" -source = "git+https://github.com/Near-One/bridge-sdk-rs?branch=feat%2Fadded-gas-estimation#bfffa661b94b0f59de3ddd8bceaf67f26f4c673f" +source = "git+https://github.com/Near-One/bridge-sdk-rs#b205ad874cab977864e10290e9c14a01778a39e1" dependencies = [ "ethereum-types 0.14.1", "ethers", @@ -5464,7 +5464,7 @@ dependencies = [ [[package]] name = "near-rpc-client" version = "0.1.0" -source = "git+https://github.com/Near-One/bridge-sdk-rs?branch=feat%2Fadded-gas-estimation#bfffa661b94b0f59de3ddd8bceaf67f26f4c673f" +source = "git+https://github.com/Near-One/bridge-sdk-rs#b205ad874cab977864e10290e9c14a01778a39e1" dependencies = [ "borsh 1.5.5", "lazy_static", @@ -5857,7 +5857,7 @@ dependencies = [ [[package]] name = "omni-connector" version = "0.1.0" -source = "git+https://github.com/Near-One/bridge-sdk-rs?branch=feat%2Fadded-gas-estimation#bfffa661b94b0f59de3ddd8bceaf67f26f4c673f" +source = "git+https://github.com/Near-One/bridge-sdk-rs#b205ad874cab977864e10290e9c14a01778a39e1" dependencies = [ "borsh 1.5.5", "bridge-connector-common", @@ -6007,9 +6007,9 @@ dependencies = [ [[package]] name = "openssl-probe" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" [[package]] name = "openssl-src" @@ -6707,9 +6707,9 @@ dependencies = [ [[package]] name = "redis" -version = "0.28.1" +version = "0.28.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f89727cba9cec05cc579942321ff6dd09fe57a8b3217f52f952301efa010da5" +checksum = "e37ec3fd44bea2ec947ba6cc7634d7999a6590aca7c35827c250bc0de502bda6" dependencies = [ "arc-swap", "bytes", @@ -7054,9 +7054,9 @@ dependencies = [ [[package]] name = "rustix" -version = "0.38.43" +version = "0.38.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a78891ee6bf2340288408954ac787aa063d8e8817e9f53abb37c695c6d834ef6" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" dependencies = [ "bitflags 2.8.0", "errno", @@ -7813,7 +7813,7 @@ dependencies = [ [[package]] name = "solana-bridge-client" version = "0.1.0" -source = "git+https://github.com/Near-One/bridge-sdk-rs?branch=feat%2Fadded-gas-estimation#bfffa661b94b0f59de3ddd8bceaf67f26f4c673f" +source = "git+https://github.com/Near-One/bridge-sdk-rs#b205ad874cab977864e10290e9c14a01778a39e1" dependencies = [ "borsh 1.5.5", "derive_builder 0.20.2", @@ -10289,9 +10289,9 @@ checksum = "75b844d17643ee918803943289730bec8aac480150456169e647ed0b576ba539" [[package]] name = "unicode-ident" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" +checksum = "11cd88e12b17c6494200a9c1b683a04fcac9573ed74cd1b62aeb2727c5592243" [[package]] name = "unicode-width" @@ -10405,9 +10405,9 @@ dependencies = [ [[package]] name = "uuid" -version = "1.12.0" +version = "1.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "744018581f9a3454a9e15beb8a33b017183f1e7c0cd170232a2d1453b23a51c4" +checksum = "b3758f5e68192bb96cc8f9b7e2c2cfdabb435499a28499a42f8f984092adad4b" [[package]] name = "valuable" @@ -10869,7 +10869,7 @@ dependencies = [ [[package]] name = "wormhole-bridge-client" version = "0.1.0" -source = "git+https://github.com/Near-One/bridge-sdk-rs?branch=feat%2Fadded-gas-estimation#bfffa661b94b0f59de3ddd8bceaf67f26f4c673f" +source = "git+https://github.com/Near-One/bridge-sdk-rs#b205ad874cab977864e10290e9c14a01778a39e1" dependencies = [ "bridge-connector-common", "derive_builder 0.20.2", diff --git a/omni-relayer/Cargo.toml b/omni-relayer/Cargo.toml index 6ed6226b..9127aa93 100644 --- a/omni-relayer/Cargo.toml +++ b/omni-relayer/Cargo.toml @@ -41,16 +41,16 @@ alloy = { version = "0.9", features = ["node-bindings", "providers", "rpc-types" redis = { version = "0.28.1", features = ["aio", "tokio-comp"] } reqwest = "0.12" -eth-proof = { git = "https://github.com/Near-One/bridge-sdk-rs", package = "eth-proof", branch = "feat/added-gas-estimation" } +eth-proof = { git = "https://github.com/Near-One/bridge-sdk-rs", package = "eth-proof" } -bridge-connector-common = { git = "https://github.com/Near-One/bridge-sdk-rs", package = "bridge-connector-common", branch = "feat/added-gas-estimation" } +bridge-connector-common = { git = "https://github.com/Near-One/bridge-sdk-rs", package = "bridge-connector-common" } -near-bridge-client = { git = "https://github.com/Near-One/bridge-sdk-rs", package = "near-bridge-client", branch = "feat/added-gas-estimation" } -evm-bridge-client = { git = "https://github.com/Near-One/bridge-sdk-rs", package = "evm-bridge-client", branch = "feat/added-gas-estimation" } -solana-bridge-client = { git = "https://github.com/Near-One/bridge-sdk-rs", package = "solana-bridge-client", branch = "feat/added-gas-estimation" } -wormhole-bridge-client = { git = "https://github.com/Near-One/bridge-sdk-rs", package = "wormhole-bridge-client", branch = "feat/added-gas-estimation" } +near-bridge-client = { git = "https://github.com/Near-One/bridge-sdk-rs", package = "near-bridge-client" } +evm-bridge-client = { git = "https://github.com/Near-One/bridge-sdk-rs", package = "evm-bridge-client" } +solana-bridge-client = { git = "https://github.com/Near-One/bridge-sdk-rs", package = "solana-bridge-client" } +wormhole-bridge-client = { git = "https://github.com/Near-One/bridge-sdk-rs", package = "wormhole-bridge-client" } -omni-connector = { git = "https://github.com/Near-One/bridge-sdk-rs", package = "omni-connector", branch = "feat/added-gas-estimation" } +omni-connector = { git = "https://github.com/Near-One/bridge-sdk-rs", package = "omni-connector" } [features] disable_fee_check = [] diff --git a/omni-relayer/example-mainnet-config.toml b/omni-relayer/example-mainnet-config.toml index cee551b7..949272ea 100644 --- a/omni-relayer/example-mainnet-config.toml +++ b/omni-relayer/example-mainnet-config.toml @@ -1,3 +1,6 @@ +[redis] +url = "redis://127.0.0.1/" + [bridge_indexer] api_url = "http://127.0.0.1:8080" diff --git a/omni-relayer/src/workers/evm.rs b/omni-relayer/src/workers/evm.rs index 1a9608f7..0468ff71 100644 --- a/omni-relayer/src/workers/evm.rs +++ b/omni-relayer/src/workers/evm.rs @@ -9,7 +9,7 @@ use ethereum_types::H256; use omni_connector::OmniConnector; #[cfg(not(feature = "disable_fee_check"))] use omni_types::Fee; -use omni_types::{prover_result::ProofKind, ChainKind, OmniAddress}; +use omni_types::{ChainKind, OmniAddress}; use crate::{config, utils}; @@ -216,26 +216,8 @@ async fn handle_init_transfer_event( } } - let Some(topic) = init_transfer_with_timestamp.log.topic0() else { - warn!("No topic0 in log: {:?}", init_transfer_with_timestamp.log); - return; - }; - let tx_hash = H256::from_slice(tx_hash.as_slice()); - let Some(prover_args) = utils::evm::construct_prover_args( - &config, - vaa, - tx_hash, - H256::from_slice(topic.as_slice()), - ProofKind::InitTransfer, - ) - .await - else { - warn!("Failed to construct prover args"); - return; - }; - let storage_deposit_actions = match utils::storage::get_storage_deposit_actions( &connector, init_transfer_with_timestamp.chain_kind, @@ -253,10 +235,18 @@ async fn handle_init_transfer_event( } }; - let fin_transfer_args = omni_connector::FinTransferArgs::NearFinTransfer { - chain_kind: init_transfer_with_timestamp.chain_kind, - storage_deposit_actions, - prover_args, + let fin_transfer_args = if let Some(vaa) = vaa { + omni_connector::FinTransferArgs::NearFinTransferWithVaa { + chain_kind: init_transfer_with_timestamp.chain_kind, + storage_deposit_actions, + vaa, + } + } else { + omni_connector::FinTransferArgs::NearFinTransferWithEvmProof { + chain_kind: init_transfer_with_timestamp.chain_kind, + tx_hash, + storage_deposit_actions, + } }; match connector.fin_transfer(fin_transfer_args).await { diff --git a/omni-relayer/src/workers/solana.rs b/omni-relayer/src/workers/solana.rs index 463f2965..8370bcd2 100644 --- a/omni-relayer/src/workers/solana.rs +++ b/omni-relayer/src/workers/solana.rs @@ -7,9 +7,7 @@ use log::{info, warn}; use omni_connector::OmniConnector; #[cfg(not(feature = "disable_fee_check"))] use omni_types::Fee; -use omni_types::{ - prover_args::WormholeVerifyProofArgs, prover_result::ProofKind, ChainKind, OmniAddress, -}; +use omni_types::{ChainKind, OmniAddress}; use solana_client::nonblocking::rpc_client::RpcClient; #[cfg(not(feature = "disable_fee_check"))] use solana_sdk::pubkey::Pubkey; @@ -280,15 +278,6 @@ async fn handle_init_transfer_event( return; }; - let wormhole_proof_args = WormholeVerifyProofArgs { - proof_kind: ProofKind::InitTransfer, - vaa, - }; - let Ok(prover_args) = borsh::to_vec(&wormhole_proof_args) else { - warn!("Failed to serialize WormholeVerifyProofArgs"); - return; - }; - let storage_deposit_actions = match utils::storage::get_storage_deposit_actions( &connector, ChainKind::Sol, @@ -306,10 +295,10 @@ async fn handle_init_transfer_event( } }; - let fin_transfer_args = omni_connector::FinTransferArgs::NearFinTransfer { + let fin_transfer_args = omni_connector::FinTransferArgs::NearFinTransferWithVaa { chain_kind: ChainKind::Sol, storage_deposit_actions, - prover_args, + vaa, }; match connector.fin_transfer(fin_transfer_args).await {