Skip to content

Commit

Permalink
Update relayer with latest tangle-runtime (#600)
Browse files Browse the repository at this point in the history
* update tangle-runtime and handlers

* move ethereum client to relayer types

* add signing rule config

* update proposal signing config to call signing contract

* clippy fix

* filter DKGphase2 events

* cargo fmt

* refactor proposal signing backend

* rename + clippy fix

* update comments
  • Loading branch information
salman01zp authored Jan 29, 2024
1 parent 4ee78e6 commit 4bcf93a
Show file tree
Hide file tree
Showing 33 changed files with 380 additions and 802 deletions.
52 changes: 39 additions & 13 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 4 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,16 @@ url = { version = "^2.3", features = ["serde"] }
sled = "^0.34"
tokio = { version = "^1", features = ["full"] }
config = { version = "0.13", default-features = false, features = ["toml", "json"] }
serde_json = { version = "^1", default-features = false }
serde_json = { version = "^1", default-features = false }
paw = { version = "^1.0" }
webb = { git = "https://github.com/webb-tools/webb-rs", default-features = false }
webb = { version = "0.8.4", default-features = false }
subxt-signer = { version = "0.31", features = ["subxt"] }
# Used by ethers (but we need it to be vendored with the lib).
native-tls = { version = "^0.2", features = ["vendored"] }
webb-proposals = { git = "https://github.com/webb-tools/webb-rs", branch="polkadot-sdk-v1.0.0", features = ["scale"] }
webb-proposals = { git = "https://github.com/webb-tools/webb-rs", features = ["scale"] }
ethereum-types = "0.14.1"
dotenv = "0.15.0"
bounded-collections = { version = "0.1.9", default-features = false, features = ["serde"] }
axum = { version = "0.6.12", features = ["ws"] }
reqwest = { version = "0.11", default-features = false, features = ["json", "rustls-tls"] }
tempfile = "^3.3"
Expand Down
1 change: 1 addition & 0 deletions crates/event-watcher-traits/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ webb-relayer-store = { path = "../relayer-store" }
webb-relayer-config = { path = "../relayer-config" }
webb-relayer-context = { path = "../relayer-context" }
webb-relayer-utils = { path = "../relayer-utils" }
webb-relayer-types = { path = "../relayer-types" }

async-trait = { workspace = true }
tracing = { workspace = true }
Expand Down
4 changes: 2 additions & 2 deletions crates/event-watcher-traits/src/evm/bridge_watcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use tokio::sync::Mutex;

use super::{event_watcher::EventWatcher, *};
use tokio::sync::Mutex;
use webb_relayer_types::EthersTimeLagClient;

/// A Bridge Watcher is a trait for Bridge contracts that not specific for watching events from that contract,
/// instead it watches for commands sent from other event watchers or services, it helps decouple the event watchers
Expand Down
20 changes: 3 additions & 17 deletions crates/event-watcher-traits/src/evm/event_watcher.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,10 @@
// See the License for the specific language governing permissions and
// limitations under the License.

use tokio::sync::Mutex;
use webb::evm::ethers::prelude::TimeLag;
use webb_relayer_utils::{multi_provider::MultiProvider, retry};

use super::*;

/// Ethereum client using Ethers, that includes a retry strategy.
pub type EthersClient =
providers::Provider<providers::RetryClient<MultiProvider<providers::Http>>>;

/// Ethereum TimeLag client using Ethers, that includes a retry strategy.
pub type EthersTimeLagClient = TimeLag<
Arc<
providers::Provider<
providers::RetryClient<MultiProvider<providers::Http>>,
>,
>,
>;
use tokio::sync::Mutex;
use webb_relayer_types::EthersTimeLagClient;
use webb_relayer_utils::retry;

/// A watchable contract is a contract used in the [EventWatcher]
pub trait WatchableContract: Send + Sync {
Expand Down
5 changes: 1 addition & 4 deletions crates/event-watcher-traits/src/evm/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ use std::sync::Arc;
use std::time::Duration;

use webb::evm::ethers::{
contract,
providers::{self, Middleware},
types,
types::transaction,
contract, providers::Middleware, types, types::transaction,
};
use webb_proposals::{ResourceId, TargetSystem, TypedChainId};
use webb_relayer_context::RelayerContext;
Expand Down
3 changes: 1 addition & 2 deletions crates/event-watcher-traits/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@
pub mod evm;
#[cfg(feature = "evm")]
pub use evm::{
BridgeWatcher, EthersClient, EthersTimeLagClient,
EventHandler as EVMEventHandler,
BridgeWatcher, EventHandler as EVMEventHandler,
EventHandlerWithRetry as EVMEventHandlerWithRetry,
EventWatcher as EVMEventWatcher,
};
Expand Down
1 change: 1 addition & 0 deletions crates/proposal-signing-backends/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ repository = { workspace = true }
webb-relayer-types = { workspace = true }
webb-relayer-store = { workspace = true }
webb-relayer-utils = { workspace = true }
webb-relayer-config = { workspace = true }

async-trait = { workspace = true }
tracing = { workspace = true }
Expand Down
Loading

0 comments on commit 4bcf93a

Please sign in to comment.