Skip to content

Commit

Permalink
feat(voyager): remove unnecessary epoch wait on evm
Browse files Browse the repository at this point in the history
  • Loading branch information
benluelo committed Nov 1, 2023
1 parent f4302f7 commit e329384
Show file tree
Hide file tree
Showing 9 changed files with 1,048 additions and 553 deletions.
2 changes: 1 addition & 1 deletion lib/unionlabs/src/proof.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ use crate::{

/// `IbcPath` represents the path to a light client's ibc storage. The values stored at each path
/// are strongly typed, i.e. `connections/{connection_id}` always stores a [`ConnectionEnd`].
pub trait IbcPath<This: Chain, Counterparty>: Display + Clone + Sized {
pub trait IbcPath<This: Chain, Counterparty: Chain>: Display + Clone + Sized {
type Output: Debug + Clone + Serialize;
}

Expand Down
32 changes: 29 additions & 3 deletions voyager/src/chain.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,22 @@ use futures::Future;
use serde::{Deserialize, Serialize};
use unionlabs::{
ethereum_consts_traits::{Mainnet, Minimal},
ibc::core::client::height::{HeightFromStrError, IsHeight},
ibc::core::{
channel::channel::Channel,
client::height::{HeightFromStrError, IsHeight},
connection::connection_end::ConnectionEnd,
},
id::{ChannelId, ConnectionId, PortId},
traits::{self, Chain},
};

use crate::{
chain::proof::{IbcStateRead, IbcStateReadPaths, StateProof},
chain::proof::{IbcStateRead, IbcStateReadPaths},
config::{self, ChainConfig, EvmChainConfig},
msg::{
aggregate::LightClientSpecificAggregate,
data::LightClientSpecificData,
fetch::{FetchUpdateHeaders, LightClientSpecificFetch},
fetch::{FetchStateProof, FetchUpdateHeaders, LightClientSpecificFetch},
msg::Msg,
DoAggregate, RelayerMsg,
},
Expand Down Expand Up @@ -118,6 +123,25 @@ pub trait LightClientBase: Send + Sync + Sized {

fn from_chain(chain: Self::HostChain) -> Self;

fn channel(
&self,
channel_id: ChannelId,
port_id: PortId,
at: HeightOf<Self::HostChain>,
) -> impl Future<Output = Channel> + '_;

fn connection(
&self,
connection_id: ConnectionId,
at: HeightOf<Self::HostChain>,
) -> impl Future<
Output = ConnectionEnd<
Self::ClientId,
<Self::Counterparty as LightClientBase>::ClientId,
String,
>,
> + '_;

// TODO: Use state_proof instead
fn query_client_state(
&self,
Expand Down Expand Up @@ -157,6 +181,8 @@ pub trait LightClient: LightClientBase<Counterparty = Self::BaseCounterparty> {
/// Error type for [`Self::msg`].
type MsgError: MaybeRecoverableError;

fn proof(&self, msg: FetchStateProof<Self>) -> RelayerMsg;

fn msg(&self, msg: Msg<Self>) -> impl Future<Output = Result<(), Self::MsgError>> + '_;

fn do_fetch(&self, msg: Self::Fetch) -> impl Future<Output = Vec<RelayerMsg>> + '_;
Expand Down
Loading

0 comments on commit e329384

Please sign in to comment.