Skip to content

Commit

Permalink
fix state machine update notification errors for evm (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
Wizdave97 authored Mar 6, 2024
1 parent 3f080b7 commit ff95ffb
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Cargo.lock

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

9 changes: 5 additions & 4 deletions evm/common/src/provider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -459,9 +459,9 @@ where
_counterparty_state_id: StateMachineId,
) -> Result<BoxStream<StateMachineUpdated>, Error> {
let interval = time::interval(Duration::from_secs(self.config.poll_interval.unwrap_or(10)));

let initial_height = self.client.get_block_number().await?.low_u64();
let stream = stream::unfold(
(self.initial_height, interval, self.clone()),
(initial_height, interval, self.clone()),
move |(mut latest_height, mut interval, client)| async move {
let state_machine = client.state_machine;
loop {
Expand Down Expand Up @@ -493,11 +493,12 @@ where
{
Ok(events) => events,
Err(err) =>
// If the query failed we still advance the latest known height
return Some((
Err(err).context(format!(
"Failed to query events on {state_machine:?}"
"Failed to query state machine updates in range {latest_height:?}..{block_number:?} on {state_machine:?}"
)),
(latest_height, interval, client),
(block_number, interval, client),
)),
};
let mut events = results
Expand Down
2 changes: 1 addition & 1 deletion relayer/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "tesseract"
version = "0.2.2"
version = "0.2.3"
edition = "2021"
description = "Chain agnostic relayer implementation for ISMP"
authors = ["Polytope Labs <hello@polytope.technology>"]
Expand Down

0 comments on commit ff95ffb

Please sign in to comment.