Skip to content

Commit

Permalink
Revive new client and fix relay-halt issue (#2161)
Browse files Browse the repository at this point in the history
* Revert "Revert new client (#2153)"

This reverts commit 17cf7b596170419a1e9b9d39d7e329acdb1a87de.

* add comment re cache to CachingClient (#2162)

* do not wait for reader when sending items (#2163)

* Use unsync cache + async-aware sync primitives (#2164)

* use unsync cache + async-aware sync primitives

* clippy

* trigger CI

* Revert "trigger CI"

This reverts commit b5c1405492409b85abf552ba0b089c000824f722.
  • Loading branch information
svyatonik authored and bkontur committed May 15, 2024
1 parent 2590e75 commit 6262c62
Show file tree
Hide file tree
Showing 46 changed files with 2,373 additions and 1,415 deletions.
12 changes: 12 additions & 0 deletions Cargo.lock

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

2 changes: 1 addition & 1 deletion bridges/modules/relayers/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ pub mod pallet {
/// The overarching event type.
type RuntimeEvent: From<Event<Self>> + IsType<<Self as frame_system::Config>::RuntimeEvent>;
/// Type of relayer reward.
type Reward: AtLeast32BitUnsigned + Copy + Parameter + MaxEncodedLen;
type Reward: AtLeast32BitUnsigned + Copy + Member + Parameter + MaxEncodedLen;
/// Pay rewards scheme.
type PaymentProcedure: PaymentProcedure<Self::AccountId, Self::Reward>;
/// Stake and slash scheme.
Expand Down
4 changes: 2 additions & 2 deletions bridges/primitives/relayers/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,8 @@ pub struct RelayerRewardsKeyProvider<AccountId, Reward>(PhantomData<(AccountId,

impl<AccountId, Reward> StorageDoubleMapKeyProvider for RelayerRewardsKeyProvider<AccountId, Reward>
where
AccountId: Codec + EncodeLike,
Reward: Codec + EncodeLike,
AccountId: 'static + Codec + EncodeLike + Send + Sync,
Reward: 'static + Codec + EncodeLike + Send + Sync,
{
const MAP_NAME: &'static str = "RelayerRewards";

Expand Down
10 changes: 5 additions & 5 deletions bridges/primitives/runtime/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,9 +257,9 @@ pub trait StorageMapKeyProvider {
/// The same as `StorageMap::Hasher1`.
type Hasher: StorageHasher;
/// The same as `StorageMap::Key1`.
type Key: FullCodec;
type Key: FullCodec + Send + Sync;
/// The same as `StorageMap::Value`.
type Value: FullCodec;
type Value: 'static + FullCodec;

/// This is a copy of the
/// `frame_support::storage::generator::StorageMap::storage_map_final_key`.
Expand All @@ -279,13 +279,13 @@ pub trait StorageDoubleMapKeyProvider {
/// The same as `StorageDoubleMap::Hasher1`.
type Hasher1: StorageHasher;
/// The same as `StorageDoubleMap::Key1`.
type Key1: FullCodec;
type Key1: FullCodec + Send + Sync;
/// The same as `StorageDoubleMap::Hasher2`.
type Hasher2: StorageHasher;
/// The same as `StorageDoubleMap::Key2`.
type Key2: FullCodec;
type Key2: FullCodec + Send + Sync;
/// The same as `StorageDoubleMap::Value`.
type Value: FullCodec;
type Value: 'static + FullCodec;

/// This is a copy of the
/// `frame_support::storage::generator::StorageDoubleMap::storage_double_map_final_key`.
Expand Down
1 change: 1 addition & 0 deletions bridges/relays/client-substrate/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ rand = "0.8.5"
scale-info = { version = "2.11.1", features = ["derive"] }
tokio = { version = "1.37", features = ["rt-multi-thread"] }
thiserror = { workspace = true }
quick_cache = "0.3"

# Bridge dependencies

Expand Down
3 changes: 3 additions & 0 deletions bridges/relays/client-substrate/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ use sp_runtime::{
};
use std::{fmt::Debug, time::Duration};

/// Signed block type of given chain.
pub type SignedBlockOf<C> = <C as Chain>::SignedBlock;

/// Substrate-based chain from minimal relay-client point of view.
pub trait Chain: ChainBase + Clone {
/// Chain name.
Expand Down
Loading

0 comments on commit 6262c62

Please sign in to comment.