Skip to content

Commit

Permalink
feat: new version of relayer (#189)
Browse files Browse the repository at this point in the history
* feat: added native fee in structures (#69)

* chore: added `nativeFee` field

closes #47

* chore: renamed `eth` to `evm`

In general all methods that we're using for eth are also appliable for evm

* feat: handled scenario with insufficient fees

* chore: reordered events

* feat: get `wormhole_chain_id` based on recipient

* chore: renamed `withdraw_log` to `init_log`

Changed due to the new name in bridge token factory structure

* feat: updated to the latest version of omni-types

* feat: removed `check_bad_fees` logic

* chore: renamed `BAD_FEE_EVENTS` to `BAD_FEES`

* feat: removed whole bad fees logic

* feat: provided proper fee structure into signing method

* feat: updated accordingly to new version of bridge-sdk

* feat: claim native fee (#70)

* feat: added `fin_transfer` event to redis db

* feat: signing claiming native fee

* fix: sign_claim_native_fee call

* feat: added `claim_native_fee` call

* feat: handled `ClaimFeeEvent`

* fix: issues after merging

* chore: renamed `relayer` -> `relayer_address_on_evm`

* chore: use relayer from config

* fix: typo in redis key

* fix: expected different event

* chore: recipient should be our relayer

* fix: bunch of naming mistakes

* chore: renamed `fin_transfer_events` redis key

* feat: handled `FinTransferEvent` with some nonce

* chore: improved readability

* refactor: changed logging style

* feat: derive eth address from private key (#76)

* feat: derived eth pk from sk

* refactor: removed optional typing

* refactor: shortened code

* feat: used existing crate to derive pk

* refactor: moved `relayer_address` under `evm` struct

* chore: some renamings

* chore: updated omni-types (#92)

* feat: wait for eth light client (#71)

* feat: wait until light client receives info about block

closes #63

* chore: added config.toml to .gitignore

* chore: renamed method in evm worker

* chore: made clippy happy

* fix: issues after merging

* chore: fixed style

* chore: added example config

* chore: moved `eth_light_client` under `evm` config

* feat: check block number before claiming fee

* feat: added sleep for light client waiting time

* fix: don't wait for light client if we have vaa

* fix: constructed proper `FinTransferArgs`

* feat: added wormhole support for `claim_fee` worker

* feat: expect either fintransfer or claimfee event

* fix: provided correct args for claiming fee

* chore: provided proper name for prover args constructor

* feat: scratch implementation of fee estimation (#81)

* feat: scratch implementation of fee estimation

* refactor: few tweaks

* chore: better way to handle `UpdateFee` event

* Squashed commit of the following:

commit 3d2e905
Author: Ivan Frolov <[email protected]>
Date:   Fri Oct 25 16:39:22 2024 +0200

    chore: provided proper name for prover args constructor

commit 8857140
Author: Ivan Frolov <[email protected]>
Date:   Thu Oct 24 22:48:15 2024 +0200

    fix: provided correct args for claiming fee

commit 160e0e3
Author: Ivan Frolov <[email protected]>
Date:   Thu Oct 24 22:14:02 2024 +0200

    feat: expect either fintransfer or claimfee event

commit 1a8def1
Author: Ivan Frolov <[email protected]>
Date:   Thu Oct 24 21:07:14 2024 +0200

    feat: added wormhole support for `claim_fee` worker

commit 1a3c711
Author: Ivan Frolov <[email protected]>
Date:   Thu Oct 24 20:49:32 2024 +0200

    fix: constructed proper `FinTransferArgs`

commit ad16b81
Merge: 8b469bc 4786123
Author: Ivan Frolov <[email protected]>
Date:   Thu Oct 24 15:35:10 2024 +0200

    Merge branch 'relayer' into feat/wait-for-light-client

commit 8b469bc
Author: Ivan Frolov <[email protected]>
Date:   Thu Oct 24 15:26:28 2024 +0200

    fix: don't wait for light client if we have vaa

commit 68821cd
Author: Ivan Frolov <[email protected]>
Date:   Thu Oct 24 15:23:01 2024 +0200

    feat: added sleep for light client waiting time

commit 998b21e
Author: Ivan Frolov <[email protected]>
Date:   Thu Oct 24 15:21:32 2024 +0200

    feat: check block number before claiming fee

commit ad692b6
Author: Ivan Frolov <[email protected]>
Date:   Thu Oct 24 15:18:27 2024 +0200

    chore: moved `eth_light_client` under `evm` config

commit 4786123
Author: Ivan Frolov <[email protected]>
Date:   Thu Oct 24 01:00:24 2024 +0200

    chore: updated omni-types (#92)

commit 96954ae
Author: Ivan Frolov <[email protected]>
Date:   Thu Oct 17 11:16:32 2024 +0100

    chore: added example config

commit ad35e56
Author: Ivan Frolov <[email protected]>
Date:   Thu Oct 17 11:09:49 2024 +0100

    chore: fixed style

commit 7473caa
Author: Ivan Frolov <[email protected]>
Date:   Thu Oct 17 11:07:26 2024 +0100

    fix: issues after merging

commit 316a90f
Author: Ivan Frolov <[email protected]>
Date:   Wed Oct 9 14:42:46 2024 +0100

    chore: made clippy happy

commit 8d44254
Author: Ivan Frolov <[email protected]>
Date:   Wed Oct 9 14:07:31 2024 +0100

    chore: renamed method in evm worker

commit b3118d9
Author: Ivan Frolov <[email protected]>
Date:   Wed Oct 9 13:56:14 2024 +0100

    chore: added config.toml to .gitignore

commit f0677a8
Author: Ivan Frolov <[email protected]>
Date:   Wed Oct 9 13:42:03 2024 +0100

    feat: wait until light client receives info about block

    closes #63

* Squashed commit of the following:

commit 4786123
Author: Ivan Frolov <[email protected]>
Date:   Thu Oct 24 01:00:24 2024 +0200

    chore: updated omni-types (#92)

* fix: read estimated gas as u64

* chore: updated bridge-sdk

* fix: removed unnecessary things from fee estimation

* feat: added retry logic while estimating fee (#105)

* feat: added retry logic and changed location for checking fee

* refactor: swapped if blocks

* feat: changed retry logic

* fix: addressed issues

* feat: support of multiple chains (#146)

* feat: scratch implementation of supporting multiple chains

* chore: removed claiming native fee on EVM chain

* chore: updated example configuration

* fix: getting vaa

* feat: working version of relayer with multiple chains support

* feat: call proper `fin_transfer` based on recipient chain

* refactor: reduced code duplication by abstracting evm indexer

* feat: removed `sign_claim_native_fee` logic

* chore: removed few newlines

* refactor: reduced code duplication in config structs

* feat: getting native token id by calling a method

* chore: added a disclaimer that `get_native_token_id` is not working for now

* feat: made evm chains optional

* feat: refactor evm bridge clients initialization

* feat: solana support (#153)

* feat: added solana indexer

* feat: added finalization from solana

* feat: finished solana init&finalize transfer

* feat: added solana live logs support

* feat: added support for `..._transfer_sol` methods

* chore: updated bridge token addresses

* fix: bug with provided chain_kind

* fix: storage deposit amount calculation

* chore: few log modifications

* fix: few tweaks to make solana transfers work

* feat: added native_fee support for storage_deposit args from solana

* chore: add a todo mentioning that `get_storage_deposit_actions` method is redundant

* chore: added comment about aws usage

* refactor: reduced code duplication for creating storage deposit actions

* fix: h160 address parsing

* feat: solana transfer native tokens

* fix: near -> sol native token transfer

* fix: solana indexer logic

* feat: support non-near to non-near transfers

* feat: replaced anchor deserialization with borsh

* chore: start from block + 1

Since this block was already processed, there's no need to check it one more time

* fix: near sign transfer

* fix: prevented issues that could result in panic

* chore: updated bridge token address

* fix: use eth light client only for eth chain

* refactor: moved timestamps checks to the bottom

This ensures at least one execution

* chore: added some comments for solana network configuation

* fix: use eth light client only for eth chain and when vaa is none

* feat: made solana-indexer less complicated

* feat: implemented fee check (#172)

* chore: synced changes with main

* chore: fmt

* chore: added relayer to clippy makefile

* feat: constructed persistent account keys from instruction (#191)

* chore: updated mainnet example config

* chore: removed `eth.rs` that was pulled from main during merge

* refactor: simplify extraction of evm config

* feat: added an option to provide solana credentials using path

* chore: updated testnet `api_key` replacement

* chore: renamed `RPC_API_KEY` to more specific `INFURA_API_KEY`

* feat: improved the process of getting private keys from file

* chore: removed unnecessary `Result`

* chore: updated omni-types version
  • Loading branch information
frolvanya authored Jan 17, 2025
1 parent b0ca4e1 commit 2d56521
Show file tree
Hide file tree
Showing 29 changed files with 6,904 additions and 3,739 deletions.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
.DS_Store
**/target
**/config.toml
**/.env
.history
node_modules
near/res/mock_token.wasm
near/res/mock_prover.wasm
near/res/omni_tests.wasm
near/res/omni_tests.wasm
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ RUSTFLAGS = -C link-arg=-s
NEAR_MANIFEST = ./near/Cargo.toml
OMNI_RELAYER_MANIFEST = ./omni-relayer/Cargo.toml

clippy: clippy-near #clippy-relayer
clippy: clippy-near clippy-omni-relayer

clippy-near: rust-build-token
cargo clippy --manifest-path $(NEAR_MANIFEST) -- $(LINT_OPTIONS)
Expand Down
16 changes: 16 additions & 0 deletions omni-relayer/.example-env
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
RUST_LOG=info

# It's used for near-lake-framework
AWS_ACCESS_KEY_ID=...
AWS_SECRET_ACCESS_KEY=...

NEAR_ACCOUNT_ID=...
NEAR_PRIVATE_KEY=...

INFURA_API_KEY=...
ETH_PRIVATE_KEY=...
BASE_PRIVATE_KEY=...
ARB_PRIVATE_KEY=...

# Note that solana private key must be encoded to bs58 string in order to use it
SOLANA_PRIVATE_KEY=...
Loading

0 comments on commit 2d56521

Please sign in to comment.